Closed lzell closed 2 months ago
Sample request:
let openAIService = AIProxy.openAIService( partialKey: "partial-key-from-your-developer-dashboard", serviceURL: "service-url-from-your-developer-dashboard" ) do { let response = try await openAIService.chatCompletionRequest(body: .init( model: "gpt-4o-mini", messages: [.assistant(content: .text("hello world"))] )) print(response.choices.first?.message.content ?? "") } catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) { print("Received non-200 status code: \(statusCode) with response body: \(responseBody)") } catch { print(error.localizedDescription) }
Sample request: