We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
openAI
1 parent a629d15 commit 471497aCopy full SHA for 471497a
core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AIRuntime.kt
@@ -14,10 +14,10 @@ data class AIRuntime<A>(val runtime: suspend (block: AI<A>) -> A) {
14
companion object {
15
@OptIn(ExperimentalTime::class)
16
@JvmStatic
17
- fun <A> openAI(): AIRuntime<A> = AIRuntime { block ->
+ fun <A> openAI(token: String? = null): AIRuntime<A> = AIRuntime { block ->
18
val openAIConfig =
19
OpenAIConfig(
20
- token =
+ token = token ?:
21
requireNotNull(getenv("OPENAI_TOKEN")) { "OpenAI Token missing from environment." },
22
)
23
val openAI = OpenAI(openAIConfig)
0 commit comments