context

fun context(arguments: Map<String, String>)(source)

Sets additional context for the completion request using a Map.

This method allows providing additional key-value pairs that may be relevant for generating completions. This is an optional field.

Example:

completeRequest {
context(mapOf("userId" to "123", "role" to "admin"))
// ... other configuration
}

Parameters

arguments

A map of context key-value pairs


fun context(block: MutableMap<String, String>.() -> Unit)(source)

Sets additional context for the completion request using a DSL builder.

This method allows providing additional key-value pairs that may be relevant for generating completions using a type-safe builder syntax. This is an optional field.

Example:

completeRequest {
context {
put("userId", "123")
put("role", "admin")
put("environment", "production")
}
// ... other configuration
}

Parameters

block

Lambda with receiver for building the context map