Skip to content

Commit

Permalink
Merge pull request #97 from adamrushy/feature/renaming-implementation
Browse files Browse the repository at this point in the history
[Bugfix] Fixing Implementation of EndPoint
  • Loading branch information
adamrushy authored Jul 11, 2023
2 parents e62ea21 + c8070d8 commit ca66fb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/OpenAISwift/OpenAISwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class OpenAISwift {
let session:URLSession
let authorizeRequest: (inout URLRequest) -> Void

public static func makeDefultOpenAI(api_key: String) -> Self {
public static func makeDefaultOpenAI(apiKey: String) -> Self {
.init(baseURL: "https://api.openai.com",
endpointPrivider: OpenAIEndpointProvider(source: .openAI),
session: .shared,
authorizeRequest: { request in
request.setValue("Bearer \(api_key)", forHTTPHeaderField: "Authorization")
request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
})
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ extension OpenAISwift {
logitBias: [Int: Double]? = nil,
onEventReceived: ((Result<OpenAI<StreamMessageResult>, OpenAIError>) -> Void)? = nil,
onComplete: (() -> Void)? = nil) {
let endpoint = Endpoint.chat
let endpoint = OpenAIEndpointProvider.API.chat
let body = ChatConversation(user: user,
messages: messages,
model: model.modelName,
Expand Down

0 comments on commit ca66fb7

Please sign in to comment.