withExtension

fun withExtension(key: String, value: Any): LlmOptions

Add or update a provider-specific extension. Returns a new LlmOptions with the extension added/updated.

Internal API: For provider modules only. Application code should use provider-specific extension functions (e.g., withAnthropicCaching()).

Return

A new LlmOptions with the extension

Parameters

key

The extension key

value

The extension value