diff --git a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionChoice.cs b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionChoice.cs new file mode 100644 index 00000000..136cc367 --- /dev/null +++ b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionChoice.cs @@ -0,0 +1,13 @@ +namespace AIStudio.Provider.OpenAI; + +/// +/// Data model for a choice made by the AI. +/// +/// The index of the choice. +/// The delta text of the choice. +public record ChatCompletionChoice(int Index, ChatCompletionDelta Delta) +{ + public ChatCompletionChoice() : this(0, new (string.Empty)) + { + } +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionDelta.cs b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionDelta.cs new file mode 100644 index 00000000..6154cfbe --- /dev/null +++ b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionDelta.cs @@ -0,0 +1,12 @@ +namespace AIStudio.Provider.OpenAI; + +/// +/// The delta text of a choice. +/// +/// The content of the delta text. +public record ChatCompletionDelta(string Content) +{ + public ChatCompletionDelta() : this(string.Empty) + { + } +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionResponseStreamLine.cs b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionResponseStreamLine.cs index de4c77d5..d5b5d467 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionResponseStreamLine.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionResponseStreamLine.cs @@ -9,7 +9,7 @@ namespace AIStudio.Provider.OpenAI; /// The model used for the response. /// The system fingerprint; together with the seed, this allows you to reproduce the response. /// The choices made by the AI. -public record ChatCompletionResponseStreamLine(string Id, string Object, uint Created, string Model, string SystemFingerprint, IList Choices) : IResponseStreamLine +public record ChatCompletionResponseStreamLine(string Id, string Object, uint Created, string Model, string SystemFingerprint, IList Choices) : IResponseStreamLine { public ChatCompletionResponseStreamLine() : this(string.Empty, string.Empty, 0, string.Empty, string.Empty, []) { @@ -20,27 +20,14 @@ public record ChatCompletionResponseStreamLine(string Id, string Object, uint Cr /// public ContentStreamChunk GetContent() => new(this.Choices[0].Delta.Content, []); -} -/// -/// Data model for a choice made by the AI. -/// -/// The index of the choice. -/// The delta text of the choice. -public record Choice(int Index, Delta Delta) -{ - public Choice() : this(0, new (string.Empty)) - { - } -} + #region Implementation of IAnnotationStreamLine -/// -/// The delta text of a choice. -/// -/// The content of the delta text. -public record Delta(string Content) -{ - public Delta() : this(string.Empty) - { - } + /// + public bool ContainsSources() => false; + + /// + public IList GetSources() => []; + + #endregion } \ No newline at end of file