diff --git a/Sources/SwiftyGPTChat/Managers/SwiftyGPTChatManager.swift b/Sources/SwiftyGPTChat/Managers/SwiftyGPTChatManager.swift index bb792ba..d2f6404 100644 --- a/Sources/SwiftyGPTChat/Managers/SwiftyGPTChatManager.swift +++ b/Sources/SwiftyGPTChat/Managers/SwiftyGPTChatManager.swift @@ -13,9 +13,9 @@ struct SwiftyGPTChatManager { init(service: SwiftyGPTChatService) { self.service = service } - - func send(messages: [any SwiftyGPTChatMessage], model: SwiftyGPTChatModel, frequencyPenalty: Double? = 0, logprobs: Bool? = false, topLogprobs: Int? = nil, maxTokens: Int? = nil, n: Int? = 1, presencePenalty: Double? = 0, seed: Int? = nil, temperature: Double? = 1, topP: Double? = 1, user: String? = nil) async throws -> SwiftyGPTChatResponse { - let requestBody = SwiftyGPTChatRequestBody(messages: messages, model: model, frequencyPenalty: frequencyPenalty, logprobs: logprobs, topLogprobs: topLogprobs, maxTokens: maxTokens, n: n, presencePenalty: presencePenalty, seed: seed, temperature: temperature, topP: topP, user: user) + + func send(messages: [any SwiftyGPTChatMessage], model: SwiftyGPTChatModel, frequencyPenalty: Double? = 0, logitBias: [Int: Int]? = nil, logprobs: Bool? = false, topLogprobs: Int? = nil, maxTokens: Int? = nil, n: Int? = 1, presencePenalty: Double? = 0, responseFormat: SwiftyGPTChatResponseFormat? = nil, seed: Int? = nil, temperature: Double? = 1, topP: Double? = 1, user: String? = nil) async throws -> SwiftyGPTChatResponse { + let requestBody = SwiftyGPTChatRequestBody(messages: messages, model: model, frequencyPenalty: frequencyPenalty, logitBias: logitBias, logprobs: logprobs, topLogprobs: topLogprobs, maxTokens: maxTokens, n: n, presencePenalty: presencePenalty, responseFormat: responseFormat, seed: seed, temperature: temperature, topP: topP, user: user) let responseBody = try await service.request(body: requestBody) return try SwiftyGPTChatResponse(body: responseBody) }