New version v2.3.6
This commit is contained in:
@@ -61,6 +61,11 @@ struct ProviderCapabilities: Codable {
|
||||
|
||||
// MARK: - Chat Request
|
||||
|
||||
struct ReasoningConfig: Sendable {
|
||||
let effort: String // "high", "medium", "low", "minimal"
|
||||
let exclude: Bool // true = use reasoning internally, hide from response
|
||||
}
|
||||
|
||||
struct ChatRequest {
|
||||
let messages: [Message]
|
||||
let model: String
|
||||
@@ -72,6 +77,7 @@ struct ChatRequest {
|
||||
let tools: [Tool]?
|
||||
let onlineMode: Bool
|
||||
let imageGeneration: Bool
|
||||
let reasoning: ReasoningConfig?
|
||||
|
||||
init(
|
||||
messages: [Message],
|
||||
@@ -83,7 +89,8 @@ struct ChatRequest {
|
||||
systemPrompt: String? = nil,
|
||||
tools: [Tool]? = nil,
|
||||
onlineMode: Bool = false,
|
||||
imageGeneration: Bool = false
|
||||
imageGeneration: Bool = false,
|
||||
reasoning: ReasoningConfig? = nil
|
||||
) {
|
||||
self.messages = messages
|
||||
self.model = model
|
||||
@@ -95,6 +102,7 @@ struct ChatRequest {
|
||||
self.tools = tools
|
||||
self.onlineMode = onlineMode
|
||||
self.imageGeneration = imageGeneration
|
||||
self.reasoning = reasoning
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +182,14 @@ struct StreamChunk {
|
||||
let content: String?
|
||||
let role: String?
|
||||
let images: [Data]?
|
||||
let thinking: String? // reasoning/thinking tokens (nil if excluded or not supported)
|
||||
|
||||
init(content: String?, role: String?, images: [Data]? = nil, thinking: String? = nil) {
|
||||
self.content = content
|
||||
self.role = role
|
||||
self.images = images
|
||||
self.thinking = thinking
|
||||
}
|
||||
}
|
||||
|
||||
var deltaContent: String? {
|
||||
|
||||
Reference in New Issue
Block a user