RequestHelper

open class RequestHelper(apiKey: String, organization: String? = null, client: OkHttpClient = OkHttpClient(), baseUrl: String = "https://api.openai.com")

Constructors

Link copied to clipboard
constructor(apiKey: String, organization: String? = null, client: OkHttpClient = OkHttpClient(), baseUrl: String = "https://api.openai.com")

Functions

Link copied to clipboard
open fun buildMultipartRequest(endpoint: String, function: MultipartBody.Builder.() -> Unit): Request
Link copied to clipboard
open fun buildRequest(request: Any, endpoint: String): Request.Builder
Link copied to clipboard
open fun buildRequestNoBody(endpoint: String, params: Map<String, Any>? = null): Request.Builder
Link copied to clipboard
open fun executeRequest(httpRequest: Request): String
open fun <T> executeRequest(httpRequest: Request, responseType: Class<T>): T