diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
index 546d614966d87..c31eb49ed837e 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
@@ -621,300 +621,5 @@ public static VectorStoreFileBatch VectorStoreFileBatch(string id = null, Vector
fileCounts,
serializedAdditionalRawData: null);
}
-
- /// Initializes a new instance of .
- /// The identifier of the message, which can be referenced in API endpoints.
- /// The object type, which is always `thread.message.delta`.
- /// The delta containing the fields that have changed on the Message.
- /// A new instance for mocking.
- public static MessageDeltaChunk MessageDeltaChunk(string id = null, MessageDeltaChunkObject @object = default, MessageDelta delta = null)
- {
- return new MessageDeltaChunk(id, @object, delta, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The entity that produced the message.
- ///
- /// The content of the message as an array of text and/or images.
- /// 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 new instance for mocking.
- public static MessageDelta MessageDelta(MessageRole role = default, IEnumerable content = null)
- {
- content ??= new List();
-
- return new MessageDelta(role, content?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The type of content for this content part.
- /// A new instance for mocking.
- public static MessageDeltaContent MessageDeltaContent(int index = default, string type = null)
- {
- return new UnknownMessageDeltaContent(index, type, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The image_file data.
- /// A new instance for mocking.
- public static MessageDeltaImageFileContent MessageDeltaImageFileContent(int index = default, MessageDeltaImageFileContentObject imageFile = null)
- {
- return new MessageDeltaImageFileContent(index, "image_file", serializedAdditionalRawData: null, imageFile);
- }
-
- /// Initializes a new instance of .
- /// The file ID of the image in the message content.
- /// A new instance for mocking.
- public static MessageDeltaImageFileContentObject MessageDeltaImageFileContentObject(string fileId = null)
- {
- return new MessageDeltaImageFileContentObject(fileId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The text content details.
- /// A new instance for mocking.
- public static MessageDeltaTextContent MessageDeltaTextContent(int index = default, MessageDeltaTextContentObject text = null)
- {
- return new MessageDeltaTextContent(index, "text", serializedAdditionalRawData: null, text);
- }
-
- /// Initializes a new instance of .
- /// The data that makes up the text.
- ///
- /// 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 .
- ///
- /// A new instance for mocking.
- public static MessageDeltaTextContentObject MessageDeltaTextContentObject(string value = null, IEnumerable annotations = null)
- {
- annotations ??= new List();
-
- return new MessageDeltaTextContentObject(value, annotations?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The type of the text content annotation.
- /// A new instance for mocking.
- public static MessageDeltaTextAnnotation MessageDeltaTextAnnotation(int index = default, string type = null)
- {
- return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The file citation information.
- /// The text in the message content that needs to be replaced.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- /// A new instance for mocking.
- public static MessageDeltaTextFileCitationAnnotation MessageDeltaTextFileCitationAnnotation(int index = default, MessageDeltaTextFileCitationAnnotationObject fileCitation = null, string text = null, int? startIndex = null, int? endIndex = null)
- {
- return new MessageDeltaTextFileCitationAnnotation(
- index,
- "file_citation",
- serializedAdditionalRawData: null,
- fileCitation,
- text,
- startIndex,
- endIndex);
- }
-
- /// Initializes a new instance of .
- /// The ID of the specific file the citation is from.
- /// The specific quote in the cited file.
- /// A new instance for mocking.
- public static MessageDeltaTextFileCitationAnnotationObject MessageDeltaTextFileCitationAnnotationObject(string fileId = null, string quote = null)
- {
- return new MessageDeltaTextFileCitationAnnotationObject(fileId, quote, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The file path information.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- /// The text in the message content that needs to be replaced.
- /// A new instance for mocking.
- public static MessageDeltaTextFilePathAnnotation MessageDeltaTextFilePathAnnotation(int index = default, MessageDeltaTextFilePathAnnotationObject filePath = null, int? startIndex = null, int? endIndex = null, string text = null)
- {
- return new MessageDeltaTextFilePathAnnotation(
- index,
- "file_path",
- serializedAdditionalRawData: null,
- filePath,
- startIndex,
- endIndex,
- text);
- }
-
- /// Initializes a new instance of .
- /// The file ID for the annotation.
- /// A new instance for mocking.
- public static MessageDeltaTextFilePathAnnotationObject MessageDeltaTextFilePathAnnotationObject(string fileId = null)
- {
- return new MessageDeltaTextFilePathAnnotationObject(fileId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The identifier of the run step, which can be referenced in API endpoints.
- /// The object type, which is always `thread.run.step.delta`.
- /// The delta containing the fields that have changed on the run step.
- /// A new instance for mocking.
- public static RunStepDeltaChunk RunStepDeltaChunk(string id = null, RunStepDeltaChunkObject @object = default, RunStepDelta delta = null)
- {
- return new RunStepDeltaChunk(id, @object, delta, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- ///
- /// The details of the run step.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static RunStepDelta RunStepDelta(RunStepDeltaDetail stepDetails = null)
- {
- return new RunStepDelta(stepDetails, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The message creation data.
- /// A new instance for mocking.
- public static RunStepDeltaMessageCreation RunStepDeltaMessageCreation(RunStepDeltaMessageCreationObject messageCreation = null)
- {
- return new RunStepDeltaMessageCreation("message_creation", serializedAdditionalRawData: null, messageCreation);
- }
-
- /// Initializes a new instance of .
- /// The ID of the newly-created message.
- /// A new instance for mocking.
- public static RunStepDeltaMessageCreationObject RunStepDeltaMessageCreationObject(string messageId = null)
- {
- return new RunStepDeltaMessageCreationObject(messageId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- ///
- /// The collection of tool calls for the tool call detail item.
- /// 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 new instance for mocking.
- public static RunStepDeltaToolCallObject RunStepDeltaToolCallObject(IEnumerable toolCalls = null)
- {
- toolCalls ??= new List();
-
- return new RunStepDeltaToolCallObject("tool_calls", serializedAdditionalRawData: null, toolCalls?.ToList());
- }
-
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The type of the tool call detail item in a streaming run step's details.
- /// A new instance for mocking.
- public static RunStepDeltaToolCall RunStepDeltaToolCall(int index = default, string id = null, string type = null)
- {
- return new UnknownRunStepDeltaToolCall(index, id, type, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The function data for the tool call.
- /// A new instance for mocking.
- public static RunStepDeltaFunctionToolCall RunStepDeltaFunctionToolCall(int index = default, string id = null, RunStepDeltaFunction function = null)
- {
- return new RunStepDeltaFunctionToolCall(index, id, "function", serializedAdditionalRawData: null, function);
- }
-
- /// Initializes a new instance of .
- /// The name of the function.
- /// The arguments passed to the function as input.
- /// The output of the function, null if outputs have not yet been submitted.
- /// A new instance for mocking.
- public static RunStepDeltaFunction RunStepDeltaFunction(string name = null, string arguments = null, string output = null)
- {
- return new RunStepDeltaFunction(name, arguments, output, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepDeltaFileSearchToolCall RunStepDeltaFileSearchToolCall(int index = default, string id = null, IReadOnlyDictionary fileSearch = null)
- {
- fileSearch ??= new Dictionary();
-
- return new RunStepDeltaFileSearchToolCall(index, id, "file_search", serializedAdditionalRawData: null, fileSearch);
- }
-
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The Code Interpreter data for the tool call.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterToolCall RunStepDeltaCodeInterpreterToolCall(int index = default, string id = null, RunStepDeltaCodeInterpreterDetailItemObject codeInterpreter = null)
- {
- return new RunStepDeltaCodeInterpreterToolCall(index, id, "code_interpreter", serializedAdditionalRawData: null, codeInterpreter);
- }
-
- /// Initializes a new instance of .
- /// The input into the Code Interpreter tool call.
- ///
- /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more
- /// items, including text (`logs`) or images (`image`). Each of these are represented by a
- /// different object type.
- /// 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 new instance for mocking.
- public static RunStepDeltaCodeInterpreterDetailItemObject RunStepDeltaCodeInterpreterDetailItemObject(string input = null, IEnumerable outputs = null)
- {
- outputs ??= new List();
-
- return new RunStepDeltaCodeInterpreterDetailItemObject(input, outputs?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The type of the streaming run step tool call's Code Interpreter output.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterOutput RunStepDeltaCodeInterpreterOutput(int index = default, string type = null)
- {
- return new UnknownRunStepDeltaCodeInterpreterOutput(index, type, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The text output from the Code Interpreter tool call.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterLogOutput RunStepDeltaCodeInterpreterLogOutput(int index = default, string logs = null)
- {
- return new RunStepDeltaCodeInterpreterLogOutput(index, "logs", serializedAdditionalRawData: null, logs);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The image data for the Code Interpreter tool call output.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterImageOutput RunStepDeltaCodeInterpreterImageOutput(int index = default, RunStepDeltaCodeInterpreterImageOutputObject image = null)
- {
- return new RunStepDeltaCodeInterpreterImageOutput(index, "image", serializedAdditionalRawData: null, image);
- }
-
- /// Initializes a new instance of .
- /// The file ID for the image.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterImageOutputObject RunStepDeltaCodeInterpreterImageOutputObject(string fileId = null)
- {
- return new RunStepDeltaCodeInterpreterImageOutputObject(fileId, serializedAdditionalRawData: null);
- }
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs
deleted file mode 100644
index 97c4efa2a29ed..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- ///
- /// Each event in a server-sent events stream has an `event` and `data` property:
- ///
- /// ```
- /// event: thread.created
- /// data: {"id": "thread_123", "object": "thread", ...}
- /// ```
- ///
- /// We emit events whenever a new object is created, transitions to a new state, or is being
- /// streamed in parts (deltas). For example, we emit `thread.run.created` when a new run
- /// is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses
- /// to create a message during a run, we emit a `thread.message.created event`, a
- /// `thread.message.in_progress` event, many `thread.message.delta` events, and finally a
- /// `thread.message.completed` event.
- ///
- /// We may add additional events over time, so we recommend handling unknown events gracefully
- /// in your code.
- ///
- public readonly partial struct AgentStreamEvent : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public AgentStreamEvent(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string ThreadCreatedValue = "thread.created";
- private const string ThreadRunCreatedValue = "thread.run.created";
- private const string ThreadRunQueuedValue = "thread.run.queued";
- private const string ThreadRunInProgressValue = "thread.run.in_progress";
- private const string ThreadRunRequiresActionValue = "thread.run.requires_action";
- private const string ThreadRunCompletedValue = "thread.run.completed";
- private const string ThreadRunIncompleteValue = "thread.run.incomplete";
- private const string ThreadRunFailedValue = "thread.run.failed";
- private const string ThreadRunCancellingValue = "thread.run.cancelling";
- private const string ThreadRunCancelledValue = "thread.run.cancelled";
- private const string ThreadRunExpiredValue = "thread.run.expired";
- private const string ThreadRunStepCreatedValue = "thread.run.step.created";
- private const string ThreadRunStepInProgressValue = "thread.run.step.in_progress";
- private const string ThreadRunStepDeltaValue = "thread.run.step.delta";
- private const string ThreadRunStepCompletedValue = "thread.run.step.completed";
- private const string ThreadRunStepFailedValue = "thread.run.step.failed";
- private const string ThreadRunStepCancelledValue = "thread.run.step.cancelled";
- private const string ThreadRunStepExpiredValue = "thread.run.step.expired";
- private const string ThreadMessageCreatedValue = "thread.message.created";
- private const string ThreadMessageInProgressValue = "thread.message.in_progress";
- private const string ThreadMessageDeltaValue = "thread.message.delta";
- private const string ThreadMessageCompletedValue = "thread.message.completed";
- private const string ThreadMessageIncompleteValue = "thread.message.incomplete";
- private const string ErrorValue = "error";
- private const string DoneValue = "done";
-
- /// Event sent when a new thread is created. The data of this event is of type AgentThread.
- public static AgentStreamEvent ThreadCreated { get; } = new AgentStreamEvent(ThreadCreatedValue);
- /// Event sent when a new run is created. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunCreated { get; } = new AgentStreamEvent(ThreadRunCreatedValue);
- /// Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunQueued { get; } = new AgentStreamEvent(ThreadRunQueuedValue);
- /// Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunInProgress { get; } = new AgentStreamEvent(ThreadRunInProgressValue);
- /// Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunRequiresAction { get; } = new AgentStreamEvent(ThreadRunRequiresActionValue);
- /// Event sent when a run is completed. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunCompleted { get; } = new AgentStreamEvent(ThreadRunCompletedValue);
- /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunIncomplete { get; } = new AgentStreamEvent(ThreadRunIncompleteValue);
- /// Event sent when a run fails. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunFailed { get; } = new AgentStreamEvent(ThreadRunFailedValue);
- /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunCancelling { get; } = new AgentStreamEvent(ThreadRunCancellingValue);
- /// Event sent when a run is cancelled. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunCancelled { get; } = new AgentStreamEvent(ThreadRunCancelledValue);
- /// Event sent when a run is expired. The data of this event is of type ThreadRun.
- public static AgentStreamEvent ThreadRunExpired { get; } = new AgentStreamEvent(ThreadRunExpiredValue);
- /// Event sent when a new thread run step is created. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepCreated { get; } = new AgentStreamEvent(ThreadRunStepCreatedValue);
- /// Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepInProgress { get; } = new AgentStreamEvent(ThreadRunStepInProgressValue);
- /// Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk.
- public static AgentStreamEvent ThreadRunStepDelta { get; } = new AgentStreamEvent(ThreadRunStepDeltaValue);
- /// Event sent when a run step is completed. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepCompleted { get; } = new AgentStreamEvent(ThreadRunStepCompletedValue);
- /// Event sent when a run step fails. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepFailed { get; } = new AgentStreamEvent(ThreadRunStepFailedValue);
- /// Event sent when a run step is cancelled. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepCancelled { get; } = new AgentStreamEvent(ThreadRunStepCancelledValue);
- /// Event sent when a run step is expired. The data of this event is of type RunStep.
- public static AgentStreamEvent ThreadRunStepExpired { get; } = new AgentStreamEvent(ThreadRunStepExpiredValue);
- /// Event sent when a new message is created. The data of this event is of type ThreadMessage.
- public static AgentStreamEvent ThreadMessageCreated { get; } = new AgentStreamEvent(ThreadMessageCreatedValue);
- /// Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage.
- public static AgentStreamEvent ThreadMessageInProgress { get; } = new AgentStreamEvent(ThreadMessageInProgressValue);
- /// Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk.
- public static AgentStreamEvent ThreadMessageDelta { get; } = new AgentStreamEvent(ThreadMessageDeltaValue);
- /// Event sent when a message is completed. The data of this event is of type ThreadMessage.
- public static AgentStreamEvent ThreadMessageCompleted { get; } = new AgentStreamEvent(ThreadMessageCompletedValue);
- /// Event sent before a message is completed. The data of this event is of type ThreadMessage.
- public static AgentStreamEvent ThreadMessageIncomplete { get; } = new AgentStreamEvent(ThreadMessageIncompleteValue);
- /// Event sent when an error occurs, such as an internal server error or a timeout.
- public static AgentStreamEvent Error { get; } = new AgentStreamEvent(ErrorValue);
- /// Event sent when the stream is done.
- public static AgentStreamEvent Done { get; } = new AgentStreamEvent(DoneValue);
- /// Determines if two values are the same.
- public static bool operator ==(AgentStreamEvent left, AgentStreamEvent right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(AgentStreamEvent left, AgentStreamEvent right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator AgentStreamEvent(string value) => new AgentStreamEvent(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is AgentStreamEvent other && Equals(other);
- ///
- public bool Equals(AgentStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs
deleted file mode 100644
index 9f658de4258c7..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- /// Terminal event indicating the successful end of a stream.
- public readonly partial struct DoneEvent : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public DoneEvent(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string DoneValue = "done";
-
- /// Event sent when the stream is done.
- public static DoneEvent Done { get; } = new DoneEvent(DoneValue);
- /// Determines if two values are the same.
- public static bool operator ==(DoneEvent left, DoneEvent right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(DoneEvent left, DoneEvent right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator DoneEvent(string value) => new DoneEvent(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is DoneEvent other && Equals(other);
- ///
- public bool Equals(DoneEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs
deleted file mode 100644
index ea570033f684a..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- /// Terminal event indicating a server side error while streaming.
- public readonly partial struct ErrorEvent : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public ErrorEvent(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string ErrorValue = "error";
-
- /// Event sent when an error occurs, such as an internal server error or a timeout.
- public static ErrorEvent Error { get; } = new ErrorEvent(ErrorValue);
- /// Determines if two values are the same.
- public static bool operator ==(ErrorEvent left, ErrorEvent right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(ErrorEvent left, ErrorEvent right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator ErrorEvent(string value) => new ErrorEvent(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is ErrorEvent other && Equals(other);
- ///
- public bool Equals(ErrorEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs
deleted file mode 100644
index 2131a64f0c1c6..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDelta : 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(MessageDelta)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("role"u8);
- writer.WriteStringValue(Role.ToString());
- writer.WritePropertyName("content"u8);
- writer.WriteStartArray();
- foreach (var item in Content)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDelta 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(MessageDelta)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDelta(document.RootElement, options);
- }
-
- internal static MessageDelta DeserializeMessageDelta(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- MessageRole role = default;
- IReadOnlyList content = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("role"u8))
- {
- role = new MessageRole(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("content"u8))
- {
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
- {
- array.Add(MessageDeltaContent.DeserializeMessageDeltaContent(item, options));
- }
- content = array;
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDelta(role, content, 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(MessageDelta)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDelta IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDelta(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDelta)} 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 MessageDelta FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDelta(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/MessageDelta.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs
deleted file mode 100644
index 764571c6aa112..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Azure.AI.Projects
-{
- /// Represents the typed 'delta' payload within a streaming message delta chunk.
- public partial class MessageDelta
- {
- ///
- /// 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 entity that produced the message.
- ///
- /// The content of the message as an array of text and/or images.
- /// 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 .
- ///
- /// is null.
- internal MessageDelta(MessageRole role, IEnumerable content)
- {
- Argument.AssertNotNull(content, nameof(content));
-
- Role = role;
- Content = content.ToList();
- }
-
- /// Initializes a new instance of .
- /// The entity that produced the message.
- ///
- /// The content of the message as an array of text and/or images.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// Keeps track of any properties unknown to the library.
- internal MessageDelta(MessageRole role, IReadOnlyList content, IDictionary serializedAdditionalRawData)
- {
- Role = role;
- Content = content;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDelta()
- {
- }
-
- /// The entity that produced the message.
- public MessageRole Role { get; }
- ///
- /// The content of the message as an array of text and/or images.
- /// 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 IReadOnlyList Content { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs
deleted file mode 100644
index b672132912cc3..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaChunk : 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(MessageDeltaChunk)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("id"u8);
- writer.WriteStringValue(Id);
- writer.WritePropertyName("object"u8);
- writer.WriteStringValue(Object.ToString());
- writer.WritePropertyName("delta"u8);
- writer.WriteObjectValue(Delta, options);
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaChunk 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(MessageDeltaChunk)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaChunk(document.RootElement, options);
- }
-
- internal static MessageDeltaChunk DeserializeMessageDeltaChunk(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string id = default;
- MessageDeltaChunkObject @object = default;
- MessageDelta delta = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("id"u8))
- {
- id = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("object"u8))
- {
- @object = new MessageDeltaChunkObject(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("delta"u8))
- {
- delta = MessageDelta.DeserializeMessageDelta(property.Value, options);
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaChunk(id, @object, delta, 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(MessageDeltaChunk)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaChunk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaChunk(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaChunk)} 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 MessageDeltaChunk FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaChunk(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/MessageDeltaChunk.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs
deleted file mode 100644
index cf40d797394f5..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a message delta i.e. any changed fields on a message during streaming.
- public partial class MessageDeltaChunk
- {
- ///
- /// 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 identifier of the message, which can be referenced in API endpoints.
- /// The delta containing the fields that have changed on the Message.
- /// or is null.
- internal MessageDeltaChunk(string id, MessageDelta delta)
- {
- Argument.AssertNotNull(id, nameof(id));
- Argument.AssertNotNull(delta, nameof(delta));
-
- Id = id;
- Delta = delta;
- }
-
- /// Initializes a new instance of .
- /// The identifier of the message, which can be referenced in API endpoints.
- /// The object type, which is always `thread.message.delta`.
- /// The delta containing the fields that have changed on the Message.
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaChunk(string id, MessageDeltaChunkObject @object, MessageDelta delta, IDictionary serializedAdditionalRawData)
- {
- Id = id;
- Object = @object;
- Delta = delta;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaChunk()
- {
- }
-
- /// The identifier of the message, which can be referenced in API endpoints.
- public string Id { get; }
- /// The object type, which is always `thread.message.delta`.
- public MessageDeltaChunkObject Object { get; } = MessageDeltaChunkObject.ThreadMessageDelta;
-
- /// The delta containing the fields that have changed on the Message.
- public MessageDelta Delta { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs
deleted file mode 100644
index d21c2b7731b40..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- /// The MessageDeltaChunk_object.
- public readonly partial struct MessageDeltaChunkObject : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public MessageDeltaChunkObject(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string ThreadMessageDeltaValue = "thread.message.delta";
-
- /// thread.message.delta.
- public static MessageDeltaChunkObject ThreadMessageDelta { get; } = new MessageDeltaChunkObject(ThreadMessageDeltaValue);
- /// Determines if two values are the same.
- public static bool operator ==(MessageDeltaChunkObject left, MessageDeltaChunkObject right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(MessageDeltaChunkObject left, MessageDeltaChunkObject right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator MessageDeltaChunkObject(string value) => new MessageDeltaChunkObject(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is MessageDeltaChunkObject other && Equals(other);
- ///
- public bool Equals(MessageDeltaChunkObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs
deleted file mode 100644
index 86bc3e76c4a9d..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// 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(UnknownMessageDeltaContent))]
- public partial class MessageDeltaContent : 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(MessageDeltaContent)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("index"u8);
- writer.WriteNumberValue(Index);
- 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))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaContent 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(MessageDeltaContent)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaContent(document.RootElement, options);
- }
-
- internal static MessageDeltaContent DeserializeMessageDeltaContent(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 "image_file": return MessageDeltaImageFileContent.DeserializeMessageDeltaImageFileContent(element, options);
- case "text": return MessageDeltaTextContent.DeserializeMessageDeltaTextContent(element, options);
- }
- }
- return UnknownMessageDeltaContent.DeserializeUnknownMessageDeltaContent(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(MessageDeltaContent)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaContent(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaContent)} 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 MessageDeltaContent FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaContent(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/MessageDeltaContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs
deleted file mode 100644
index 367980dcb8a0e..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- ///
- /// The abstract base representation of a partial streamed message content payload.
- /// 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 MessageDeltaContent
- {
- ///
- /// 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 .
- /// The index of the content part of the message.
- protected MessageDeltaContent(int index)
- {
- Index = index;
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The type of content for this content part.
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaContent(int index, string type, IDictionary serializedAdditionalRawData)
- {
- Index = index;
- Type = type;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaContent()
- {
- }
-
- /// The index of the content part of the message.
- public int Index { get; }
- /// The type of content for this content part.
- internal string Type { get; set; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs
deleted file mode 100644
index 80ef6edf733c4..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaImageFileContent : 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(MessageDeltaImageFileContent)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(ImageFile))
- {
- writer.WritePropertyName("image_file"u8);
- writer.WriteObjectValue(ImageFile, options);
- }
- }
-
- MessageDeltaImageFileContent 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(MessageDeltaImageFileContent)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaImageFileContent(document.RootElement, options);
- }
-
- internal static MessageDeltaImageFileContent DeserializeMessageDeltaImageFileContent(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- MessageDeltaImageFileContentObject imageFile = default;
- int index = default;
- string type = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("image_file"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- imageFile = MessageDeltaImageFileContentObject.DeserializeMessageDeltaImageFileContentObject(property.Value, options);
- 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 MessageDeltaImageFileContent(index, type, serializedAdditionalRawData, imageFile);
- }
-
- 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(MessageDeltaImageFileContent)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaImageFileContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaImageFileContent(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaImageFileContent)} 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 MessageDeltaImageFileContent FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaImageFileContent(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/MessageDeltaImageFileContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs
deleted file mode 100644
index 782ee27b4b558..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a streamed image file content part within a streaming message delta chunk.
- public partial class MessageDeltaImageFileContent : MessageDeltaContent
- {
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- internal MessageDeltaImageFileContent(int index) : base(index)
- {
- Type = "image_file";
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The type of content for this content part.
- /// Keeps track of any properties unknown to the library.
- /// The image_file data.
- internal MessageDeltaImageFileContent(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaImageFileContentObject imageFile) : base(index, type, serializedAdditionalRawData)
- {
- ImageFile = imageFile;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaImageFileContent()
- {
- }
-
- /// The image_file data.
- public MessageDeltaImageFileContentObject ImageFile { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs
deleted file mode 100644
index 0772f9b9743f9..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaImageFileContentObject : 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(MessageDeltaImageFileContentObject)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(FileId))
- {
- writer.WritePropertyName("file_id"u8);
- writer.WriteStringValue(FileId);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaImageFileContentObject 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(MessageDeltaImageFileContentObject)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaImageFileContentObject(document.RootElement, options);
- }
-
- internal static MessageDeltaImageFileContentObject DeserializeMessageDeltaImageFileContentObject(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string fileId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("file_id"u8))
- {
- fileId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaImageFileContentObject(fileId, 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(MessageDeltaImageFileContentObject)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaImageFileContentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaImageFileContentObject(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaImageFileContentObject)} 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 MessageDeltaImageFileContentObject FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaImageFileContentObject(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/MessageDeltaImageFileContentObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs
deleted file mode 100644
index e62ccc339207e..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents the 'image_file' payload within streaming image file content.
- public partial class MessageDeltaImageFileContentObject
- {
- ///
- /// 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 .
- internal MessageDeltaImageFileContentObject()
- {
- }
-
- /// Initializes a new instance of .
- /// The file ID of the image in the message content.
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaImageFileContentObject(string fileId, IDictionary serializedAdditionalRawData)
- {
- FileId = fileId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// The file ID of the image in the message content.
- public string FileId { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs
deleted file mode 100644
index 3b315583ceb77..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// 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(UnknownMessageDeltaTextAnnotation))]
- public partial class MessageDeltaTextAnnotation : 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(MessageDeltaTextAnnotation)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("index"u8);
- writer.WriteNumberValue(Index);
- 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))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaTextAnnotation 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(MessageDeltaTextAnnotation)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextAnnotation(document.RootElement, options);
- }
-
- internal static MessageDeltaTextAnnotation DeserializeMessageDeltaTextAnnotation(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 "file_citation": return MessageDeltaTextFileCitationAnnotation.DeserializeMessageDeltaTextFileCitationAnnotation(element, options);
- case "file_path": return MessageDeltaTextFilePathAnnotation.DeserializeMessageDeltaTextFilePathAnnotation(element, options);
- }
- }
- return UnknownMessageDeltaTextAnnotation.DeserializeUnknownMessageDeltaTextAnnotation(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(MessageDeltaTextAnnotation)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextAnnotation(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} 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 MessageDeltaTextAnnotation FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextAnnotation(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/MessageDeltaTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs
deleted file mode 100644
index a283e7754283d..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.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 .
- ///
- public abstract partial class MessageDeltaTextAnnotation
- {
- ///
- /// 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 .
- /// The index of the annotation within a text content part.
- protected MessageDeltaTextAnnotation(int index)
- {
- Index = index;
- }
-
- /// 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.
- internal MessageDeltaTextAnnotation(int index, string type, IDictionary serializedAdditionalRawData)
- {
- Index = index;
- Type = type;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaTextAnnotation()
- {
- }
-
- /// The index of the annotation within a text content part.
- public int Index { get; }
- /// The type of the text content annotation.
- internal string Type { get; set; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs
deleted file mode 100644
index f3dbe17210d1b..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextContent : 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(MessageDeltaTextContent)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(Text))
- {
- writer.WritePropertyName("text"u8);
- writer.WriteObjectValue(Text, options);
- }
- }
-
- MessageDeltaTextContent 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(MessageDeltaTextContent)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextContent(document.RootElement, options);
- }
-
- internal static MessageDeltaTextContent DeserializeMessageDeltaTextContent(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- MessageDeltaTextContentObject text = default;
- int index = default;
- string type = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("text"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- text = MessageDeltaTextContentObject.DeserializeMessageDeltaTextContentObject(property.Value, options);
- 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 MessageDeltaTextContent(index, type, serializedAdditionalRawData, text);
- }
-
- 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(MessageDeltaTextContent)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextContent(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextContent)} 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 MessageDeltaTextContent FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextContent(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/MessageDeltaTextContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs
deleted file mode 100644
index af3ed70f6d9c5..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a streamed text content part within a streaming message delta chunk.
- public partial class MessageDeltaTextContent : MessageDeltaContent
- {
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- internal MessageDeltaTextContent(int index) : base(index)
- {
- Type = "text";
- }
-
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The type of content for this content part.
- /// Keeps track of any properties unknown to the library.
- /// The text content details.
- internal MessageDeltaTextContent(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextContentObject text) : base(index, type, serializedAdditionalRawData)
- {
- Text = text;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaTextContent()
- {
- }
-
- /// The text content details.
- public MessageDeltaTextContentObject Text { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs
deleted file mode 100644
index 4604c724436c0..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextContentObject : 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(MessageDeltaTextContentObject)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(Value))
- {
- writer.WritePropertyName("value"u8);
- writer.WriteStringValue(Value);
- }
- if (Optional.IsCollectionDefined(Annotations))
- {
- writer.WritePropertyName("annotations"u8);
- writer.WriteStartArray();
- foreach (var item in Annotations)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaTextContentObject 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(MessageDeltaTextContentObject)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextContentObject(document.RootElement, options);
- }
-
- internal static MessageDeltaTextContentObject DeserializeMessageDeltaTextContentObject(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string value = default;
- IReadOnlyList annotations = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("value"u8))
- {
- value = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("annotations"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
- {
- array.Add(MessageDeltaTextAnnotation.DeserializeMessageDeltaTextAnnotation(item, options));
- }
- annotations = array;
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaTextContentObject(value, annotations ?? new ChangeTrackingList(), serializedAdditionalRawData);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextContentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextContentObject(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} 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 MessageDeltaTextContentObject FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextContentObject(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/MessageDeltaTextContentObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs
deleted file mode 100644
index c7965b213a24f..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents the data of a streamed text content part within a streaming message delta chunk.
- public partial class MessageDeltaTextContentObject
- {
- ///
- /// 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 .
- internal MessageDeltaTextContentObject()
- {
- Annotations = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The data that makes up the text.
- ///
- /// 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 .
- ///
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaTextContentObject(string value, IReadOnlyList annotations, IDictionary serializedAdditionalRawData)
- {
- Value = value;
- Annotations = annotations;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// The data that makes up the text.
- public string Value { get; }
- ///
- /// 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 .
- ///
- public IReadOnlyList Annotations { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs
deleted file mode 100644
index d7a6b18301d14..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextFileCitationAnnotation : 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(MessageDeltaTextFileCitationAnnotation)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(FileCitation))
- {
- writer.WritePropertyName("file_citation"u8);
- writer.WriteObjectValue(FileCitation, options);
- }
- if (Optional.IsDefined(Text))
- {
- writer.WritePropertyName("text"u8);
- writer.WriteStringValue(Text);
- }
- 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);
- }
- }
-
- MessageDeltaTextFileCitationAnnotation 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(MessageDeltaTextFileCitationAnnotation)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextFileCitationAnnotation(document.RootElement, options);
- }
-
- internal static MessageDeltaTextFileCitationAnnotation DeserializeMessageDeltaTextFileCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- MessageDeltaTextFileCitationAnnotationObject fileCitation = default;
- string text = 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("file_citation"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- fileCitation = MessageDeltaTextFileCitationAnnotationObject.DeserializeMessageDeltaTextFileCitationAnnotationObject(property.Value, options);
- continue;
- }
- if (property.NameEquals("text"u8))
- {
- text = property.Value.GetString();
- 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 MessageDeltaTextFileCitationAnnotation(
- index,
- type,
- serializedAdditionalRawData,
- fileCitation,
- text,
- 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(MessageDeltaTextFileCitationAnnotation)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextFileCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextFileCitationAnnotation(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotation)} 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 MessageDeltaTextFileCitationAnnotation FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextFileCitationAnnotation(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/MessageDeltaTextFileCitationAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs
deleted file mode 100644
index f22164e3a330b..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a streamed file citation applied to a streaming text content part.
- public partial class MessageDeltaTextFileCitationAnnotation : MessageDeltaTextAnnotation
- {
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- internal MessageDeltaTextFileCitationAnnotation(int index) : base(index)
- {
- Type = "file_citation";
- }
-
- /// 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 file citation information.
- /// The text in the message content that needs to be replaced.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- internal MessageDeltaTextFileCitationAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextFileCitationAnnotationObject fileCitation, string text, int? startIndex, int? endIndex) : base(index, type, serializedAdditionalRawData)
- {
- FileCitation = fileCitation;
- Text = text;
- StartIndex = startIndex;
- EndIndex = endIndex;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaTextFileCitationAnnotation()
- {
- }
-
- /// The file citation information.
- public MessageDeltaTextFileCitationAnnotationObject FileCitation { get; }
- /// The text in the message content that needs to be replaced.
- public string Text { get; }
- /// The start index of this annotation in the content text.
- public int? StartIndex { get; }
- /// The end index of this annotation in the content text.
- public int? EndIndex { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs
deleted file mode 100644
index a82c41d59813a..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextFileCitationAnnotationObject : 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(MessageDeltaTextFileCitationAnnotationObject)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(FileId))
- {
- writer.WritePropertyName("file_id"u8);
- writer.WriteStringValue(FileId);
- }
- if (Optional.IsDefined(Quote))
- {
- writer.WritePropertyName("quote"u8);
- writer.WriteStringValue(Quote);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaTextFileCitationAnnotationObject 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(MessageDeltaTextFileCitationAnnotationObject)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextFileCitationAnnotationObject(document.RootElement, options);
- }
-
- internal static MessageDeltaTextFileCitationAnnotationObject DeserializeMessageDeltaTextFileCitationAnnotationObject(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string fileId = default;
- string quote = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("file_id"u8))
- {
- fileId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("quote"u8))
- {
- quote = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaTextFileCitationAnnotationObject(fileId, quote, 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(MessageDeltaTextFileCitationAnnotationObject)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextFileCitationAnnotationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextFileCitationAnnotationObject(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotationObject)} 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 MessageDeltaTextFileCitationAnnotationObject FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextFileCitationAnnotationObject(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/MessageDeltaTextFileCitationAnnotationObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs
deleted file mode 100644
index ef326afe631bc..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents the data of a streamed file citation as applied to a streaming text content part.
- public partial class MessageDeltaTextFileCitationAnnotationObject
- {
- ///
- /// 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 .
- internal MessageDeltaTextFileCitationAnnotationObject()
- {
- }
-
- /// Initializes a new instance of .
- /// The ID of the specific file the citation is from.
- /// The specific quote in the cited file.
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaTextFileCitationAnnotationObject(string fileId, string quote, IDictionary serializedAdditionalRawData)
- {
- FileId = fileId;
- Quote = quote;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// The ID of the specific file the citation is from.
- public string FileId { get; }
- /// The specific quote in the cited file.
- public string Quote { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs
deleted file mode 100644
index c6258fb194864..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextFilePathAnnotation : 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(MessageDeltaTextFilePathAnnotation)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(FilePath))
- {
- writer.WritePropertyName("file_path"u8);
- writer.WriteObjectValue(FilePath, 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);
- }
- if (Optional.IsDefined(Text))
- {
- writer.WritePropertyName("text"u8);
- writer.WriteStringValue(Text);
- }
- }
-
- MessageDeltaTextFilePathAnnotation 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(MessageDeltaTextFilePathAnnotation)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextFilePathAnnotation(document.RootElement, options);
- }
-
- internal static MessageDeltaTextFilePathAnnotation DeserializeMessageDeltaTextFilePathAnnotation(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- MessageDeltaTextFilePathAnnotationObject filePath = default;
- int? startIndex = default;
- int? endIndex = default;
- string text = default;
- int index = default;
- string type = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("file_path"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- filePath = MessageDeltaTextFilePathAnnotationObject.DeserializeMessageDeltaTextFilePathAnnotationObject(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("text"u8))
- {
- text = property.Value.GetString();
- 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 MessageDeltaTextFilePathAnnotation(
- index,
- type,
- serializedAdditionalRawData,
- filePath,
- startIndex,
- endIndex,
- text);
- }
-
- 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(MessageDeltaTextFilePathAnnotation)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextFilePathAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextFilePathAnnotation(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotation)} 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 MessageDeltaTextFilePathAnnotation FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextFilePathAnnotation(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/MessageDeltaTextFilePathAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs
deleted file mode 100644
index 90bf54d5059b2..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a streamed file path annotation applied to a streaming text content part.
- public partial class MessageDeltaTextFilePathAnnotation : MessageDeltaTextAnnotation
- {
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- internal MessageDeltaTextFilePathAnnotation(int index) : base(index)
- {
- Type = "file_path";
- }
-
- /// 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 file path information.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- /// The text in the message content that needs to be replaced.
- internal MessageDeltaTextFilePathAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextFilePathAnnotationObject filePath, int? startIndex, int? endIndex, string text) : base(index, type, serializedAdditionalRawData)
- {
- FilePath = filePath;
- StartIndex = startIndex;
- EndIndex = endIndex;
- Text = text;
- }
-
- /// Initializes a new instance of for deserialization.
- internal MessageDeltaTextFilePathAnnotation()
- {
- }
-
- /// The file path information.
- public MessageDeltaTextFilePathAnnotationObject FilePath { get; }
- /// The start index of this annotation in the content text.
- public int? StartIndex { get; }
- /// The end index of this annotation in the content text.
- public int? EndIndex { get; }
- /// The text in the message content that needs to be replaced.
- public string Text { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs
deleted file mode 100644
index 76ebcc5ed6237..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class MessageDeltaTextFilePathAnnotationObject : 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(MessageDeltaTextFilePathAnnotationObject)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(FileId))
- {
- writer.WritePropertyName("file_id"u8);
- writer.WriteStringValue(FileId);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- MessageDeltaTextFilePathAnnotationObject 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(MessageDeltaTextFilePathAnnotationObject)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextFilePathAnnotationObject(document.RootElement, options);
- }
-
- internal static MessageDeltaTextFilePathAnnotationObject DeserializeMessageDeltaTextFilePathAnnotationObject(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string fileId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("file_id"u8))
- {
- fileId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaTextFilePathAnnotationObject(fileId, 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(MessageDeltaTextFilePathAnnotationObject)} does not support writing '{options.Format}' format.");
- }
- }
-
- MessageDeltaTextFilePathAnnotationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeMessageDeltaTextFilePathAnnotationObject(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotationObject)} 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 MessageDeltaTextFilePathAnnotationObject FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeMessageDeltaTextFilePathAnnotationObject(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/MessageDeltaTextFilePathAnnotationObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs
deleted file mode 100644
index 0bc0e8a005175..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents the data of a streamed file path annotation as applied to a streaming text content part.
- public partial class MessageDeltaTextFilePathAnnotationObject
- {
- ///
- /// 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 .
- internal MessageDeltaTextFilePathAnnotationObject()
- {
- }
-
- /// Initializes a new instance of .
- /// The file ID for the annotation.
- /// Keeps track of any properties unknown to the library.
- internal MessageDeltaTextFilePathAnnotationObject(string fileId, IDictionary serializedAdditionalRawData)
- {
- FileId = fileId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// The file ID for the annotation.
- public string FileId { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs
deleted file mode 100644
index 333c12b43a3f3..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- /// Message operation related streaming events.
- public readonly partial struct MessageStreamEvent : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public MessageStreamEvent(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string ThreadMessageCreatedValue = "thread.message.created";
- private const string ThreadMessageInProgressValue = "thread.message.in_progress";
- private const string ThreadMessageDeltaValue = "thread.message.delta";
- private const string ThreadMessageCompletedValue = "thread.message.completed";
- private const string ThreadMessageIncompleteValue = "thread.message.incomplete";
-
- /// Event sent when a new message is created. The data of this event is of type ThreadMessage.
- public static MessageStreamEvent ThreadMessageCreated { get; } = new MessageStreamEvent(ThreadMessageCreatedValue);
- /// Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage.
- public static MessageStreamEvent ThreadMessageInProgress { get; } = new MessageStreamEvent(ThreadMessageInProgressValue);
- /// Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk.
- public static MessageStreamEvent ThreadMessageDelta { get; } = new MessageStreamEvent(ThreadMessageDeltaValue);
- /// Event sent when a message is completed. The data of this event is of type ThreadMessage.
- public static MessageStreamEvent ThreadMessageCompleted { get; } = new MessageStreamEvent(ThreadMessageCompletedValue);
- /// Event sent before a message is completed. The data of this event is of type ThreadMessage.
- public static MessageStreamEvent ThreadMessageIncomplete { get; } = new MessageStreamEvent(ThreadMessageIncompleteValue);
- /// Determines if two values are the same.
- public static bool operator ==(MessageStreamEvent left, MessageStreamEvent right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(MessageStreamEvent left, MessageStreamEvent right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator MessageStreamEvent(string value) => new MessageStreamEvent(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is MessageStreamEvent other && Equals(other);
- ///
- public bool Equals(MessageStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs
deleted file mode 100644
index 41df1f3c90b75..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class RunStepDelta : 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(RunStepDelta)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(StepDetails))
- {
- writer.WritePropertyName("step_details"u8);
- writer.WriteObjectValue(StepDetails, options);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- RunStepDelta 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(RunStepDelta)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeRunStepDelta(document.RootElement, options);
- }
-
- internal static RunStepDelta DeserializeRunStepDelta(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- RunStepDeltaDetail stepDetails = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("step_details"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- stepDetails = RunStepDeltaDetail.DeserializeRunStepDeltaDetail(property.Value, options);
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new RunStepDelta(stepDetails, 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(RunStepDelta)} does not support writing '{options.Format}' format.");
- }
- }
-
- RunStepDelta IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeRunStepDelta(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(RunStepDelta)} 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 RunStepDelta FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeRunStepDelta(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/RunStepDelta.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs
deleted file mode 100644
index 0f601698841df..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents the delta payload in a streaming run step delta chunk.
- public partial class RunStepDelta
- {
- ///
- /// 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 .
- internal RunStepDelta()
- {
- }
-
- /// Initializes a new instance of .
- ///
- /// The details of the run step.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// Keeps track of any properties unknown to the library.
- internal RunStepDelta(RunStepDeltaDetail stepDetails, IDictionary serializedAdditionalRawData)
- {
- StepDetails = stepDetails;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- ///
- /// The details of the run step.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- public RunStepDeltaDetail StepDetails { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs
deleted file mode 100644
index bd86667370fcc..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class RunStepDeltaChunk : 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(RunStepDeltaChunk)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("id"u8);
- writer.WriteStringValue(Id);
- writer.WritePropertyName("object"u8);
- writer.WriteStringValue(Object.ToString());
- writer.WritePropertyName("delta"u8);
- writer.WriteObjectValue(Delta, options);
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- RunStepDeltaChunk 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(RunStepDeltaChunk)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeRunStepDeltaChunk(document.RootElement, options);
- }
-
- internal static RunStepDeltaChunk DeserializeRunStepDeltaChunk(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string id = default;
- RunStepDeltaChunkObject @object = default;
- RunStepDelta delta = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("id"u8))
- {
- id = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("object"u8))
- {
- @object = new RunStepDeltaChunkObject(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("delta"u8))
- {
- delta = RunStepDelta.DeserializeRunStepDelta(property.Value, options);
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new RunStepDeltaChunk(id, @object, delta, 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(RunStepDeltaChunk)} does not support writing '{options.Format}' format.");
- }
- }
-
- RunStepDeltaChunk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeRunStepDeltaChunk(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(RunStepDeltaChunk)} 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 RunStepDeltaChunk FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeRunStepDeltaChunk(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/RunStepDeltaChunk.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs
deleted file mode 100644
index bd48db51e72c1..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Represents a run step delta i.e. any changed fields on a run step during streaming.
- public partial class RunStepDeltaChunk
- {
- ///
- /// 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 identifier of the run step, which can be referenced in API endpoints.
- /// The delta containing the fields that have changed on the run step.
- /// or is null.
- internal RunStepDeltaChunk(string id, RunStepDelta delta)
- {
- Argument.AssertNotNull(id, nameof(id));
- Argument.AssertNotNull(delta, nameof(delta));
-
- Id = id;
- Delta = delta;
- }
-
- /// Initializes a new instance of .
- /// The identifier of the run step, which can be referenced in API endpoints.
- /// The object type, which is always `thread.run.step.delta`.
- /// The delta containing the fields that have changed on the run step.
- /// Keeps track of any properties unknown to the library.
- internal RunStepDeltaChunk(string id, RunStepDeltaChunkObject @object, RunStepDelta delta, IDictionary serializedAdditionalRawData)
- {
- Id = id;
- Object = @object;
- Delta = delta;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal RunStepDeltaChunk()
- {
- }
-
- /// The identifier of the run step, which can be referenced in API endpoints.
- public string Id { get; }
- /// The object type, which is always `thread.run.step.delta`.
- public RunStepDeltaChunkObject Object { get; } = RunStepDeltaChunkObject.ThreadRunStepDelta;
-
- /// The delta containing the fields that have changed on the run step.
- public RunStepDelta Delta { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs
deleted file mode 100644
index 3f217f5436611..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ComponentModel;
-
-namespace Azure.AI.Projects
-{
- /// The RunStepDeltaChunk_object.
- public readonly partial struct RunStepDeltaChunkObject : IEquatable
- {
- private readonly string _value;
-
- /// Initializes a new instance of .
- /// is null.
- public RunStepDeltaChunkObject(string value)
- {
- _value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- private const string ThreadRunStepDeltaValue = "thread.run.step.delta";
-
- /// thread.run.step.delta.
- public static RunStepDeltaChunkObject ThreadRunStepDelta { get; } = new RunStepDeltaChunkObject(ThreadRunStepDeltaValue);
- /// Determines if two values are the same.
- public static bool operator ==(RunStepDeltaChunkObject left, RunStepDeltaChunkObject right) => left.Equals(right);
- /// Determines if two values are not the same.
- public static bool operator !=(RunStepDeltaChunkObject left, RunStepDeltaChunkObject right) => !left.Equals(right);
- /// Converts a to a .
- public static implicit operator RunStepDeltaChunkObject(string value) => new RunStepDeltaChunkObject(value);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override bool Equals(object obj) => obj is RunStepDeltaChunkObject other && Equals(other);
- ///
- public bool Equals(RunStepDeltaChunkObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
-
- ///
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
- ///
- public override string ToString() => _value;
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs
deleted file mode 100644
index 2d242dc345aab..0000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class RunStepDeltaCodeInterpreterDetailItemObject : 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(RunStepDeltaCodeInterpreterDetailItemObject)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(Input))
- {
- writer.WritePropertyName("input"u8);
- writer.WriteStringValue(Input);
- }
- if (Optional.IsCollectionDefined(Outputs))
- {
- writer.WritePropertyName("outputs"u8);
- writer.WriteStartArray();
- foreach (var item in Outputs)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- RunStepDeltaCodeInterpreterDetailItemObject 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(RunStepDeltaCodeInterpreterDetailItemObject)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeRunStepDeltaCodeInterpreterDetailItemObject(document.RootElement, options);
- }
-
- internal static RunStepDeltaCodeInterpreterDetailItemObject DeserializeRunStepDeltaCodeInterpreterDetailItemObject(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string input = default;
- IReadOnlyList outputs = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("input"u8))
- {
- input = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("outputs"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- List array = new List