diff --git a/Sources/Swollama/GenerateRequest.swift b/Sources/Swollama/GenerateRequest.swift index 1be18cc..77d1b45 100644 --- a/Sources/Swollama/GenerateRequest.swift +++ b/Sources/Swollama/GenerateRequest.swift @@ -63,7 +63,7 @@ public struct GenerateRequest: Codable, Sendable { } /// Response format options -public enum ResponseFormat: String, Codable, Sendable { +public enum ResponseFormat: String, Codable { case json } @@ -108,7 +108,7 @@ public struct ChatMessage: Codable, Sendable { } /// Available message roles -public enum MessageRole: String, Codable, Sendable { +public enum MessageRole: String, Codable { case system case user case assistant diff --git a/Sources/Swollama/OllamaClient.swift b/Sources/Swollama/OllamaClient.swift index fa54236..0e42a03 100644 --- a/Sources/Swollama/OllamaClient.swift +++ b/Sources/Swollama/OllamaClient.swift @@ -1,7 +1,7 @@ import Foundation /// A client for interacting with the Ollama API -public actor OllamaClient: @preconcurrency OllamaProtocol { +public actor OllamaClient: OllamaProtocol { public let baseURL: URL public let configuration: OllamaConfiguration @@ -44,7 +44,7 @@ public actor OllamaClient: @preconcurrency OllamaProtocol { request.httpMethod = method request.httpBody = body - if body != nil { + if let body = body { request.setValue("application/json", forHTTPHeaderField: "Content-Type") }