mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-10-08 19:40:21 +00:00
Renamed ResponseStreamLine
to ChatCompletionResponseStreamLine
across all providers
This commit is contained in:
parent
9d9441d898
commit
a37521c7f1
@ -77,7 +77,7 @@ public sealed class ProviderAlibabaCloud(ILogger logger) : BaseProvider("https:/
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("AlibabaCloud", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("AlibabaCloud", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public sealed class ProviderDeepSeek(ILogger logger) : BaseProvider("https://api
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("DeepSeek", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("DeepSeek", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public sealed class ProviderGWDG(ILogger logger) : BaseProvider("https://chat-ai
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("GWDG", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("GWDG", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class ProviderGoogle(ILogger logger) : BaseProvider("https://generativela
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("Google", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("Google", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class ProviderGroq(ILogger logger) : BaseProvider("https://api.groq.com/o
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("Groq", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("Groq", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public sealed class ProviderHelmholtz(ILogger logger) : BaseProvider("https://ap
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("Helmholtz", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("Helmholtz", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public sealed class ProviderHuggingFace : BaseProvider
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("HuggingFace", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("HuggingFace", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ public sealed class ProviderMistral(ILogger logger) : BaseProvider("https://api.
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("Mistral", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("Mistral", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace AIStudio.Provider.OpenAI;
|
||||
|
||||
/// <summary>
|
||||
/// Data model for a line in the response stream, for streaming completions.
|
||||
/// Data model for a line in the response stream, for streaming chat completions.
|
||||
/// </summary>
|
||||
/// <param name="Id">The id of the response.</param>
|
||||
/// <param name="Object">The object describing the response.</param>
|
||||
@ -9,7 +9,7 @@ namespace AIStudio.Provider.OpenAI;
|
||||
/// <param name="Model">The model used for the response.</param>
|
||||
/// <param name="SystemFingerprint">The system fingerprint; together with the seed, this allows you to reproduce the response.</param>
|
||||
/// <param name="Choices">The choices made by the AI.</param>
|
||||
public readonly record struct ResponseStreamLine(string Id, string Object, uint Created, string Model, string SystemFingerprint, IList<Choice> Choices) : IResponseStreamLine
|
||||
public readonly record struct ChatCompletionResponseStreamLine(string Id, string Object, uint Created, string Model, string SystemFingerprint, IList<Choice> Choices) : IResponseStreamLine
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public bool ContainsContent() => this != default && this.Choices.Count > 0;
|
@ -111,6 +111,7 @@ public sealed class ProviderOpenAI(ILogger logger) : BaseProvider("https://api.o
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("OpenAI", RequestBuilder, token))
|
||||
yield return content;
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("OpenAI", RequestBuilder, token))
|
||||
}
|
||||
|
||||
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
|
||||
|
@ -75,7 +75,7 @@ public sealed class ProviderSelfHosted(ILogger logger, Host host, string hostnam
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("self-hosted provider", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("self-hosted provider", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public sealed class ProviderX(ILogger logger) : BaseProvider("https://api.x.ai/v
|
||||
return request;
|
||||
}
|
||||
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ResponseStreamLine>("xAI", RequestBuilder, token))
|
||||
await foreach (var content in this.StreamChatCompletionInternal<ChatCompletionResponseStreamLine>("xAI", RequestBuilder, token))
|
||||
yield return content;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user