OpenAIConfig

class OpenAIConfig(val token: String, val logging: LoggingConfig = LoggingConfig(), val timeout: Timeout = Timeout(socket = 30.seconds), val organization: String? = null, val headers: Map<String, String> = emptyMap(), val host: OpenAIHost = OpenAIHost.OpenAI, val proxy: ProxyConfig? = null, val retry: RetryStrategy = RetryStrategy(), val engine: HttpClientEngine? = null, val httpClientConfig: HttpClientConfig<*>.() -> Unit = {})

OpenAI client configuration.

Parameters

token

OpenAI Token

logging

client logging configuration

timeout

http client timeout

headers

extra http headers

organization

OpenAI organization ID

host

OpenAI host configuration.

proxy

HTTP proxy url

retry

rate limit retry configuration

engine

explicit ktor engine for http requests.

httpClientConfig

additional custom client configuration

Constructors

Link copied to clipboard
constructor(token: String, logLevel: LogLevel = LogLevel.Headers, logger: Logger = Logger.Simple, timeout: Timeout = Timeout(socket = 30.seconds), organization: String? = null, headers: Map<String, String> = emptyMap(), host: OpenAIHost = OpenAIHost.OpenAI, proxy: ProxyConfig? = null, retry: RetryStrategy = RetryStrategy(), engine: HttpClientEngine? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit = {})
constructor(token: String, logging: LoggingConfig = LoggingConfig(), timeout: Timeout = Timeout(socket = 30.seconds), organization: String? = null, headers: Map<String, String> = emptyMap(), host: OpenAIHost = OpenAIHost.OpenAI, proxy: ProxyConfig? = null, retry: RetryStrategy = RetryStrategy(), engine: HttpClientEngine? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit = {})

Properties

Link copied to clipboard
val engine: HttpClientEngine? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val httpClientConfig: HttpClientConfig<*>.() -> Unit
Link copied to clipboard
Link copied to clipboard
val organization: String? = null
Link copied to clipboard
val proxy: ProxyConfig? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard