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 715919aac269..9615f03830c8 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 @@ -199,18 +199,18 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateMessageAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateRun(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateRun(string threadId, Azure.Core.RequestContent content, System.Collections.Generic.IEnumerable include = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateRun(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateRunAsync(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateRunAsync(string threadId, Azure.Core.RequestContent content, System.Collections.Generic.IEnumerable include = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThread(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateThread(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThreadAndRun(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateThreadAndRun(string agentId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAndRunAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string agentId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateThreadAsync(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStore(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -239,10 +239,10 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual Azure.Response DeleteVectorStoreFile(string vectorStoreId, string fileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAgent(string assistantId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAgent(string assistantId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAgentAsync(string assistantId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAgentAsync(string assistantId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAgent(string agentId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAgent(string agentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAgentAsync(string agentId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAgentAsync(string agentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response> GetAgents(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task>> GetAgentsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetFile(string fileId, Azure.RequestContext context) { throw null; } @@ -313,10 +313,10 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task SubmitToolOutputsToRunAsync(string threadId, string runId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.ClientModel.CollectionResult SubmitToolOutputsToStream(Azure.AI.Projects.ThreadRun run, System.Collections.Generic.IEnumerable toolOutputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.AsyncCollectionResult SubmitToolOutputsToStreamAsync(Azure.AI.Projects.ThreadRun run, System.Collections.Generic.IEnumerable toolOutputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateAgent(string assistantId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateAgent(string assistantId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateAgentAsync(string assistantId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAgentAsync(string assistantId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateAgent(string agentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateAgent(string agentId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAgentAsync(string agentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAgentAsync(string agentId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateMessage(string threadId, string messageId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateMessage(string threadId, string messageId, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateMessageAsync(string threadId, string messageId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -489,7 +489,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.ConnectionPropertiesApiKeyAuth ConnectionPropertiesApiKeyAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null, Azure.AI.Projects.CredentialsApiKeyAuth credentials = null) { throw null; } public static Azure.AI.Projects.ConnectionResponse ConnectionResponse(string id = null, string name = null, Azure.AI.Projects.ConnectionProperties properties = null) { throw null; } public static Azure.AI.Projects.CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null) { throw null; } - 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.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, Azure.AI.Projects.EvaluationTarget target = 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.FileSearchToolCallContent FileSearchToolCallContent(Azure.AI.Projects.FileSearchToolCallContentType type = default(Azure.AI.Projects.FileSearchToolCallContentType), string text = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } @@ -508,8 +508,12 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.MessageDeltaTextFileCitationAnnotationObject MessageDeltaTextFileCitationAnnotationObject(string fileId = null, string quote = null) { throw null; } public static Azure.AI.Projects.MessageDeltaTextFilePathAnnotation MessageDeltaTextFilePathAnnotation(int index = 0, Azure.AI.Projects.MessageDeltaTextFilePathAnnotationObject filePath = null, int? startIndex = default(int?), int? endIndex = default(int?), string text = null) { throw null; } public static Azure.AI.Projects.MessageDeltaTextFilePathAnnotationObject MessageDeltaTextFilePathAnnotationObject(string fileId = null) { throw null; } + public static Azure.AI.Projects.MessageDeltaTextUrlCitationAnnotation MessageDeltaTextUrlCitationAnnotation(int index = 0, Azure.AI.Projects.MessageDeltaTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; } + public static Azure.AI.Projects.MessageDeltaTextUrlCitationDetails MessageDeltaTextUrlCitationDetails(string url = null, string title = null) { throw null; } public static Azure.AI.Projects.MessageIncompleteDetails MessageIncompleteDetails(Azure.AI.Projects.MessageIncompleteDetailsReason reason = default(Azure.AI.Projects.MessageIncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null) { throw null; } + public static Azure.AI.Projects.MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, Azure.AI.Projects.MessageTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; } + public static Azure.AI.Projects.MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) { throw null; } public static Azure.AI.Projects.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; } public static Azure.AI.Projects.ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType type = default(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType), Azure.AI.Projects.ResponseFormatJsonSchema jsonSchema = null) { throw null; } public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; } @@ -558,6 +562,19 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.VectorStoreStaticChunkingStrategyResponse VectorStoreStaticChunkingStrategyResponse(Azure.AI.Projects.VectorStoreStaticChunkingStrategyOptions @static = null) { throw null; } public static Azure.AI.Projects.WorkspaceProperties WorkspaceProperties(string applicationInsights = null) { throw null; } } + public partial class AOAIModelConfig : Azure.AI.Projects.TargetModelConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AOAIModelConfig(string azureEndpoint, string apiKey, string azureDeployment) { } + public string ApiKey { get { throw null; } set { } } + public string AzureDeployment { get { throw null; } set { } } + public string AzureEndpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AOAIModelConfig 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.AOAIModelConfig 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 ApplicationInsightsConfiguration : Azure.AI.Projects.InputData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ApplicationInsightsConfiguration(string resourceId, string query) { } @@ -841,6 +858,7 @@ public Evaluation(Azure.AI.Projects.InputData data, System.Collections.Generic.I public string Status { get { throw null; } } public Azure.AI.Projects.SystemData SystemData { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.AI.Projects.EvaluationTarget Target { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.Evaluation 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) { } @@ -905,6 +923,19 @@ public EvaluationsClient(System.Uri endpoint, string subscriptionId, string reso public virtual Azure.Response Update(string id, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task UpdateAsync(string id, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class EvaluationTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationTarget(string systemMessage, Azure.AI.Projects.TargetModelConfig modelConfig) { } + public Azure.AI.Projects.TargetModelConfig ModelConfig { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ModelParams { get { throw null; } } + public string SystemMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.EvaluationTarget 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.EvaluationTarget 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 EvaluatorConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EvaluatorConfiguration(string id) { } @@ -1177,6 +1208,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.AI.Projects.ListSortOrder left, Azure.AI.Projects.ListSortOrder right) { throw null; } public override string ToString() { throw null; } } + public partial class MAASModelConfig : Azure.AI.Projects.TargetModelConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MAASModelConfig(string azureEndpoint, string apiKey) { } + public string ApiKey { get { throw null; } set { } } + public string AzureEndpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MAASModelConfig 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.MAASModelConfig 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 MessageAttachment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageAttachment(Azure.AI.Projects.VectorStoreDataSource ds, System.Collections.Generic.List tools) { } @@ -1373,6 +1416,31 @@ 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 partial class MessageDeltaTextUrlCitationAnnotation : Azure.AI.Projects.MessageDeltaTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageDeltaTextUrlCitationAnnotation() : base (default(int)) { } + public int? EndIndex { get { throw null; } } + public int? StartIndex { get { throw null; } } + public Azure.AI.Projects.MessageDeltaTextUrlCitationDetails UrlCitation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageDeltaTextUrlCitationAnnotation 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.MessageDeltaTextUrlCitationAnnotation 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 MessageDeltaTextUrlCitationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageDeltaTextUrlCitationDetails() { } + public string Title { get { throw null; } } + public string Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageDeltaTextUrlCitationDetails 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.MessageDeltaTextUrlCitationDetails 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 MessageImageFileContent : Azure.AI.Projects.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageImageFileContent() { } @@ -1528,6 +1596,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 MessageTextUrlCitationAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageTextUrlCitationAnnotation() : base (default(string)) { } + public int? EndIndex { get { throw null; } } + public int? StartIndex { get { throw null; } } + public Azure.AI.Projects.MessageTextUrlCitationDetails UrlCitation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageTextUrlCitationAnnotation 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.MessageTextUrlCitationAnnotation 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 MessageTextUrlCitationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageTextUrlCitationDetails() { } + public string Title { get { throw null; } } + public string Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageTextUrlCitationDetails 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.MessageTextUrlCitationDetails 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 MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } @@ -1837,7 +1930,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RunStep : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RunStep() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.DateTimeOffset? CancelledAt { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.DateTimeOffset CreatedAt { get { throw null; } } @@ -2489,6 +2582,16 @@ 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 abstract partial class TargetModelConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected TargetModelConfig() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.TargetModelConfig 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.TargetModelConfig 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 TelemetryClient { protected TelemetryClient() { } @@ -2511,7 +2614,7 @@ internal TextAnnotationUpdate() { } public partial class ThreadMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ThreadMessage() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Attachments { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.Collections.Generic.IReadOnlyList ContentItems { get { throw null; } } @@ -2548,7 +2651,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ThreadRun : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ThreadRun() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.DateTimeOffset? CancelledAt { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.DateTimeOffset CreatedAt { get { throw null; } } 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 715919aac269..9615f03830c8 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 @@ -199,18 +199,18 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task CreateMessageAsync(string threadId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateRun(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateRun(string threadId, Azure.Core.RequestContent content, System.Collections.Generic.IEnumerable include = null, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateRun(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateRunAsync(Azure.AI.Projects.AgentThread thread, Azure.AI.Projects.Agent agent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateRunAsync(string threadId, Azure.Core.RequestContent content, System.Collections.Generic.IEnumerable include = null, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateRunAsync(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Collections.Generic.IEnumerable include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.CollectionResult CreateRunStreaming(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.AsyncCollectionResult CreateRunStreamingAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, System.Collections.Generic.IEnumerable additionalMessages = null, System.Collections.Generic.IEnumerable overrideTools = 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThread(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response CreateThread(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateThreadAndRun(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response CreateThreadAndRun(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateThreadAndRun(string agentId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAndRunAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string assistantId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateThreadAndRunAsync(string agentId, Azure.AI.Projects.AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, System.Collections.Generic.IEnumerable overrideTools = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? stream = default(bool?), 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, bool? parallelToolCalls = default(bool?), System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task CreateThreadAsync(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task> CreateThreadAsync(System.Collections.Generic.IEnumerable messages = null, Azure.AI.Projects.ToolResources toolResources = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CreateVectorStore(Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -239,10 +239,10 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual Azure.Response DeleteVectorStoreFile(string vectorStoreId, string fileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, Azure.RequestContext context) { throw null; } public virtual System.Threading.Tasks.Task> DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetAgent(string assistantId, Azure.RequestContext context) { throw null; } - public virtual Azure.Response GetAgent(string assistantId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task GetAgentAsync(string assistantId, Azure.RequestContext context) { throw null; } - public virtual System.Threading.Tasks.Task> GetAgentAsync(string assistantId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAgent(string agentId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetAgent(string agentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetAgentAsync(string agentId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetAgentAsync(string agentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response> GetAgents(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task>> GetAgentsAsync(int? limit = default(int?), Azure.AI.Projects.ListSortOrder? order = default(Azure.AI.Projects.ListSortOrder?), string after = null, string before = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetFile(string fileId, Azure.RequestContext context) { throw null; } @@ -313,10 +313,10 @@ public AgentsClient(System.Uri endpoint, string subscriptionId, string resourceG public virtual System.Threading.Tasks.Task SubmitToolOutputsToRunAsync(string threadId, string runId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.ClientModel.CollectionResult SubmitToolOutputsToStream(Azure.AI.Projects.ThreadRun run, System.Collections.Generic.IEnumerable toolOutputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.ClientModel.AsyncCollectionResult SubmitToolOutputsToStreamAsync(Azure.AI.Projects.ThreadRun run, System.Collections.Generic.IEnumerable toolOutputs, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateAgent(string assistantId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual Azure.Response UpdateAgent(string assistantId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task UpdateAgentAsync(string assistantId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAgentAsync(string assistantId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateAgent(string agentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateAgent(string agentId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAgentAsync(string agentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAgentAsync(string agentId, string model = null, string name = null, string description = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, Azure.AI.Projects.ToolResources toolResources = null, float? temperature = default(float?), float? topP = default(float?), System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response UpdateMessage(string threadId, string messageId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual Azure.Response UpdateMessage(string threadId, string messageId, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task UpdateMessageAsync(string threadId, string messageId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } @@ -489,7 +489,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.ConnectionPropertiesApiKeyAuth ConnectionPropertiesApiKeyAuth(Azure.AI.Projects.ConnectionType category = Azure.AI.Projects.ConnectionType.AzureOpenAI, string target = null, Azure.AI.Projects.CredentialsApiKeyAuth credentials = null) { throw null; } public static Azure.AI.Projects.ConnectionResponse ConnectionResponse(string id = null, string name = null, Azure.AI.Projects.ConnectionProperties properties = null) { throw null; } public static Azure.AI.Projects.CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null) { throw null; } - 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.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, Azure.AI.Projects.EvaluationTarget target = 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.FileSearchToolCallContent FileSearchToolCallContent(Azure.AI.Projects.FileSearchToolCallContentType type = default(Azure.AI.Projects.FileSearchToolCallContentType), string text = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } @@ -508,8 +508,12 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.MessageDeltaTextFileCitationAnnotationObject MessageDeltaTextFileCitationAnnotationObject(string fileId = null, string quote = null) { throw null; } public static Azure.AI.Projects.MessageDeltaTextFilePathAnnotation MessageDeltaTextFilePathAnnotation(int index = 0, Azure.AI.Projects.MessageDeltaTextFilePathAnnotationObject filePath = null, int? startIndex = default(int?), int? endIndex = default(int?), string text = null) { throw null; } public static Azure.AI.Projects.MessageDeltaTextFilePathAnnotationObject MessageDeltaTextFilePathAnnotationObject(string fileId = null) { throw null; } + public static Azure.AI.Projects.MessageDeltaTextUrlCitationAnnotation MessageDeltaTextUrlCitationAnnotation(int index = 0, Azure.AI.Projects.MessageDeltaTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; } + public static Azure.AI.Projects.MessageDeltaTextUrlCitationDetails MessageDeltaTextUrlCitationDetails(string url = null, string title = null) { throw null; } public static Azure.AI.Projects.MessageIncompleteDetails MessageIncompleteDetails(Azure.AI.Projects.MessageIncompleteDetailsReason reason = default(Azure.AI.Projects.MessageIncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null) { throw null; } + public static Azure.AI.Projects.MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, Azure.AI.Projects.MessageTextUrlCitationDetails urlCitation = null, int? startIndex = default(int?), int? endIndex = default(int?)) { throw null; } + public static Azure.AI.Projects.MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) { throw null; } public static Azure.AI.Projects.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; } public static Azure.AI.Projects.ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType type = default(Azure.AI.Projects.ResponseFormatJsonSchemaTypeType), Azure.AI.Projects.ResponseFormatJsonSchema jsonSchema = null) { throw null; } public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; } @@ -558,6 +562,19 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.VectorStoreStaticChunkingStrategyResponse VectorStoreStaticChunkingStrategyResponse(Azure.AI.Projects.VectorStoreStaticChunkingStrategyOptions @static = null) { throw null; } public static Azure.AI.Projects.WorkspaceProperties WorkspaceProperties(string applicationInsights = null) { throw null; } } + public partial class AOAIModelConfig : Azure.AI.Projects.TargetModelConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AOAIModelConfig(string azureEndpoint, string apiKey, string azureDeployment) { } + public string ApiKey { get { throw null; } set { } } + public string AzureDeployment { get { throw null; } set { } } + public string AzureEndpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.AOAIModelConfig 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.AOAIModelConfig 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 ApplicationInsightsConfiguration : Azure.AI.Projects.InputData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ApplicationInsightsConfiguration(string resourceId, string query) { } @@ -841,6 +858,7 @@ public Evaluation(Azure.AI.Projects.InputData data, System.Collections.Generic.I public string Status { get { throw null; } } public Azure.AI.Projects.SystemData SystemData { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public Azure.AI.Projects.EvaluationTarget Target { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.Evaluation 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) { } @@ -905,6 +923,19 @@ public EvaluationsClient(System.Uri endpoint, string subscriptionId, string reso public virtual Azure.Response Update(string id, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } public virtual System.Threading.Tasks.Task UpdateAsync(string id, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } } + public partial class EvaluationTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EvaluationTarget(string systemMessage, Azure.AI.Projects.TargetModelConfig modelConfig) { } + public Azure.AI.Projects.TargetModelConfig ModelConfig { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ModelParams { get { throw null; } } + public string SystemMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.EvaluationTarget 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.EvaluationTarget 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 EvaluatorConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EvaluatorConfiguration(string id) { } @@ -1177,6 +1208,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.AI.Projects.ListSortOrder left, Azure.AI.Projects.ListSortOrder right) { throw null; } public override string ToString() { throw null; } } + public partial class MAASModelConfig : Azure.AI.Projects.TargetModelConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MAASModelConfig(string azureEndpoint, string apiKey) { } + public string ApiKey { get { throw null; } set { } } + public string AzureEndpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MAASModelConfig 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.MAASModelConfig 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 MessageAttachment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MessageAttachment(Azure.AI.Projects.VectorStoreDataSource ds, System.Collections.Generic.List tools) { } @@ -1373,6 +1416,31 @@ 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 partial class MessageDeltaTextUrlCitationAnnotation : Azure.AI.Projects.MessageDeltaTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageDeltaTextUrlCitationAnnotation() : base (default(int)) { } + public int? EndIndex { get { throw null; } } + public int? StartIndex { get { throw null; } } + public Azure.AI.Projects.MessageDeltaTextUrlCitationDetails UrlCitation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageDeltaTextUrlCitationAnnotation 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.MessageDeltaTextUrlCitationAnnotation 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 MessageDeltaTextUrlCitationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageDeltaTextUrlCitationDetails() { } + public string Title { get { throw null; } } + public string Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageDeltaTextUrlCitationDetails 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.MessageDeltaTextUrlCitationDetails 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 MessageImageFileContent : Azure.AI.Projects.MessageContent, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageImageFileContent() { } @@ -1528,6 +1596,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 MessageTextUrlCitationAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageTextUrlCitationAnnotation() : base (default(string)) { } + public int? EndIndex { get { throw null; } } + public int? StartIndex { get { throw null; } } + public Azure.AI.Projects.MessageTextUrlCitationDetails UrlCitation { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageTextUrlCitationAnnotation 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.MessageTextUrlCitationAnnotation 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 MessageTextUrlCitationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MessageTextUrlCitationDetails() { } + public string Title { get { throw null; } } + public string Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.MessageTextUrlCitationDetails 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.MessageTextUrlCitationDetails 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 MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } @@ -1837,7 +1930,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class RunStep : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal RunStep() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.DateTimeOffset? CancelledAt { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.DateTimeOffset CreatedAt { get { throw null; } } @@ -2489,6 +2582,16 @@ 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 abstract partial class TargetModelConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected TargetModelConfig() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.TargetModelConfig 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.TargetModelConfig 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 TelemetryClient { protected TelemetryClient() { } @@ -2511,7 +2614,7 @@ internal TextAnnotationUpdate() { } public partial class ThreadMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ThreadMessage() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.Collections.Generic.IReadOnlyList Attachments { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.Collections.Generic.IReadOnlyList ContentItems { get { throw null; } } @@ -2548,7 +2651,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ThreadRun : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ThreadRun() { } - public string AssistantId { get { throw null; } } + public string AgentId { get { throw null; } } public System.DateTimeOffset? CancelledAt { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public System.DateTimeOffset CreatedAt { get { throw null; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index 5e5c76b025ac..69f1864494ee 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -21,6 +21,7 @@ public static partial class AIProjectsModelFactory /// 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 . /// + /// Evaluation target specifying the model config and parameters. /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. @@ -29,7 +30,7 @@ public static partial class AIProjectsModelFactory /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// Evaluators to be used for the evaluation. /// A new instance for mocking. - public static Evaluation Evaluation(string id = null, InputData data = null, string displayName = null, string description = null, SystemData systemData = null, string status = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null) + public static Evaluation Evaluation(string id = null, InputData data = null, EvaluationTarget target = null, string displayName = null, string description = null, SystemData systemData = null, string status = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null) { tags ??= new Dictionary(); properties ??= new Dictionary(); @@ -38,6 +39,7 @@ public static Evaluation Evaluation(string id = null, InputData data = null, str return new Evaluation( id, data, + target, displayName, description, systemData, @@ -232,6 +234,32 @@ public static MessageTextAnnotation MessageTextAnnotation(string type = null, st return new UnknownMessageTextAnnotation(type, text, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The textual content associated with this text annotation item. + /// The details of the URL citation. + /// The first text index associated with this text annotation. + /// The last text index associated with this text annotation. + /// A new instance for mocking. + public static MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, MessageTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null) + { + return new MessageTextUrlCitationAnnotation( + "url_citation", + text, + serializedAdditionalRawData: null, + urlCitation, + startIndex, + endIndex); + } + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// The title of the URL. + /// A new instance for mocking. + public static MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) + { + return new MessageTextUrlCitationDetails(url, title, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The object type. /// The ID of the tool call. This ID must be referenced when submitting tool outputs. @@ -687,7 +715,7 @@ public static MessageDeltaTextContent MessageDeltaTextContent(int index = defaul /// /// Annotations for the text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// /// A new instance for mocking. public static MessageDeltaTextContentObject MessageDeltaTextContentObject(string value = null, IEnumerable annotations = null) @@ -706,6 +734,32 @@ public static MessageDeltaTextAnnotation MessageDeltaTextAnnotation(int index = return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The index of the annotation within a text content part. + /// The details of the URL citation. + /// The first text index associated with this text annotation. + /// The last text index associated with this text annotation. + /// A new instance for mocking. + public static MessageDeltaTextUrlCitationAnnotation MessageDeltaTextUrlCitationAnnotation(int index = default, MessageDeltaTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null) + { + return new MessageDeltaTextUrlCitationAnnotation( + index, + "url_citation", + serializedAdditionalRawData: null, + urlCitation, + startIndex, + endIndex); + } + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// The title of the URL. + /// A new instance for mocking. + public static MessageDeltaTextUrlCitationDetails MessageDeltaTextUrlCitationDetails(string url = null, string title = null) + { + return new MessageDeltaTextUrlCitationDetails(url, title, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The index of the annotation within a text content part. /// The file citation information. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs new file mode 100644 index 000000000000..0077e6236560 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs @@ -0,0 +1,150 @@ +// 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 AOAIModelConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azureEndpoint"u8); + writer.WriteStringValue(AzureEndpoint); + writer.WritePropertyName("apiKey"u8); + writer.WriteStringValue(ApiKey); + writer.WritePropertyName("azureDeployment"u8); + writer.WriteStringValue(AzureDeployment); + } + + AOAIModelConfig 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(AOAIModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAOAIModelConfig(document.RootElement, options); + } + + internal static AOAIModelConfig DeserializeAOAIModelConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureEndpoint = default; + string apiKey = default; + string azureDeployment = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureEndpoint"u8)) + { + azureEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiKey"u8)) + { + apiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureDeployment"u8)) + { + azureDeployment = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AOAIModelConfig(type, serializedAdditionalRawData, azureEndpoint, apiKey, azureDeployment); + } + + 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(AOAIModelConfig)} does not support writing '{options.Format}' format."); + } + } + + AOAIModelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAOAIModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AOAIModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAOAIModelConfig(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs new file mode 100644 index 000000000000..6479604e8c91 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Azure OpenAI model configuration. + public partial class AOAIModelConfig : TargetModelConfig + { + /// Initializes a new instance of . + /// Endpoint URL for AOAI model. + /// API Key for AOAI model. + /// Deployment name for AOAI model. + /// , or is null. + public AOAIModelConfig(string azureEndpoint, string apiKey, string azureDeployment) + { + Argument.AssertNotNull(azureEndpoint, nameof(azureEndpoint)); + Argument.AssertNotNull(apiKey, nameof(apiKey)); + Argument.AssertNotNull(azureDeployment, nameof(azureDeployment)); + + Type = "AOAI"; + AzureEndpoint = azureEndpoint; + ApiKey = apiKey; + AzureDeployment = azureDeployment; + } + + /// Initializes a new instance of . + /// Type of the model configuration. + /// Keeps track of any properties unknown to the library. + /// Endpoint URL for AOAI model. + /// API Key for AOAI model. + /// Deployment name for AOAI model. + internal AOAIModelConfig(string type, IDictionary serializedAdditionalRawData, string azureEndpoint, string apiKey, string azureDeployment) : base(type, serializedAdditionalRawData) + { + AzureEndpoint = azureEndpoint; + ApiKey = apiKey; + AzureDeployment = azureDeployment; + } + + /// Initializes a new instance of for deserialization. + internal AOAIModelConfig() + { + } + + /// Endpoint URL for AOAI model. + public string AzureEndpoint { get; set; } + /// API Key for AOAI model. + public string ApiKey { get; set; } + /// Deployment name for AOAI model. + public string AzureDeployment { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs index 56679b3d00d5..c0d5bebca3b5 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs @@ -330,30 +330,30 @@ internal virtual Response InternalGetAgents(int? limit, string order, string aft } /// Retrieves an existing agent. - /// Identifier of the agent. + /// Identifier of the agent. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public virtual async Task> GetAgentAsync(string assistantId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAgentAsync(string agentId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await GetAgentAsync(assistantId, context).ConfigureAwait(false); + Response response = await GetAgentAsync(agentId, context).ConfigureAwait(false); return Response.FromValue(Agent.FromResponse(response), response); } /// Retrieves an existing agent. - /// Identifier of the agent. + /// Identifier of the agent. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public virtual Response GetAgent(string assistantId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response GetAgent(string agentId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = GetAgent(assistantId, context); + Response response = GetAgent(agentId, context); return Response.FromValue(Agent.FromResponse(response), response); } @@ -372,21 +372,21 @@ public virtual Response GetAgent(string assistantId, CancellationToken ca /// /// /// - /// Identifier of the agent. + /// Identifier of the agent. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual async Task GetAgentAsync(string assistantId, RequestContext context) + public virtual async Task GetAgentAsync(string agentId, RequestContext context) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.GetAgent"); scope.Start(); try { - using HttpMessage message = CreateGetAgentRequest(assistantId, context); + using HttpMessage message = CreateGetAgentRequest(agentId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -411,21 +411,21 @@ public virtual async Task GetAgentAsync(string assistantId, RequestCon /// /// /// - /// Identifier of the agent. + /// Identifier of the agent. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual Response GetAgent(string assistantId, RequestContext context) + public virtual Response GetAgent(string agentId, RequestContext context) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.GetAgent"); scope.Start(); try { - using HttpMessage message = CreateGetAgentRequest(assistantId, context); + using HttpMessage message = CreateGetAgentRequest(agentId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -436,7 +436,7 @@ public virtual Response GetAgent(string assistantId, RequestContext context) } /// Modifies an existing agent. - /// The ID of the agent to modify. + /// The ID of the agent to modify. /// The ID of the model to use. /// The modified name for the agent to use. /// The modified description for the agent to use. @@ -459,11 +459,11 @@ public virtual Response GetAgent(string assistantId, RequestContext context) /// The response format of the tool calls used by this agent. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public virtual async Task> UpdateAgentAsync(string assistantId, string model = null, string name = null, string description = null, string instructions = null, IEnumerable tools = null, ToolResources toolResources = null, float? temperature = null, float? topP = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> UpdateAgentAsync(string agentId, string model = null, string name = null, string description = null, string instructions = null, IEnumerable tools = null, ToolResources toolResources = null, float? temperature = null, float? topP = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); UpdateAgentRequest updateAgentRequest = new UpdateAgentRequest( model, @@ -478,12 +478,12 @@ public virtual async Task> UpdateAgentAsync(string assistantId, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await UpdateAgentAsync(assistantId, updateAgentRequest.ToRequestContent(), context).ConfigureAwait(false); + Response response = await UpdateAgentAsync(agentId, updateAgentRequest.ToRequestContent(), context).ConfigureAwait(false); return Response.FromValue(Agent.FromResponse(response), response); } /// Modifies an existing agent. - /// The ID of the agent to modify. + /// The ID of the agent to modify. /// The ID of the model to use. /// The modified name for the agent to use. /// The modified description for the agent to use. @@ -506,11 +506,11 @@ public virtual async Task> UpdateAgentAsync(string assistantId, /// The response format of the tool calls used by this agent. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public virtual Response UpdateAgent(string assistantId, string model = null, string name = null, string description = null, string instructions = null, IEnumerable tools = null, ToolResources toolResources = null, float? temperature = null, float? topP = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response UpdateAgent(string agentId, string model = null, string name = null, string description = null, string instructions = null, IEnumerable tools = null, ToolResources toolResources = null, float? temperature = null, float? topP = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); UpdateAgentRequest updateAgentRequest = new UpdateAgentRequest( model, @@ -525,7 +525,7 @@ public virtual Response UpdateAgent(string assistantId, string model = nu metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); - Response response = UpdateAgent(assistantId, updateAgentRequest.ToRequestContent(), context); + Response response = UpdateAgent(agentId, updateAgentRequest.ToRequestContent(), context); return Response.FromValue(Agent.FromResponse(response), response); } @@ -544,23 +544,23 @@ public virtual Response UpdateAgent(string assistantId, string model = nu /// /// /// - /// The ID of the agent to modify. + /// The ID of the agent to modify. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual async Task UpdateAgentAsync(string assistantId, RequestContent content, RequestContext context = null) + public virtual async Task UpdateAgentAsync(string agentId, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); Argument.AssertNotNull(content, nameof(content)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.UpdateAgent"); scope.Start(); try { - using HttpMessage message = CreateUpdateAgentRequest(assistantId, content, context); + using HttpMessage message = CreateUpdateAgentRequest(agentId, content, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -585,23 +585,23 @@ public virtual async Task UpdateAgentAsync(string assistantId, Request /// /// /// - /// The ID of the agent to modify. + /// The ID of the agent to modify. /// The content to send as the body of the request. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual Response UpdateAgent(string assistantId, RequestContent content, RequestContext context = null) + public virtual Response UpdateAgent(string agentId, RequestContent content, RequestContext context = null) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); Argument.AssertNotNull(content, nameof(content)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.UpdateAgent"); scope.Start(); try { - using HttpMessage message = CreateUpdateAgentRequest(assistantId, content, context); + using HttpMessage message = CreateUpdateAgentRequest(agentId, content, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -612,30 +612,30 @@ public virtual Response UpdateAgent(string assistantId, RequestContent content, } /// Deletes an agent. - /// Identifier of the agent. + /// Identifier of the agent. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - internal virtual async Task> InternalDeleteAgentAsync(string assistantId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + internal virtual async Task> InternalDeleteAgentAsync(string agentId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await InternalDeleteAgentAsync(assistantId, context).ConfigureAwait(false); + Response response = await InternalDeleteAgentAsync(agentId, context).ConfigureAwait(false); return Response.FromValue(InternalAgentDeletionStatus.FromResponse(response), response); } /// Deletes an agent. - /// Identifier of the agent. + /// Identifier of the agent. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - internal virtual Response InternalDeleteAgent(string assistantId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + internal virtual Response InternalDeleteAgent(string agentId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = InternalDeleteAgent(assistantId, context); + Response response = InternalDeleteAgent(agentId, context); return Response.FromValue(InternalAgentDeletionStatus.FromResponse(response), response); } @@ -654,21 +654,21 @@ internal virtual Response InternalDeleteAgent(strin /// /// /// - /// Identifier of the agent. + /// Identifier of the agent. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - internal virtual async Task InternalDeleteAgentAsync(string assistantId, RequestContext context) + internal virtual async Task InternalDeleteAgentAsync(string agentId, RequestContext context) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.InternalDeleteAgent"); scope.Start(); try { - using HttpMessage message = CreateInternalDeleteAgentRequest(assistantId, context); + using HttpMessage message = CreateInternalDeleteAgentRequest(agentId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -693,21 +693,21 @@ internal virtual async Task InternalDeleteAgentAsync(string assistantI /// /// /// - /// Identifier of the agent. + /// Identifier of the agent. /// The request context, which can override default behaviors of the client pipeline on a per-call basis. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - internal virtual Response InternalDeleteAgent(string assistantId, RequestContext context) + internal virtual Response InternalDeleteAgent(string agentId, RequestContext context) { - Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId)); + Argument.AssertNotNullOrEmpty(agentId, nameof(agentId)); using var scope = ClientDiagnostics.CreateScope("AgentsClient.InternalDeleteAgent"); scope.Start(); try { - using HttpMessage message = CreateInternalDeleteAgentRequest(assistantId, context); + using HttpMessage message = CreateInternalDeleteAgentRequest(agentId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -1669,7 +1669,7 @@ public virtual Response UpdateMessage(string threadId, string messageId, Request /// Creates a new run for an agent thread. /// Identifier of the thread. - /// The ID of the agent that should run the thread. + /// The ID of the agent that should run the thread. /// The overridden model name that the agent should use to run the thread. /// The overridden system instructions that the agent should use to run the thread. /// @@ -1713,15 +1713,15 @@ public virtual Response UpdateMessage(string threadId, string messageId, Request /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. /// /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateRunAsync(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); CreateRunRequest createRunRequest = new CreateRunRequest( - assistantId, + agentId, overrideModelName, overrideInstructions, additionalInstructions, @@ -1745,7 +1745,7 @@ public virtual async Task> CreateRunAsync(string threadId, s /// Creates a new run for an agent thread. /// Identifier of the thread. - /// The ID of the agent that should run the thread. + /// The ID of the agent that should run the thread. /// The overridden model name that the agent should use to run the thread. /// The overridden system instructions that the agent should use to run the thread. /// @@ -1789,15 +1789,15 @@ public virtual async Task> CreateRunAsync(string threadId, s /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. /// /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) + public virtual Response CreateRun(string threadId, string agentId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); CreateRunRequest createRunRequest = new CreateRunRequest( - assistantId, + agentId, overrideModelName, overrideInstructions, additionalInstructions, @@ -2382,7 +2382,7 @@ public virtual Response CancelRun(string threadId, string runId, RequestContext } /// Creates a new agent thread and immediately starts a run using that new thread. - /// The ID of the agent for which the thread should be created. + /// The ID of the agent for which the thread should be created. /// The details used to create the new thread. If no thread is provided, an empty one will be created. /// The overridden model that the agent should use to run the thread. /// The overridden system instructions the agent should use to run the thread. @@ -2419,13 +2419,13 @@ public virtual Response CancelRun(string threadId, string runId, RequestContext /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. - /// is null. - public virtual async Task> CreateThreadAndRunAsync(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> CreateThreadAndRunAsync(string agentId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); CreateThreadAndRunRequest createThreadAndRunRequest = new CreateThreadAndRunRequest( - assistantId, + agentId, thread, overrideModelName, overrideInstructions, @@ -2448,7 +2448,7 @@ public virtual async Task> CreateThreadAndRunAsync(string as } /// Creates a new agent thread and immediately starts a run using that new thread. - /// The ID of the agent for which the thread should be created. + /// The ID of the agent for which the thread should be created. /// The details used to create the new thread. If no thread is provided, an empty one will be created. /// The overridden model that the agent should use to run the thread. /// The overridden system instructions the agent should use to run the thread. @@ -2485,13 +2485,13 @@ public virtual async Task> CreateThreadAndRunAsync(string as /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. - /// is null. - public virtual Response CreateThreadAndRun(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + /// is null. + public virtual Response CreateThreadAndRun(string agentId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); CreateThreadAndRunRequest createThreadAndRunRequest = new CreateThreadAndRunRequest( - assistantId, + agentId, thread, overrideModelName, overrideInstructions, @@ -4931,7 +4931,7 @@ internal HttpMessage CreateInternalGetAgentsRequest(int? limit, string order, st return message; } - internal HttpMessage CreateGetAgentRequest(string assistantId, RequestContext context) + internal HttpMessage CreateGetAgentRequest(string agentId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4945,14 +4945,14 @@ internal HttpMessage CreateGetAgentRequest(string assistantId, RequestContext co uri.AppendRaw("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendRaw(_projectName, true); uri.AppendPath("/assistants/", false); - uri.AppendPath(assistantId, true); + uri.AppendPath(agentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } - internal HttpMessage CreateUpdateAgentRequest(string assistantId, RequestContent content, RequestContext context) + internal HttpMessage CreateUpdateAgentRequest(string agentId, RequestContent content, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4966,7 +4966,7 @@ internal HttpMessage CreateUpdateAgentRequest(string assistantId, RequestContent uri.AppendRaw("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendRaw(_projectName, true); uri.AppendPath("/assistants/", false); - uri.AppendPath(assistantId, true); + uri.AppendPath(agentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -4975,7 +4975,7 @@ internal HttpMessage CreateUpdateAgentRequest(string assistantId, RequestContent return message; } - internal HttpMessage CreateInternalDeleteAgentRequest(string assistantId, RequestContext context) + internal HttpMessage CreateInternalDeleteAgentRequest(string agentId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; @@ -4989,7 +4989,7 @@ internal HttpMessage CreateInternalDeleteAgentRequest(string assistantId, Reques uri.AppendRaw("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendRaw(_projectName, true); uri.AppendPath("/assistants/", false); - uri.AppendPath(assistantId, true); + uri.AppendPath(agentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs index 97ee7fa21111..5a0df11524e3 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("assistant_id"u8); - writer.WriteStringValue(AssistantId); + writer.WriteStringValue(AgentId); if (Optional.IsDefined(OverrideModelName)) { if (OverrideModelName != null) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs index 9b9969dd27eb..06d00ae685ea 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs @@ -46,20 +46,20 @@ internal partial class CreateRunRequest private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The ID of the agent that should run the thread. - /// is null. - internal CreateRunRequest(string assistantId) + /// The ID of the agent that should run the thread. + /// is null. + internal CreateRunRequest(string agentId) { - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); - AssistantId = assistantId; + AgentId = agentId; AdditionalMessages = new ChangeTrackingList(); OverrideTools = new ChangeTrackingList(); Metadata = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// The ID of the agent that should run the thread. + /// The ID of the agent that should run the thread. /// The overridden model name that the agent should use to run the thread. /// The overridden system instructions that the agent should use to run the thread. /// @@ -103,9 +103,9 @@ internal CreateRunRequest(string assistantId) /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateRunRequest(string agentId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { - AssistantId = assistantId; + AgentId = agentId; OverrideModelName = overrideModelName; OverrideInstructions = overrideInstructions; AdditionalInstructions = additionalInstructions; @@ -130,7 +130,7 @@ internal CreateRunRequest() } /// The ID of the agent that should run the thread. - public string AssistantId { get; } + public string AgentId { get; } /// The overridden model name that the agent should use to run the thread. public string OverrideModelName { get; } /// The overridden system instructions that the agent should use to run the thread. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs index e2992a2c42af..9ce71c2cc01d 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("assistant_id"u8); - writer.WriteStringValue(AssistantId); + writer.WriteStringValue(AgentId); if (Optional.IsDefined(Thread)) { writer.WritePropertyName("thread"u8); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs index 58bc40b50d21..b2f3cf9466b5 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs @@ -46,19 +46,19 @@ internal partial class CreateThreadAndRunRequest private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The ID of the agent for which the thread should be created. - /// is null. - internal CreateThreadAndRunRequest(string assistantId) + /// The ID of the agent for which the thread should be created. + /// is null. + internal CreateThreadAndRunRequest(string agentId) { - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); - AssistantId = assistantId; + AgentId = agentId; OverrideTools = new ChangeTrackingList(); Metadata = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// The ID of the agent for which the thread should be created. + /// The ID of the agent for which the thread should be created. /// The details used to create the new thread. If no thread is provided, an empty one will be created. /// The overridden model that the agent should use to run the thread. /// The overridden system instructions the agent should use to run the thread. @@ -99,9 +99,9 @@ internal CreateThreadAndRunRequest(string assistantId) /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateThreadAndRunRequest(string agentId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { - AssistantId = assistantId; + AgentId = agentId; Thread = thread; OverrideModelName = overrideModelName; OverrideInstructions = overrideInstructions; @@ -126,7 +126,7 @@ internal CreateThreadAndRunRequest() } /// The ID of the agent for which the thread should be created. - public string AssistantId { get; } + public string AgentId { get; } /// The details used to create the new thread. If no thread is provided, an empty one will be created. public AgentThreadCreationOptions Thread { get; } /// The overridden model that the agent should use to run the thread. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.Serialization.cs index 3c1fcb985d24..fd8ae44bdf81 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.Serialization.cs @@ -41,6 +41,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("data"u8); writer.WriteObjectValue(Data, options); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteObjectValue(Target, options); + } if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); @@ -130,6 +135,7 @@ internal static Evaluation DeserializeEvaluation(JsonElement element, ModelReade } string id = default; InputData data = default; + EvaluationTarget target = default; string displayName = default; string description = default; SystemData systemData = default; @@ -151,6 +157,15 @@ internal static Evaluation DeserializeEvaluation(JsonElement element, ModelReade data = InputData.DeserializeInputData(property.Value, options); continue; } + if (property.NameEquals("target"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = EvaluationTarget.DeserializeEvaluationTarget(property.Value, options); + continue; + } if (property.NameEquals("displayName"u8)) { displayName = property.Value.GetString(); @@ -222,6 +237,7 @@ internal static Evaluation DeserializeEvaluation(JsonElement element, ModelReade return new Evaluation( id, data, + target, displayName, description, systemData, diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs index a5bb875ca420..f40d8ceaad92 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs @@ -71,6 +71,7 @@ public Evaluation(InputData data, IDictionary ev /// 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 . /// + /// Evaluation target specifying the model config and parameters. /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. @@ -79,10 +80,11 @@ public Evaluation(InputData data, IDictionary ev /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. /// Evaluators to be used for the evaluation. /// Keeps track of any properties unknown to the library. - internal Evaluation(string id, InputData data, string displayName, string description, SystemData systemData, string status, IDictionary tags, IDictionary properties, IDictionary evaluators, IDictionary serializedAdditionalRawData) + internal Evaluation(string id, InputData data, EvaluationTarget target, string displayName, string description, SystemData systemData, string status, IDictionary tags, IDictionary properties, IDictionary evaluators, IDictionary serializedAdditionalRawData) { Id = id; Data = data; + Target = target; DisplayName = displayName; Description = description; SystemData = systemData; @@ -106,6 +108,8 @@ internal Evaluation() /// The available derived classes include and . /// public InputData Data { get; set; } + /// Evaluation target specifying the model config and parameters. + public EvaluationTarget Target { get; set; } /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. public string DisplayName { get; set; } /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTarget.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTarget.Serialization.cs new file mode 100644 index 000000000000..8a494c7146f8 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTarget.Serialization.cs @@ -0,0 +1,195 @@ +// 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 EvaluationTarget : 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(EvaluationTarget)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("systemMessage"u8); + writer.WriteStringValue(SystemMessage); + writer.WritePropertyName("modelConfig"u8); + writer.WriteObjectValue(ModelConfig, options); + if (Optional.IsCollectionDefined(ModelParams)) + { + writer.WritePropertyName("modelParams"u8); + writer.WriteStartObject(); + foreach (var item in ModelParams) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EvaluationTarget 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(EvaluationTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationTarget(document.RootElement, options); + } + + internal static EvaluationTarget DeserializeEvaluationTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string systemMessage = default; + TargetModelConfig modelConfig = default; + IDictionary modelParams = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("systemMessage"u8)) + { + systemMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelConfig"u8)) + { + modelConfig = TargetModelConfig.DeserializeTargetModelConfig(property.Value, options); + continue; + } + if (property.NameEquals("modelParams"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + modelParams = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationTarget(systemMessage, modelConfig, modelParams ?? new ChangeTrackingDictionary(), 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(EvaluationTarget)} does not support writing '{options.Format}' format."); + } + } + + EvaluationTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEvaluationTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationTarget)} 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 EvaluationTarget FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEvaluationTarget(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/EvaluationTarget.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTarget.cs new file mode 100644 index 000000000000..0e34a83c1531 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationTarget.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Target for the evaluation process. + public partial class EvaluationTarget + { + /// + /// 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 . + /// System message related to the evaluation target. + /// + /// Model configuration for the evaluation. + /// 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 . + /// + /// or is null. + public EvaluationTarget(string systemMessage, TargetModelConfig modelConfig) + { + Argument.AssertNotNull(systemMessage, nameof(systemMessage)); + Argument.AssertNotNull(modelConfig, nameof(modelConfig)); + + SystemMessage = systemMessage; + ModelConfig = modelConfig; + ModelParams = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// System message related to the evaluation target. + /// + /// Model configuration for the evaluation. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A dictionary of parameters for the model. + /// Keeps track of any properties unknown to the library. + internal EvaluationTarget(string systemMessage, TargetModelConfig modelConfig, IDictionary modelParams, IDictionary serializedAdditionalRawData) + { + SystemMessage = systemMessage; + ModelConfig = modelConfig; + ModelParams = modelParams; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationTarget() + { + } + + /// System message related to the evaluation target. + public string SystemMessage { get; set; } + /// + /// Model configuration for the evaluation. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public TargetModelConfig ModelConfig { get; set; } + /// + /// A dictionary of parameters for the model. + /// + /// 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" }. + /// + /// + /// + /// + public IDictionary ModelParams { get; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs index 86770c52ed02..67b453a23b4b 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs @@ -51,7 +51,7 @@ internal partial class InternalMessageTextDetails /// /// A list of annotations associated with this text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// /// or is null. internal InternalMessageTextDetails(string text, IEnumerable annotations) @@ -68,7 +68,7 @@ internal InternalMessageTextDetails(string text, IEnumerable /// A list of annotations associated with this text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// /// Keeps track of any properties unknown to the library. internal InternalMessageTextDetails(string text, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) @@ -88,7 +88,7 @@ internal InternalMessageTextDetails() /// /// A list of annotations associated with this text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// public IReadOnlyList Annotations { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.Serialization.cs new file mode 100644 index 000000000000..efd0bef44562 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.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 MAASModelConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MAASModelConfig)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azureEndpoint"u8); + writer.WriteStringValue(AzureEndpoint); + writer.WritePropertyName("apiKey"u8); + writer.WriteStringValue(ApiKey); + } + + MAASModelConfig 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(MAASModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMAASModelConfig(document.RootElement, options); + } + + internal static MAASModelConfig DeserializeMAASModelConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureEndpoint = default; + string apiKey = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureEndpoint"u8)) + { + azureEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiKey"u8)) + { + apiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MAASModelConfig(type, serializedAdditionalRawData, azureEndpoint, apiKey); + } + + 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(MAASModelConfig)} does not support writing '{options.Format}' format."); + } + } + + MAASModelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMAASModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MAASModelConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MAASModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMAASModelConfig(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.cs new file mode 100644 index 000000000000..7dc787b2690e --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MAASModelConfig.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// MaaS model configuration. + public partial class MAASModelConfig : TargetModelConfig + { + /// Initializes a new instance of . + /// Endpoint URL for MAAS model. + /// API Key for MAAS model. + /// or is null. + public MAASModelConfig(string azureEndpoint, string apiKey) + { + Argument.AssertNotNull(azureEndpoint, nameof(azureEndpoint)); + Argument.AssertNotNull(apiKey, nameof(apiKey)); + + Type = "MAAS"; + AzureEndpoint = azureEndpoint; + ApiKey = apiKey; + } + + /// Initializes a new instance of . + /// Type of the model configuration. + /// Keeps track of any properties unknown to the library. + /// Endpoint URL for MAAS model. + /// API Key for MAAS model. + internal MAASModelConfig(string type, IDictionary serializedAdditionalRawData, string azureEndpoint, string apiKey) : base(type, serializedAdditionalRawData) + { + AzureEndpoint = azureEndpoint; + ApiKey = apiKey; + } + + /// Initializes a new instance of for deserialization. + internal MAASModelConfig() + { + } + + /// Endpoint URL for MAAS model. + public string AzureEndpoint { get; set; } + /// API Key for MAAS model. + public string ApiKey { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs index e5c61e31cf41..5e1642facaad 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs @@ -81,6 +81,7 @@ internal static MessageDeltaTextAnnotation DeserializeMessageDeltaTextAnnotation { case "file_citation": return MessageDeltaTextFileCitationAnnotation.DeserializeMessageDeltaTextFileCitationAnnotation(element, options); case "file_path": return MessageDeltaTextFilePathAnnotation.DeserializeMessageDeltaTextFilePathAnnotation(element, options); + case "url_citation": return MessageDeltaTextUrlCitationAnnotation.DeserializeMessageDeltaTextUrlCitationAnnotation(element, options); } } return UnknownMessageDeltaTextAnnotation.DeserializeUnknownMessageDeltaTextAnnotation(element, options); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs index a283e7754283..f3dea9aa929d 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Projects /// /// The abstract base representation of a streamed text content part's text annotation. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// public abstract partial class MessageDeltaTextAnnotation { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs index c7965b213a24..58f826ce5db7 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs @@ -56,7 +56,7 @@ internal MessageDeltaTextContentObject() /// /// Annotations for the text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// /// Keeps track of any properties unknown to the library. internal MessageDeltaTextContentObject(string value, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) @@ -71,7 +71,7 @@ internal MessageDeltaTextContentObject(string value, IReadOnlyList /// Annotations for the text. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// public IReadOnlyList Annotations { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs new file mode 100644 index 000000000000..17ce43f4c6f8 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs @@ -0,0 +1,176 @@ +// 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 MessageDeltaTextUrlCitationAnnotation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationAnnotation)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("url_citation"u8); + writer.WriteObjectValue(UrlCitation, options); + if (Optional.IsDefined(StartIndex)) + { + writer.WritePropertyName("start_index"u8); + writer.WriteNumberValue(StartIndex.Value); + } + if (Optional.IsDefined(EndIndex)) + { + writer.WritePropertyName("end_index"u8); + writer.WriteNumberValue(EndIndex.Value); + } + } + + MessageDeltaTextUrlCitationAnnotation 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(MessageDeltaTextUrlCitationAnnotation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement, options); + } + + internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTextUrlCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageDeltaTextUrlCitationDetails urlCitation = default; + int? startIndex = default; + int? endIndex = default; + int index = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url_citation"u8)) + { + urlCitation = MessageDeltaTextUrlCitationDetails.DeserializeMessageDeltaTextUrlCitationDetails(property.Value, options); + continue; + } + if (property.NameEquals("start_index"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("end_index"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("index"u8)) + { + index = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageDeltaTextUrlCitationAnnotation( + index, + type, + serializedAdditionalRawData, + urlCitation, + startIndex, + endIndex); + } + + 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(MessageDeltaTextUrlCitationAnnotation)} does not support writing '{options.Format}' format."); + } + } + + MessageDeltaTextUrlCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationAnnotation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MessageDeltaTextUrlCitationAnnotation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs new file mode 100644 index 000000000000..6901df6957b2 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// A citation within the message that points to a specific URL associated with the message. Generated when the agent uses tools such as 'bing_grounding' to search the Internet. + public partial class MessageDeltaTextUrlCitationAnnotation : MessageDeltaTextAnnotation + { + /// Initializes a new instance of . + /// The index of the annotation within a text content part. + /// The details of the URL citation. + /// is null. + internal MessageDeltaTextUrlCitationAnnotation(int index, MessageDeltaTextUrlCitationDetails urlCitation) : base(index) + { + Argument.AssertNotNull(urlCitation, nameof(urlCitation)); + + Type = "url_citation"; + UrlCitation = urlCitation; + } + + /// Initializes a new instance of . + /// The index of the annotation within a text content part. + /// The type of the text content annotation. + /// Keeps track of any properties unknown to the library. + /// The details of the URL citation. + /// The first text index associated with this text annotation. + /// The last text index associated with this text annotation. + internal MessageDeltaTextUrlCitationAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextUrlCitationDetails urlCitation, int? startIndex, int? endIndex) : base(index, type, serializedAdditionalRawData) + { + UrlCitation = urlCitation; + StartIndex = startIndex; + EndIndex = endIndex; + } + + /// Initializes a new instance of for deserialization. + internal MessageDeltaTextUrlCitationAnnotation() + { + } + + /// The details of the URL citation. + public MessageDeltaTextUrlCitationDetails UrlCitation { get; } + /// The first text index associated with this text annotation. + public int? StartIndex { get; } + /// The last text index associated with this text annotation. + public int? EndIndex { get; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs new file mode 100644 index 000000000000..0180d157e5c7 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs @@ -0,0 +1,153 @@ +// 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 MessageDeltaTextUrlCitationDetails : 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(MessageDeltaTextUrlCitationDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(Title)) + { + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageDeltaTextUrlCitationDetails 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(MessageDeltaTextUrlCitationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageDeltaTextUrlCitationDetails(document.RootElement, options); + } + + internal static MessageDeltaTextUrlCitationDetails DeserializeMessageDeltaTextUrlCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + string title = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageDeltaTextUrlCitationDetails(url, title, 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(MessageDeltaTextUrlCitationDetails)} does not support writing '{options.Format}' format."); + } + } + + MessageDeltaTextUrlCitationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageDeltaTextUrlCitationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationDetails)} 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 MessageDeltaTextUrlCitationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageDeltaTextUrlCitationDetails(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/MessageDeltaTextUrlCitationDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationDetails.cs new file mode 100644 index 000000000000..26223d2ee019 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextUrlCitationDetails.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// A representation of a URL citation, as used in text thread message content. + public partial class MessageDeltaTextUrlCitationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// is null. + internal MessageDeltaTextUrlCitationDetails(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// The title of the URL. + /// Keeps track of any properties unknown to the library. + internal MessageDeltaTextUrlCitationDetails(string url, string title, IDictionary serializedAdditionalRawData) + { + Url = url; + Title = title; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MessageDeltaTextUrlCitationDetails() + { + } + + /// The URL associated with this citation. + public string Url { get; } + /// The title of the URL. + public string Title { get; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.Serialization.cs index 99e606d3fe51..befa7fbe1f59 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.Serialization.cs @@ -81,6 +81,7 @@ internal static MessageTextAnnotation DeserializeMessageTextAnnotation(JsonEleme { case "file_citation": return MessageTextFileCitationAnnotation.DeserializeMessageTextFileCitationAnnotation(element, options); case "file_path": return MessageTextFilePathAnnotation.DeserializeMessageTextFilePathAnnotation(element, options); + case "url_citation": return MessageTextUrlCitationAnnotation.DeserializeMessageTextUrlCitationAnnotation(element, options); } } return UnknownMessageTextAnnotation.DeserializeUnknownMessageTextAnnotation(element, options); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs index 63dbe8c6d7b9..833119a2a8ec 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Projects /// /// An abstract representation of an annotation to text thread message content. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , and . /// public abstract partial class MessageTextAnnotation { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs new file mode 100644 index 000000000000..780f158bb498 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs @@ -0,0 +1,176 @@ +// 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 MessageTextUrlCitationAnnotation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageTextUrlCitationAnnotation)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("url_citation"u8); + writer.WriteObjectValue(UrlCitation, options); + if (Optional.IsDefined(StartIndex)) + { + writer.WritePropertyName("start_index"u8); + writer.WriteNumberValue(StartIndex.Value); + } + if (Optional.IsDefined(EndIndex)) + { + writer.WritePropertyName("end_index"u8); + writer.WriteNumberValue(EndIndex.Value); + } + } + + MessageTextUrlCitationAnnotation 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(MessageTextUrlCitationAnnotation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageTextUrlCitationAnnotation(document.RootElement, options); + } + + internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MessageTextUrlCitationDetails urlCitation = default; + int? startIndex = default; + int? endIndex = default; + string type = default; + string text = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url_citation"u8)) + { + urlCitation = MessageTextUrlCitationDetails.DeserializeMessageTextUrlCitationDetails(property.Value, options); + continue; + } + if (property.NameEquals("start_index"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("end_index"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endIndex = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageTextUrlCitationAnnotation( + type, + text, + serializedAdditionalRawData, + urlCitation, + startIndex, + endIndex); + } + + 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(MessageTextUrlCitationAnnotation)} does not support writing '{options.Format}' format."); + } + } + + MessageTextUrlCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageTextUrlCitationAnnotation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageTextUrlCitationAnnotation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new MessageTextUrlCitationAnnotation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageTextUrlCitationAnnotation(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.cs new file mode 100644 index 000000000000..7ffa68e389a4 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationAnnotation.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// A citation within the message that points to a specific URL associated with the message. Generated when the agent uses tools such as 'bing_grounding' to search the Internet. + public partial class MessageTextUrlCitationAnnotation : MessageTextAnnotation + { + /// Initializes a new instance of . + /// The textual content associated with this text annotation item. + /// The details of the URL citation. + /// or is null. + internal MessageTextUrlCitationAnnotation(string text, MessageTextUrlCitationDetails urlCitation) : base(text) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(urlCitation, nameof(urlCitation)); + + Type = "url_citation"; + UrlCitation = urlCitation; + } + + /// Initializes a new instance of . + /// The object type. + /// The textual content associated with this text annotation item. + /// Keeps track of any properties unknown to the library. + /// The details of the URL citation. + /// The first text index associated with this text annotation. + /// The last text index associated with this text annotation. + internal MessageTextUrlCitationAnnotation(string type, string text, IDictionary serializedAdditionalRawData, MessageTextUrlCitationDetails urlCitation, int? startIndex, int? endIndex) : base(type, text, serializedAdditionalRawData) + { + UrlCitation = urlCitation; + StartIndex = startIndex; + EndIndex = endIndex; + } + + /// Initializes a new instance of for deserialization. + internal MessageTextUrlCitationAnnotation() + { + } + + /// The details of the URL citation. + public MessageTextUrlCitationDetails UrlCitation { get; } + /// The first text index associated with this text annotation. + public int? StartIndex { get; } + /// The last text index associated with this text annotation. + public int? EndIndex { get; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationDetails.Serialization.cs new file mode 100644 index 000000000000..a0a64555310b --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationDetails.Serialization.cs @@ -0,0 +1,153 @@ +// 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 MessageTextUrlCitationDetails : 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(MessageTextUrlCitationDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Url); + if (Optional.IsDefined(Title)) + { + writer.WritePropertyName("title"u8); + writer.WriteStringValue(Title); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MessageTextUrlCitationDetails 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(MessageTextUrlCitationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageTextUrlCitationDetails(document.RootElement, options); + } + + internal static MessageTextUrlCitationDetails DeserializeMessageTextUrlCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + string title = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("title"u8)) + { + title = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageTextUrlCitationDetails(url, title, 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(MessageTextUrlCitationDetails)} does not support writing '{options.Format}' format."); + } + } + + MessageTextUrlCitationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageTextUrlCitationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageTextUrlCitationDetails)} 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 MessageTextUrlCitationDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageTextUrlCitationDetails(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/MessageTextUrlCitationDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationDetails.cs new file mode 100644 index 000000000000..b39dd77505c7 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextUrlCitationDetails.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// A representation of a URL citation, as used in text thread message content. + public partial class MessageTextUrlCitationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// is null. + internal MessageTextUrlCitationDetails(string url) + { + Argument.AssertNotNull(url, nameof(url)); + + Url = url; + } + + /// Initializes a new instance of . + /// The URL associated with this citation. + /// The title of the URL. + /// Keeps track of any properties unknown to the library. + internal MessageTextUrlCitationDetails(string url, string title, IDictionary serializedAdditionalRawData) + { + Url = url; + Title = title; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MessageTextUrlCitationDetails() + { + } + + /// The URL associated with this citation. + public string Url { get; } + /// The title of the URL. + public string Title { get; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.Serialization.cs index 7ac22a587d8a..68cd7b05dc6b 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.Serialization.cs @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("type"u8); writer.WriteStringValue(Type.ToString()); writer.WritePropertyName("assistant_id"u8); - writer.WriteStringValue(AssistantId); + writer.WriteStringValue(AgentId); writer.WritePropertyName("thread_id"u8); writer.WriteStringValue(ThreadId); writer.WritePropertyName("run_id"u8); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.cs index 6d403877ed00..cbb6c25cf17d 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStep.cs @@ -48,7 +48,7 @@ public partial class RunStep /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The type of run step, which can be either message_creation or tool_calls. - /// The ID of the agent associated with the run step. + /// The ID of the agent associated with the run step. /// The ID of the thread that was run. /// The ID of the run that this run step is a part of. /// The status of this run step. @@ -64,18 +64,18 @@ public partial class RunStep /// The Unix timestamp, in seconds, representing when this was cancelled. /// The Unix timestamp, in seconds, representing when this failed. /// 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 RunStep(string id, RunStepType type, string assistantId, string threadId, string runId, RunStepStatus status, RunStepDetails stepDetails, RunStepError lastError, DateTimeOffset createdAt, DateTimeOffset? expiredAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IReadOnlyDictionary metadata) + /// , , , or is null. + internal RunStep(string id, RunStepType type, string agentId, string threadId, string runId, RunStepStatus status, RunStepDetails stepDetails, RunStepError lastError, DateTimeOffset createdAt, DateTimeOffset? expiredAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IReadOnlyDictionary metadata) { Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); Argument.AssertNotNull(threadId, nameof(threadId)); Argument.AssertNotNull(runId, nameof(runId)); Argument.AssertNotNull(stepDetails, nameof(stepDetails)); Id = id; Type = type; - AssistantId = assistantId; + AgentId = agentId; ThreadId = threadId; RunId = runId; Status = status; @@ -93,7 +93,7 @@ internal RunStep(string id, RunStepType type, string assistantId, string threadI /// The identifier, which can be referenced in API endpoints. /// The object type, which is always 'thread.run.step'. /// The type of run step, which can be either message_creation or tool_calls. - /// The ID of the agent associated with the run step. + /// The ID of the agent associated with the run step. /// The ID of the thread that was run. /// The ID of the run that this run step is a part of. /// The status of this run step. @@ -111,12 +111,12 @@ internal RunStep(string id, RunStepType type, string assistantId, string threadI /// Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal RunStep(string id, string @object, RunStepType type, string assistantId, string threadId, string runId, RunStepStatus status, RunStepDetails stepDetails, RunStepError lastError, DateTimeOffset createdAt, DateTimeOffset? expiredAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, RunStepCompletionUsage usage, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal RunStep(string id, string @object, RunStepType type, string agentId, string threadId, string runId, RunStepStatus status, RunStepDetails stepDetails, RunStepError lastError, DateTimeOffset createdAt, DateTimeOffset? expiredAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, RunStepCompletionUsage usage, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; Type = type; - AssistantId = assistantId; + AgentId = agentId; ThreadId = threadId; RunId = runId; Status = status; @@ -143,7 +143,7 @@ internal RunStep() /// The type of run step, which can be either message_creation or tool_calls. public RunStepType Type { get; } /// The ID of the agent associated with the run step. - public string AssistantId { get; } + public string AgentId { get; } /// The ID of the thread that was run. public string ThreadId { get; } /// The ID of the run that this run step is a part of. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/TargetModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/TargetModelConfig.Serialization.cs new file mode 100644 index 000000000000..7dc24d6f05cc --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/TargetModelConfig.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + [PersistableModelProxy(typeof(UnknownTargetModelConfig))] + public partial class TargetModelConfig : 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(TargetModelConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetModelConfig 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(TargetModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetModelConfig(document.RootElement, options); + } + + internal static TargetModelConfig DeserializeTargetModelConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AOAI": return AOAIModelConfig.DeserializeAOAIModelConfig(element, options); + case "MAAS": return MAASModelConfig.DeserializeMAASModelConfig(element, options); + } + } + return UnknownTargetModelConfig.DeserializeUnknownTargetModelConfig(element, options); + } + + 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(TargetModelConfig)} does not support writing '{options.Format}' format."); + } + } + + TargetModelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetModelConfig)} 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 TargetModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetModelConfig(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/TargetModelConfig.cs b/sdk/ai/Azure.AI.Projects/src/Generated/TargetModelConfig.cs new file mode 100644 index 000000000000..a8f5c27ef5ea --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/TargetModelConfig.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// + /// Abstract class for model configuration. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class TargetModelConfig + { + /// + /// 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 protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected TargetModelConfig() + { + } + + /// Initializes a new instance of . + /// Type of the model configuration. + /// Keeps track of any properties unknown to the library. + internal TargetModelConfig(string type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of the model configuration. + internal string Type { get; set; } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs index 73ae8f532920..4d6392e45951 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs @@ -80,10 +80,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - if (AssistantId != null) + if (AgentId != null) { writer.WritePropertyName("assistant_id"u8); - writer.WriteStringValue(AssistantId); + writer.WriteStringValue(AgentId); } else { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs index e5adfbbe605a..1e81dab8a976 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs @@ -60,12 +60,12 @@ public partial class ThreadMessage /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// If applicable, the ID of the agent that authored this message. + /// If applicable, the ID of the agent that authored this message. /// If applicable, the ID of the run associated with the authoring of this message. /// A list of files attached to the message, and the tools they were added to. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// , or is null. - internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IEnumerable contentItems, string assistantId, string runId, IEnumerable attachments, IReadOnlyDictionary metadata) + internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IEnumerable contentItems, string agentId, string runId, IEnumerable attachments, IReadOnlyDictionary metadata) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -80,7 +80,7 @@ internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, Mes IncompleteAt = incompleteAt; Role = role; ContentItems = contentItems.ToList(); - AssistantId = assistantId; + AgentId = agentId; RunId = runId; Attachments = attachments?.ToList(); Metadata = metadata; @@ -101,12 +101,12 @@ internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, Mes /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// If applicable, the ID of the agent that authored this message. + /// If applicable, the ID of the agent that authored this message. /// If applicable, the ID of the run associated with the authoring of this message. /// A list of files attached to the message, and the tools they were added to. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal ThreadMessage(string id, string @object, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IReadOnlyList contentItems, string assistantId, string runId, IReadOnlyList attachments, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal ThreadMessage(string id, string @object, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IReadOnlyList contentItems, string agentId, string runId, IReadOnlyList attachments, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -118,7 +118,7 @@ internal ThreadMessage(string id, string @object, DateTimeOffset createdAt, stri IncompleteAt = incompleteAt; Role = role; ContentItems = contentItems; - AssistantId = assistantId; + AgentId = agentId; RunId = runId; Attachments = attachments; Metadata = metadata; @@ -154,7 +154,7 @@ internal ThreadMessage() /// public IReadOnlyList ContentItems { get; } /// If applicable, the ID of the agent that authored this message. - public string AssistantId { get; } + public string AgentId { get; } /// If applicable, the ID of the run associated with the authoring of this message. public string RunId { get; } /// A list of files attached to the message, and the tools they were added to. 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 c6dd5c4b150e..b257bc059207 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("thread_id"u8); writer.WriteStringValue(ThreadId); writer.WritePropertyName("assistant_id"u8); - writer.WriteStringValue(AssistantId); + writer.WriteStringValue(AgentId); writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.ToString()); if (Optional.IsDefined(RequiredAction)) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs index e26dcc9823d4..72a9e1f5f1b8 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs @@ -49,7 +49,7 @@ public partial class ThreadRun /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The ID of the thread associated with this run. - /// The ID of the agent associated with the thread this run was performed against. + /// The ID of the agent associated with the thread this run was performed against. /// The status of the agent thread run. /// The last error, if any, encountered by this agent thread run. /// The ID of the model to use. @@ -74,19 +74,19 @@ 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. /// Determines if tools can be executed in parallel within the run. - /// , , , , or is null. - internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls) + /// , , , , or is null. + internal ThreadRun(string id, string threadId, string agentId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); - Argument.AssertNotNull(assistantId, nameof(assistantId)); + Argument.AssertNotNull(agentId, nameof(agentId)); Argument.AssertNotNull(model, nameof(model)); Argument.AssertNotNull(instructions, nameof(instructions)); Argument.AssertNotNull(tools, nameof(tools)); Id = id; ThreadId = threadId; - AssistantId = assistantId; + AgentId = agentId; Status = status; LastError = lastError; Model = model; @@ -113,7 +113,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// The identifier, which can be referenced in API endpoints. /// The object type, which is always 'thread.run'. /// The ID of the thread associated with this run. - /// The ID of the agent associated with the thread this run was performed against. + /// The ID of the agent associated with the thread this run was performed against. /// The status of the agent thread run. /// /// The details of the action required for the agent thread run to continue. @@ -147,12 +147,12 @@ 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 agentId, 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; ThreadId = threadId; - AssistantId = assistantId; + AgentId = agentId; Status = status; RequiredAction = requiredAction; LastError = lastError; @@ -191,7 +191,7 @@ internal ThreadRun() /// The ID of the thread associated with this run. public string ThreadId { get; } /// The ID of the agent associated with the thread this run was performed against. - public string AssistantId { get; } + public string AgentId { get; } /// The status of the agent thread run. public RunStatus Status { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.Serialization.cs new file mode 100644 index 000000000000..59983ae181b4 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.Serialization.cs @@ -0,0 +1,126 @@ +// 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 +{ + internal partial class UnknownTargetModelConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetModelConfig)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + TargetModelConfig 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(TargetModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetModelConfig(document.RootElement, options); + } + + internal static UnknownTargetModelConfig DeserializeUnknownTargetModelConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownTargetModelConfig(type, 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(TargetModelConfig)} does not support writing '{options.Format}' format."); + } + } + + TargetModelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetModelConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownTargetModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownTargetModelConfig(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.cs new file mode 100644 index 000000000000..b7130f7a857a --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownTargetModelConfig.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects +{ + /// Unknown version of TargetModelConfig. + internal partial class UnknownTargetModelConfig : TargetModelConfig + { + /// Initializes a new instance of . + /// Type of the model configuration. + /// Keeps track of any properties unknown to the library. + internal UnknownTargetModelConfig(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownTargetModelConfig() + { + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/tsp-location.yaml b/sdk/ai/Azure.AI.Projects/tsp-location.yaml index 396a08a5fb0c..5d9605430614 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: 27e45fc03fd2698e3ad9b2799b313f289daeb142 +commit: 354791fda1684660dec0900b0270d7b014b1dac5 repo: Azure/azure-rest-api-specs additionalDirectories: