ProviderConfig

configuration for an LLM provider.

Build with LLM.anthropic, LLM.openai, LLM.ollama, or LLM.gemini rather than constructing directly.

  • name: one of "anthropic", "openai", "ollama", "gemini"
  • base-url: the API base URL
  • api-key: the API key (empty for Ollama)
  • api-version: used only by Anthropic (e.g. "2023-06-01")

api-key

instantiate

(Fn [(Ref ProviderConfig a)] (Ref String a))

gets the api-key property of a ProviderConfig.

api-version

instantiate

(Fn [(Ref ProviderConfig a)] (Ref String a))

gets the api-version property of a ProviderConfig.

base-url

instantiate

(Fn [(Ref ProviderConfig a)] (Ref String a))

gets the base-url property of a ProviderConfig.

copy

instantiate

(Fn [(Ref ProviderConfig a)] ProviderConfig)

copies a ProviderConfig.

delete

instantiate

(Fn [ProviderConfig] ())

deletes a ProviderConfig. Should usually not be called manually.

init

instantiate

(Fn [String, String, String, String] ProviderConfig)

creates a ProviderConfig.

name

instantiate

(Fn [(Ref ProviderConfig a)] (Ref String a))

gets the name property of a ProviderConfig.

prn

instantiate

(Fn [(Ref ProviderConfig a)] String)

converts a ProviderConfig to a string.

set-api-key

instantiate

(Fn [ProviderConfig, String] ProviderConfig)

sets the api-key property of a ProviderConfig.

set-api-key!

instantiate

(Fn [(Ref ProviderConfig a), String] ())

sets the api-key property of a ProviderConfig in place.

set-api-version

instantiate

(Fn [ProviderConfig, String] ProviderConfig)

sets the api-version property of a ProviderConfig.

set-api-version!

instantiate

(Fn [(Ref ProviderConfig a), String] ())

sets the api-version property of a ProviderConfig in place.

set-base-url

instantiate

(Fn [ProviderConfig, String] ProviderConfig)

sets the base-url property of a ProviderConfig.

set-base-url!

instantiate

(Fn [(Ref ProviderConfig a), String] ())

sets the base-url property of a ProviderConfig in place.

set-name

instantiate

(Fn [ProviderConfig, String] ProviderConfig)

sets the name property of a ProviderConfig.

set-name!

instantiate

(Fn [(Ref ProviderConfig a), String] ())

sets the name property of a ProviderConfig in place.

str

instantiate

(Fn [(Ref ProviderConfig a)] String)

converts a ProviderConfig to a string.

update-api-key

instantiate

(Fn [ProviderConfig, (Ref (Fn [String] String a) b)] ProviderConfig)

updates the api-key property of a ProviderConfig using a function f.

update-api-version

instantiate

(Fn [ProviderConfig, (Ref (Fn [String] String a) b)] ProviderConfig)

updates the api-version property of a ProviderConfig using a function f.

update-base-url

instantiate

(Fn [ProviderConfig, (Ref (Fn [String] String a) b)] ProviderConfig)

updates the base-url property of a ProviderConfig using a function f.

update-name

instantiate

(Fn [ProviderConfig, (Ref (Fn [String] String a) b)] ProviderConfig)

updates the name property of a ProviderConfig using a function f.