Skip to content
Snippets Groups Projects
Unverified Commit 8f863d4a authored by Oleksii's avatar Oleksii Committed by GitHub
Browse files

Merge pull request #311 from FiveSheepCo/upstream/reasoning-deltas

Support `reasoning` in ChatStreamResult deltas
parents bb97662c a9519b6c
No related branches found
No related tags found
No related merge requests found
......@@ -18,13 +18,26 @@ public struct ChatStreamResult: Codable, Equatable, Sendable {
public let content: String?
/// If the audio output modality is requested, this object contains data about the audio response from the model.
public let audio: ChoiceDeltaAudio?
/// The reasoning content of the chunk message.
/// Only some model are supported, like DeepSeek-R1.
public let reasoningContent: String?
/// The role of the author of this message.
public let role: Self.Role?
public let toolCalls: [Self.ChoiceDeltaToolCall]?
/// Value for `reasoning` field in response.
///
/// Provided by:
/// - Gemini (in OpenAI compatibility mode)
/// https://github.com/MacPaw/OpenAI/issues/283#issuecomment-2711396735
/// - OpenRouter
public let reasoning: String?
/// Value for `reasoning_content` field.
///
/// Provided by:
/// - Deepseek
/// https://api-docs.deepseek.com/api/create-chat-completion#responses
public let reasoningContent: String?
public struct ChoiceDeltaAudio: Codable, Equatable, Sendable {
/// Unique identifier for this audio response.
......@@ -85,9 +98,10 @@ public struct ChatStreamResult: Codable, Equatable, Sendable {
public enum CodingKeys: String, CodingKey {
case content
case audio
case reasoningContent = "reasoning_content"
case role
case toolCalls = "tool_calls"
case reasoning = "reasoning"
case reasoningContent = "reasoning_content"
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment