Renamed ResponseStreamLine to ChatCompletionResponseStreamLine across all providers

This commit is contained in:
Thorsten Sommer 2025-09-01 22:36:33 +02:00
parent 9d9441d898
commit a37521c7f1
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
12 changed files with 13 additions and 12 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}