diff --git a/Sources/CleverBird/OpenAIAPIConnection.swift b/Sources/CleverBird/OpenAIAPIConnection.swift index 51f966a..9b0616d 100644 --- a/Sources/CleverBird/OpenAIAPIConnection.swift +++ b/Sources/CleverBird/OpenAIAPIConnection.swift @@ -7,16 +7,21 @@ public class OpenAIAPIConnection { let apiKey: String let organization: String? - let client: APIClient + public let client: APIClient let requestHeaders: [String:String] - public init(apiKey: String, organization: String? = nil) { + public init(apiKey: String, + organization: String? = nil, + scheme: String = "https", + host: String = "api.openai.com", + port: Int = 443) { self.apiKey = apiKey self.organization = organization var urlComponents = URLComponents() - urlComponents.scheme = "https" - urlComponents.host = "api.openai.com" + urlComponents.scheme = scheme + urlComponents.host = host + urlComponents.port = port let openAIAPIURL = urlComponents.url let clientConfiguration = APIClient.Configuration(baseURL: openAIAPIURL)