Skip to content

Commit

Permalink
feat: update SwiftyGPTChatManager send method interface
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-war committed Apr 27, 2024
1 parent 09ef835 commit 5478cb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftyGPTChat/Managers/SwiftyGPTChatManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5478cb5

Please sign in to comment.