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 d44558f16948..b9ce4b300305 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,10 +199,10 @@ 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, 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, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Collections.Generic.IReadOnlyDictionary metadata = 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, 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, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Collections.Generic.IReadOnlyDictionary metadata = 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, 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, 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; } @@ -488,7 +488,7 @@ public static partial class AIProjectsModelFactory 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.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningStatus = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } + public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } @@ -503,6 +503,8 @@ 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.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.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; } public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; } public static Azure.AI.Projects.RunError RunError(string code = null, string message = null) { throw null; } @@ -805,9 +807,10 @@ public EvaluationSchedule(Azure.AI.Projects.ApplicationInsightsConfiguration dat public Azure.AI.Projects.ApplicationInsightsConfiguration Data { get { throw null; } set { } } public string Description { get { throw null; } set { } } public System.Collections.Generic.IDictionary Evaluators { get { throw null; } } + public string IsEnabled { get { throw null; } } public string Name { get { throw null; } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public string ProvisioningStatus { get { throw null; } } + public string ProvisioningState { 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.Trigger Trigger { get { throw null; } set { } } @@ -1283,8 +1286,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MessageIncompleteDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MessageIncompleteDetails(Azure.AI.Projects.MessageIncompleteDetailsReason reason) { } - public Azure.AI.Projects.MessageIncompleteDetailsReason Reason { get { throw null; } set { } } + internal MessageIncompleteDetails() { } + public Azure.AI.Projects.MessageIncompleteDetailsReason Reason { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageIncompleteDetails 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) { } @@ -1378,7 +1381,7 @@ internal MessageStatusUpdate() { } public abstract partial class MessageTextAnnotation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MessageTextAnnotation(string text) { } - public string Text { get { throw null; } set { } } + public string Text { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextAnnotation 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) { } @@ -1401,10 +1404,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTextFileCitationAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageTextFileCitationAnnotation() : base (default(string)) { } - public int? EndIndex { get { throw null; } set { } } + public int? EndIndex { get { throw null; } } public string FileId { get { throw null; } } public string Quote { get { throw null; } } - public int? StartIndex { get { throw null; } set { } } + public int? StartIndex { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextFileCitationAnnotation 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) { } @@ -1415,9 +1418,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTextFilePathAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageTextFilePathAnnotation() : base (default(string)) { } - public int? EndIndex { get { throw null; } set { } } + public int? EndIndex { get { throw null; } } public string FileId { get { throw null; } } - public int? StartIndex { get { throw null; } set { } } + public int? StartIndex { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextFilePathAnnotation 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) { } @@ -2213,20 +2216,20 @@ internal TextAnnotationUpdate() { } } public partial class ThreadMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ThreadMessage(string id, System.DateTimeOffset createdAt, string threadId, Azure.AI.Projects.MessageStatus status, Azure.AI.Projects.MessageIncompleteDetails incompleteDetails, System.DateTimeOffset? completedAt, System.DateTimeOffset? incompleteAt, Azure.AI.Projects.MessageRole role, System.Collections.Generic.IEnumerable contentItems, string assistantId, string runId, System.Collections.Generic.IEnumerable attachments, System.Collections.Generic.IDictionary metadata) { } - public string AssistantId { get { throw null; } set { } } - public System.Collections.Generic.IList Attachments { get { throw null; } set { } } - public System.DateTimeOffset? CompletedAt { get { throw null; } set { } } - public System.Collections.Generic.IList ContentItems { get { throw null; } } - public System.DateTimeOffset CreatedAt { get { throw null; } set { } } - public string Id { get { throw null; } set { } } - public System.DateTimeOffset? IncompleteAt { get { throw null; } set { } } - public Azure.AI.Projects.MessageIncompleteDetails IncompleteDetails { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } - public Azure.AI.Projects.MessageRole Role { get { throw null; } set { } } - public string RunId { get { throw null; } set { } } - public Azure.AI.Projects.MessageStatus Status { get { throw null; } set { } } - public string ThreadId { get { throw null; } set { } } + internal ThreadMessage() { } + public string AssistantId { 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; } } + public System.DateTimeOffset CreatedAt { get { throw null; } } + public string Id { get { throw null; } } + public System.DateTimeOffset? IncompleteAt { get { throw null; } } + public Azure.AI.Projects.MessageIncompleteDetails IncompleteDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + public Azure.AI.Projects.MessageRole Role { get { throw null; } } + public string RunId { get { throw null; } } + public Azure.AI.Projects.MessageStatus Status { get { throw null; } } + public string ThreadId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.ThreadMessage 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) { } 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 d44558f16948..b9ce4b300305 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,10 +199,10 @@ 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, 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, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Collections.Generic.IReadOnlyDictionary metadata = 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, 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, System.Collections.Generic.IReadOnlyDictionary metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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, System.Collections.Generic.IReadOnlyDictionary metadata = 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, 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, 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; } @@ -488,7 +488,7 @@ public static partial class AIProjectsModelFactory 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.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningStatus = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } + public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } @@ -503,6 +503,8 @@ 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.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.RequiredToolCall RequiredToolCall(string type = null, string id = null) { throw null; } public static Azure.AI.Projects.RunCompletionUsage RunCompletionUsage(long completionTokens = (long)0, long promptTokens = (long)0, long totalTokens = (long)0) { throw null; } public static Azure.AI.Projects.RunError RunError(string code = null, string message = null) { throw null; } @@ -805,9 +807,10 @@ public EvaluationSchedule(Azure.AI.Projects.ApplicationInsightsConfiguration dat public Azure.AI.Projects.ApplicationInsightsConfiguration Data { get { throw null; } set { } } public string Description { get { throw null; } set { } } public System.Collections.Generic.IDictionary Evaluators { get { throw null; } } + public string IsEnabled { get { throw null; } } public string Name { get { throw null; } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } - public string ProvisioningStatus { get { throw null; } } + public string ProvisioningState { 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.Trigger Trigger { get { throw null; } set { } } @@ -1283,8 +1286,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MessageIncompleteDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MessageIncompleteDetails(Azure.AI.Projects.MessageIncompleteDetailsReason reason) { } - public Azure.AI.Projects.MessageIncompleteDetailsReason Reason { get { throw null; } set { } } + internal MessageIncompleteDetails() { } + public Azure.AI.Projects.MessageIncompleteDetailsReason Reason { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageIncompleteDetails 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) { } @@ -1378,7 +1381,7 @@ internal MessageStatusUpdate() { } public abstract partial class MessageTextAnnotation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected MessageTextAnnotation(string text) { } - public string Text { get { throw null; } set { } } + public string Text { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextAnnotation 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) { } @@ -1401,10 +1404,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTextFileCitationAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageTextFileCitationAnnotation() : base (default(string)) { } - public int? EndIndex { get { throw null; } set { } } + public int? EndIndex { get { throw null; } } public string FileId { get { throw null; } } public string Quote { get { throw null; } } - public int? StartIndex { get { throw null; } set { } } + public int? StartIndex { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextFileCitationAnnotation 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) { } @@ -1415,9 +1418,9 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class MessageTextFilePathAnnotation : Azure.AI.Projects.MessageTextAnnotation, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MessageTextFilePathAnnotation() : base (default(string)) { } - public int? EndIndex { get { throw null; } set { } } + public int? EndIndex { get { throw null; } } public string FileId { get { throw null; } } - public int? StartIndex { get { throw null; } set { } } + public int? StartIndex { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MessageTextFilePathAnnotation 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) { } @@ -2213,20 +2216,20 @@ internal TextAnnotationUpdate() { } } public partial class ThreadMessage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ThreadMessage(string id, System.DateTimeOffset createdAt, string threadId, Azure.AI.Projects.MessageStatus status, Azure.AI.Projects.MessageIncompleteDetails incompleteDetails, System.DateTimeOffset? completedAt, System.DateTimeOffset? incompleteAt, Azure.AI.Projects.MessageRole role, System.Collections.Generic.IEnumerable contentItems, string assistantId, string runId, System.Collections.Generic.IEnumerable attachments, System.Collections.Generic.IDictionary metadata) { } - public string AssistantId { get { throw null; } set { } } - public System.Collections.Generic.IList Attachments { get { throw null; } set { } } - public System.DateTimeOffset? CompletedAt { get { throw null; } set { } } - public System.Collections.Generic.IList ContentItems { get { throw null; } } - public System.DateTimeOffset CreatedAt { get { throw null; } set { } } - public string Id { get { throw null; } set { } } - public System.DateTimeOffset? IncompleteAt { get { throw null; } set { } } - public Azure.AI.Projects.MessageIncompleteDetails IncompleteDetails { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Metadata { get { throw null; } set { } } - public Azure.AI.Projects.MessageRole Role { get { throw null; } set { } } - public string RunId { get { throw null; } set { } } - public Azure.AI.Projects.MessageStatus Status { get { throw null; } set { } } - public string ThreadId { get { throw null; } set { } } + internal ThreadMessage() { } + public string AssistantId { 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; } } + public System.DateTimeOffset CreatedAt { get { throw null; } } + public string Id { get { throw null; } } + public System.DateTimeOffset? IncompleteAt { get { throw null; } } + public Azure.AI.Projects.MessageIncompleteDetails IncompleteDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Metadata { get { throw null; } } + public Azure.AI.Projects.MessageRole Role { get { throw null; } } + public string RunId { get { throw null; } } + public Azure.AI.Projects.MessageStatus Status { get { throw null; } } + public string ThreadId { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.ThreadMessage 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) { } diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs index 2259ada87ba9..73ae1c769605 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs @@ -193,7 +193,7 @@ public static ThreadMessage ThreadMessage(string id = null, DateTimeOffset creat attachments ??= new List(); metadata ??= new Dictionary(); - return new ThreadMessage(id, @object: null, createdAt, threadId, status, incompleteDetails, completedAt, incompleteAt, role, contentItems?.ToList(), agentId, runId, attachments?.ToList(), metadata, serializedAdditionalRawData: null); + return new ThreadMessage(id, @object: null, createdAt, threadId, status, incompleteDetails, completedAt, incompleteAt, role, contentItems?.ToList(), agentId, runId, attachments?.ToList(), (IReadOnlyDictionary)metadata, serializedAdditionalRawData: null); } public static RequiredFunctionToolCall RequiredFunctionToolCall(string toolCallId, string functionName, string functionArguments) diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs index 053b051e23b1..05e48b0aeba6 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AgentsClient.Streaming.cs @@ -68,7 +68,7 @@ public virtual AsyncCollectionResult CreateRunStreamingAsync(st overrideModelName, overrideInstructions, additionalInstructions, - additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), + additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), overrideTools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), stream: true, temperature, @@ -142,7 +142,7 @@ public virtual CollectionResult CreateRunStreaming(string threa overrideModelName, overrideInstructions, additionalInstructions, - additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), + additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), overrideTools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), stream: true, temperature, diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index c4044af53ced..ca30fab8a036 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -64,9 +64,10 @@ public static SystemData SystemData(DateTimeOffset? createdAt = null, string cre /// Data for evaluation. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. - /// Status of the evaluation. It is set by service and is read-only. + /// Provisioning State of the evaluation. It is set by service and is read-only. /// Evaluation's tags. Unlike properties, tags are fully mutable. /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// Enabled status of the evaluation. It is set by service and is read-only. /// Evaluators to be used for the evaluation. /// /// Trigger for the evaluation. @@ -74,7 +75,7 @@ public static SystemData SystemData(DateTimeOffset? createdAt = null, string cre /// The available derived classes include and . /// /// A new instance for mocking. - public static EvaluationSchedule EvaluationSchedule(string name = null, ApplicationInsightsConfiguration data = null, string description = null, SystemData systemData = null, string provisioningStatus = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null, Trigger trigger = null) + public static EvaluationSchedule EvaluationSchedule(string name = null, ApplicationInsightsConfiguration data = null, string description = null, SystemData systemData = null, string provisioningState = null, IDictionary tags = null, IDictionary properties = null, string isEnabled = null, IDictionary evaluators = null, Trigger trigger = null) { tags ??= new Dictionary(); properties ??= new Dictionary(); @@ -85,9 +86,10 @@ public static EvaluationSchedule EvaluationSchedule(string name = null, Applicat data, description, systemData, - provisioningStatus, + provisioningState, tags, properties, + isEnabled, evaluators, trigger, serializedAdditionalRawData: null); @@ -186,6 +188,23 @@ public static ThreadMessageOptions ThreadMessageOptions(MessageRole role = defau return new ThreadMessageOptions(role, content, attachments?.ToList(), metadata, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The provided reason describing why the message was marked as incomplete. + /// A new instance for mocking. + public static MessageIncompleteDetails MessageIncompleteDetails(MessageIncompleteDetailsReason reason = default) + { + return new MessageIncompleteDetails(reason, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The object type. + /// The textual content associated with this text annotation item. + /// A new instance for mocking. + public static MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null) + { + return new UnknownMessageTextAnnotation(type, text, 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. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs index a59cc6ca00e5..6d8476ffe785 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs @@ -1710,7 +1710,7 @@ public virtual Response UpdateMessage(string threadId, string messageId, Request /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -1720,7 +1720,7 @@ public virtual async Task> CreateRunAsync(string threadId, s overrideModelName, overrideInstructions, additionalInstructions, - additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), + additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), overrideTools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), stream, temperature, @@ -1780,7 +1780,7 @@ public virtual async Task> CreateRunAsync(string threadId, s /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -1790,7 +1790,7 @@ public virtual Response CreateRun(string threadId, string assistantId overrideModelName, overrideInstructions, additionalInstructions, - additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), + additionalMessages?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), overrideTools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), stream, temperature, @@ -1817,7 +1817,7 @@ public virtual Response CreateRun(string threadId, string assistantId /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -1858,7 +1858,7 @@ public virtual async Task CreateRunAsync(string threadId, RequestConte /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs index 9346614ba846..91cd817d3827 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs @@ -268,7 +268,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element string model = default; string instructions = default; string additionalInstructions = default; - IReadOnlyList additionalMessages = default; + IReadOnlyList additionalMessages = default; IReadOnlyList tools = default; bool? stream = default; float? temperature = default; @@ -324,10 +324,10 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ThreadMessage.DeserializeThreadMessage(item, options)); + array.Add(ThreadMessageOptions.DeserializeThreadMessageOptions(item, options)); } additionalMessages = array; continue; @@ -450,7 +450,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element model, instructions, additionalInstructions, - additionalMessages ?? new ChangeTrackingList(), + additionalMessages ?? new ChangeTrackingList(), tools ?? new ChangeTrackingList(), stream, temperature, diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs index 8d7f0f84341c..b47736e413eb 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs @@ -53,7 +53,7 @@ internal CreateRunRequest(string assistantId) Argument.AssertNotNull(assistantId, nameof(assistantId)); AssistantId = assistantId; - AdditionalMessages = new ChangeTrackingList(); + AdditionalMessages = new ChangeTrackingList(); OverrideTools = new ChangeTrackingList(); Metadata = new ChangeTrackingDictionary(); } @@ -102,7 +102,7 @@ internal CreateRunRequest(string assistantId) /// Specifies the format that the model must output. /// 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, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { AssistantId = assistantId; OverrideModelName = overrideModelName; @@ -139,7 +139,7 @@ internal CreateRunRequest() /// public string AdditionalInstructions { get; } /// Adds additional messages to the thread before creating the run. - public IReadOnlyList AdditionalMessages { get; } + public IReadOnlyList AdditionalMessages { get; } /// /// The overridden list of enabled tools that the agent should use to run the thread. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.Serialization.cs index 7223d12eb966..e360c896eca0 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.Serialization.cs @@ -51,10 +51,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("systemData"u8); writer.WriteObjectValue(SystemData, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningStatus)) + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { - writer.WritePropertyName("provisioningStatus"u8); - writer.WriteStringValue(ProvisioningStatus); + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); } if (Optional.IsCollectionDefined(Tags)) { @@ -78,6 +78,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } + if (options.Format != "W" && Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("isEnabled"u8); + writer.WriteStringValue(IsEnabled); + } writer.WritePropertyName("evaluators"u8); writer.WriteStartObject(); foreach (var item in Evaluators) @@ -129,9 +134,10 @@ internal static EvaluationSchedule DeserializeEvaluationSchedule(JsonElement ele ApplicationInsightsConfiguration data = default; string description = default; SystemData systemData = default; - string provisioningStatus = default; + string provisioningState = default; IDictionary tags = default; IDictionary properties = default; + string isEnabled = default; IDictionary evaluators = default; Trigger trigger = default; IDictionary serializedAdditionalRawData = default; @@ -162,9 +168,9 @@ internal static EvaluationSchedule DeserializeEvaluationSchedule(JsonElement ele systemData = SystemData.DeserializeSystemData(property.Value, options); continue; } - if (property.NameEquals("provisioningStatus"u8)) + if (property.NameEquals("provisioningState"u8)) { - provisioningStatus = property.Value.GetString(); + provisioningState = property.Value.GetString(); continue; } if (property.NameEquals("tags"u8)) @@ -195,6 +201,11 @@ internal static EvaluationSchedule DeserializeEvaluationSchedule(JsonElement ele properties = dictionary; continue; } + if (property.NameEquals("isEnabled"u8)) + { + isEnabled = property.Value.GetString(); + continue; + } if (property.NameEquals("evaluators"u8)) { Dictionary dictionary = new Dictionary(); @@ -221,9 +232,10 @@ internal static EvaluationSchedule DeserializeEvaluationSchedule(JsonElement ele data, description, systemData, - provisioningStatus, + provisioningState, tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), + isEnabled, evaluators, trigger, serializedAdditionalRawData); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.cs index b9f90cc30e6b..ad1104435458 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationSchedule.cs @@ -72,9 +72,10 @@ public EvaluationSchedule(ApplicationInsightsConfiguration data, IDictionary Data for evaluation. /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. /// Metadata containing createdBy and modifiedBy information. - /// Status of the evaluation. It is set by service and is read-only. + /// Provisioning State of the evaluation. It is set by service and is read-only. /// Evaluation's tags. Unlike properties, tags are fully mutable. /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. + /// Enabled status of the evaluation. It is set by service and is read-only. /// Evaluators to be used for the evaluation. /// /// Trigger for the evaluation. @@ -82,15 +83,16 @@ public EvaluationSchedule(ApplicationInsightsConfiguration data, IDictionary and . /// /// Keeps track of any properties unknown to the library. - internal EvaluationSchedule(string name, ApplicationInsightsConfiguration data, string description, SystemData systemData, string provisioningStatus, IDictionary tags, IDictionary properties, IDictionary evaluators, Trigger trigger, IDictionary serializedAdditionalRawData) + internal EvaluationSchedule(string name, ApplicationInsightsConfiguration data, string description, SystemData systemData, string provisioningState, IDictionary tags, IDictionary properties, string isEnabled, IDictionary evaluators, Trigger trigger, IDictionary serializedAdditionalRawData) { Name = name; Data = data; Description = description; SystemData = systemData; - ProvisioningStatus = provisioningStatus; + ProvisioningState = provisioningState; Tags = tags; Properties = properties; + IsEnabled = isEnabled; Evaluators = evaluators; Trigger = trigger; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -109,12 +111,14 @@ internal EvaluationSchedule() public string Description { get; set; } /// Metadata containing createdBy and modifiedBy information. public SystemData SystemData { get; } - /// Status of the evaluation. It is set by service and is read-only. - public string ProvisioningStatus { get; } + /// Provisioning State of the evaluation. It is set by service and is read-only. + public string ProvisioningState { get; } /// Evaluation's tags. Unlike properties, tags are fully mutable. public IDictionary Tags { get; } /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. public IDictionary Properties { get; } + /// Enabled status of the evaluation. It is set by service and is read-only. + public string IsEnabled { get; } /// Evaluators to be used for the evaluation. public IDictionary Evaluators { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageImageFileDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageImageFileDetails.cs index 923ca385b9ca..150277d11fba 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageImageFileDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageImageFileDetails.cs @@ -48,7 +48,7 @@ internal partial class InternalMessageImageFileDetails /// Initializes a new instance of . /// The ID for the file associated with this image. /// is null. - public InternalMessageImageFileDetails(string internalDetails) + internal InternalMessageImageFileDetails(string internalDetails) { Argument.AssertNotNull(internalDetails, nameof(internalDetails)); @@ -70,6 +70,6 @@ internal InternalMessageImageFileDetails() } /// The ID for the file associated with this image. - public string InternalDetails { get; set; } + public string InternalDetails { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.Serialization.cs index bacb7ecd394c..925bfc4a3299 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.Serialization.cs @@ -81,7 +81,7 @@ internal static InternalMessageTextDetails DeserializeInternalMessageTextDetails return null; } string value = default; - IList annotations = default; + IReadOnlyList annotations = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs index fe9518a3e184..86770c52ed02 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextDetails.cs @@ -54,7 +54,7 @@ internal partial class InternalMessageTextDetails /// The available derived classes include and . /// /// or is null. - public InternalMessageTextDetails(string text, IEnumerable annotations) + internal InternalMessageTextDetails(string text, IEnumerable annotations) { Argument.AssertNotNull(text, nameof(text)); Argument.AssertNotNull(annotations, nameof(annotations)); @@ -71,7 +71,7 @@ public InternalMessageTextDetails(string text, IEnumerable and . /// /// Keeps track of any properties unknown to the library. - internal InternalMessageTextDetails(string text, IList annotations, IDictionary serializedAdditionalRawData) + internal InternalMessageTextDetails(string text, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) { Text = text; Annotations = annotations; @@ -84,12 +84,12 @@ internal InternalMessageTextDetails() } /// The text data. - public string Text { get; set; } + public string Text { get; } /// /// 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 . /// - public IList Annotations { get; } + public IReadOnlyList Annotations { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFileCitationDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFileCitationDetails.cs index ebe496bc5941..e61364394d03 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFileCitationDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFileCitationDetails.cs @@ -49,7 +49,7 @@ internal partial class InternalMessageTextFileCitationDetails /// The ID of the file associated with this citation. /// The specific quote cited in the associated file. /// or is null. - public InternalMessageTextFileCitationDetails(string fileId, string quote) + internal InternalMessageTextFileCitationDetails(string fileId, string quote) { Argument.AssertNotNull(fileId, nameof(fileId)); Argument.AssertNotNull(quote, nameof(quote)); @@ -75,8 +75,8 @@ internal InternalMessageTextFileCitationDetails() } /// The ID of the file associated with this citation. - public string FileId { get; set; } + public string FileId { get; } /// The specific quote cited in the associated file. - public string Quote { get; set; } + public string Quote { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFilePathDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFilePathDetails.cs index 5abadcb920db..2315f125f95e 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFilePathDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalMessageTextFilePathDetails.cs @@ -48,7 +48,7 @@ internal partial class InternalMessageTextFilePathDetails /// Initializes a new instance of . /// The ID of the specific file that the citation is from. /// is null. - public InternalMessageTextFilePathDetails(string fileId) + internal InternalMessageTextFilePathDetails(string fileId) { Argument.AssertNotNull(fileId, nameof(fileId)); @@ -70,6 +70,6 @@ internal InternalMessageTextFilePathDetails() } /// The ID of the specific file that the citation is from. - public string FileId { get; set; } + public string FileId { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageIncompleteDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageIncompleteDetails.cs index 1c1391ccb5be..5688889deda3 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageIncompleteDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageIncompleteDetails.cs @@ -47,7 +47,7 @@ public partial class MessageIncompleteDetails /// Initializes a new instance of . /// The provided reason describing why the message was marked as incomplete. - public MessageIncompleteDetails(MessageIncompleteDetailsReason reason) + internal MessageIncompleteDetails(MessageIncompleteDetailsReason reason) { Reason = reason; } @@ -67,6 +67,6 @@ internal MessageIncompleteDetails() } /// The provided reason describing why the message was marked as incomplete. - public MessageIncompleteDetailsReason Reason { get; set; } + public MessageIncompleteDetailsReason Reason { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs index 78ab0eb53b4f..63dbe8c6d7b9 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextAnnotation.cs @@ -78,6 +78,6 @@ internal MessageTextAnnotation() /// The object type. internal string Type { get; set; } /// The textual content associated with this text annotation item. - public string Text { get; set; } + public string Text { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFileCitationAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFileCitationAnnotation.cs index 27a7bbd5ecff..f1295b6fa3d9 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFileCitationAnnotation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFileCitationAnnotation.cs @@ -35,8 +35,8 @@ internal MessageTextFileCitationAnnotation() { } /// The first text index associated with this text annotation. - public int? StartIndex { get; set; } + public int? StartIndex { get; } /// The last text index associated with this text annotation. - public int? EndIndex { get; set; } + public int? EndIndex { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFilePathAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFilePathAnnotation.cs index d3a16a6a28e9..ccf74d5173f4 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFilePathAnnotation.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageTextFilePathAnnotation.cs @@ -32,8 +32,8 @@ internal MessageTextFilePathAnnotation() { } /// The first text index associated with this text annotation. - public int? StartIndex { get; set; } + public int? StartIndex { get; } /// The last text index associated with this text annotation. - public int? EndIndex { get; set; } + public int? EndIndex { get; } } } 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 aacd25be4a4d..9dd2b99e3a9f 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.Serialization.cs @@ -173,11 +173,11 @@ internal static ThreadMessage DeserializeThreadMessage(JsonElement element, Mode DateTimeOffset? completedAt = default; DateTimeOffset? incompleteAt = default; MessageRole role = default; - IList content = default; + IReadOnlyList content = default; string assistantId = default; string runId = default; - IList attachments = default; - IDictionary metadata = default; + IReadOnlyList attachments = default; + IReadOnlyDictionary metadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs index ad6ca6e3898e..e5adfbbe605a 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadMessage.cs @@ -65,7 +65,7 @@ public partial class ThreadMessage /// A list of files attached to the message, and the tools they were added to. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// , or is null. - public 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, IDictionary metadata) + 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) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -106,7 +106,7 @@ public ThreadMessage(string id, DateTimeOffset createdAt, string threadId, Messa /// 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, IList contentItems, string assistantId, string runId, IList attachments, IDictionary 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 assistantId, string runId, IReadOnlyList attachments, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -131,35 +131,35 @@ internal ThreadMessage() } /// The identifier, which can be referenced in API endpoints. - public string Id { get; set; } + public string Id { get; } /// The Unix timestamp, in seconds, representing when this object was created. - public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset CreatedAt { get; } /// The ID of the thread that this message belongs to. - public string ThreadId { get; set; } + public string ThreadId { get; } /// The status of the message. - public MessageStatus Status { get; set; } + public MessageStatus Status { get; } /// On an incomplete message, details about why the message is incomplete. - public MessageIncompleteDetails IncompleteDetails { get; set; } + public MessageIncompleteDetails IncompleteDetails { get; } /// The Unix timestamp (in seconds) for when the message was completed. - public DateTimeOffset? CompletedAt { get; set; } + public DateTimeOffset? CompletedAt { get; } /// The Unix timestamp (in seconds) for when the message was marked as incomplete. - public DateTimeOffset? IncompleteAt { get; set; } + public DateTimeOffset? IncompleteAt { get; } /// The role associated with the agent thread message. - public MessageRole Role { get; set; } + public MessageRole Role { get; } /// /// The list of content items associated with the agent thread message. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - public IList ContentItems { get; } + public IReadOnlyList ContentItems { get; } /// If applicable, the ID of the agent that authored this message. - public string AssistantId { get; set; } + public string AssistantId { get; } /// If applicable, the ID of the run associated with the authoring of this message. - public string RunId { get; set; } + public string RunId { get; } /// A list of files attached to the message, and the tools they were added to. - public IList Attachments { get; set; } + public IReadOnlyList Attachments { get; } /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. - public IDictionary Metadata { get; set; } + public IReadOnlyDictionary Metadata { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.cs index df17fb5ccff1..5752d96eef2f 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.cs @@ -50,7 +50,7 @@ public partial class VectorStoreDataSource /// Initializes a new instance of . /// Asset URI. - /// The asset type *. + /// The asset type. /// is null. public VectorStoreDataSource(string assetIdentifier, VectorStoreDataSourceAssetType assetType) { @@ -62,7 +62,7 @@ public VectorStoreDataSource(string assetIdentifier, VectorStoreDataSourceAssetT /// Initializes a new instance of . /// Asset URI. - /// The asset type *. + /// The asset type. /// Keeps track of any properties unknown to the library. internal VectorStoreDataSource(string assetIdentifier, VectorStoreDataSourceAssetType assetType, IDictionary serializedAdditionalRawData) { @@ -78,7 +78,7 @@ internal VectorStoreDataSource() /// Asset URI. public string AssetIdentifier { get; set; } - /// The asset type *. + /// The asset type. public VectorStoreDataSourceAssetType AssetType { get; set; } } } diff --git a/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Additional_messages.cs b/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Additional_messages.cs new file mode 100644 index 000000000000..e1032dc91c90 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/tests/Samples/Agent/Sample_Agent_Additional_messages.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.AI.Projects.Tests; +public partial class Sample_Agent_Multiple_Messages : SamplesBase +{ + [Test] + public async Task CreateAdditionalMessageExample() + { + var connectionString = TestEnvironment.AzureAICONNECTIONSTRING; + var clientOptions = new AIProjectClientOptions(); + + clientOptions.AddPolicy(new CustomHeadersPolicy(), HttpPipelinePosition.PerCall); + var projectClient = new AIProjectClient( + connectionString, + new DefaultAzureCredential(), + clientOptions); + var agentClient = projectClient.GetAgentsClient(); + + Response agentResponse = await agentClient.CreateAgentAsync( + model: "gpt-4-1106-preview", + name: "Math Tutor", + instructions: "You are a personal electronics tutor. Write and run code to answer questions.", + tools: [new CodeInterpreterToolDefinition()]); + Agent agent = agentResponse.Value; + + var threadResponse = await agentClient.CreateThreadAsync(); + var thread= threadResponse.Value; + Response messageResponse = await agentClient.CreateMessageAsync( + thread.Id, + MessageRole.User, + "What is the impedance formula?"); + ThreadMessage message = messageResponse.Value; + + var agentRun = await agentClient.CreateRunAsync( + threadId: thread.Id, + agent.Id, + additionalMessages: [ + new ThreadMessageOptions( + role: MessageRole.Agent, + content: "E=mc^2" + ), + new ThreadMessageOptions( + role: MessageRole.User, + content: "What is the impedance formula?" + ), + ] + ); + + do + { + await Task.Delay(TimeSpan.FromMilliseconds(500)); + agentRun = await agentClient.GetRunAsync(thread.Id, agentRun.Value.Id); + } + while (agentRun.Value.Status == RunStatus.Queued + || agentRun.Value.Status == RunStatus.InProgress); + + Response> afterRunMessagesResponse + = await agentClient.GetMessagesAsync(thread.Id); + IReadOnlyList messages = afterRunMessagesResponse.Value.Data; + + // Note: messages iterate from newest to oldest, with the messages[0] being the most recent + foreach (ThreadMessage threadMessage in messages) + { + Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: "); + foreach (MessageContent contentItem in threadMessage.ContentItems) + { + if (contentItem is MessageTextContent textItem) + { + Console.Write(textItem.Text); + } + else if (contentItem is MessageImageFileContent imageFileItem) + { + Console.Write($"