CohereConfig

org.llm4s.llmconnect.config.CohereConfig
See theCohereConfig companion class
@Experimental
object CohereConfig

Attributes

Companion
class
Source
CohereConfig.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apply(apiKey: Secret, model: ModelName, baseUrl: BaseUrl, contextWindow: Int, reserveCompletion: Int, timeouts: ProviderTimeouts): CohereConfig

Builds a config without validating it; fromValues validates and resolves the context window from the model. Every field after model has a default.

Builds a config without validating it; fromValues validates and resolves the context window from the model. Every field after model has a default.

Attributes

Source
CohereConfig.scala
def apply(apiKey: Secret, model: ModelName): CohereConfig

The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. Set the rest with the with* setters.

The API key and model, every other field at its default: the entry point for Java and Kotlin, which do not see Scala default arguments. Set the rest with the with* setters.

Attributes

Source
CohereConfig.scala

The Compatibility API base for a configured base URL.

The Compatibility API base for a configured base URL.

A URL already ending in /compatibility/v1 is used as it is. Anything else is taken to be a Cohere API root - which is what baseUrl meant before #1132, when the client appended /v2/chat to it - and gets /compatibility/v1 appended, after dropping a trailing native version segment (/v1 or /v2). So https://api.cohere.com, https://api.cohere.com/v2 and a proxy root that forwards to Cohere all keep working. Idempotent.

Attributes

Source
CohereConfig.scala
def fromValues(modelName: ModelName, apiKey: Secret, baseUrl: BaseUrl)(using resolver: ContextWindowResolver): Result[CohereConfig]

Constructs a CohereConfig, resolving contextWindow and reserveCompletion from the model name automatically.

Constructs a CohereConfig, resolving contextWindow and reserveCompletion from the model name automatically.

Value parameters

apiKey

Cohere API key; must be non-empty.

baseUrl

Compatibility API base, or a Cohere API root; must be non-empty. Mapped through compatibilityBaseUrl, and logged when that changes it. Defaults to CohereConfig.DEFAULT_BASE_URL when loaded via org.llm4s.config.Llm4sConfig.

modelName

Model identifier, e.g. "command-a-03-2025".

Attributes

Source
CohereConfig.scala

Concrete fields

The path of Cohere's OpenAI-compatibility API under an API root.

The path of Cohere's OpenAI-compatibility API under an API root.

Attributes

Source
CohereConfig.scala

Cohere's OpenAI-compatibility endpoint. This was https://api.cohere.com, the native API root, until the client moved onto the Compatibility API (#1132).

Cohere's OpenAI-compatibility endpoint. This was https://api.cohere.com, the native API root, until the client moved onto the Compatibility API (#1132).

Attributes

Source
CohereConfig.scala

The context window apply uses when none is given; fromValues resolves the model's own.

The context window apply uses when none is given; fromValues resolves the model's own.

Attributes

Source
CohereConfig.scala

The completion reserve apply uses when none is given; fromValues resolves the model's own.

The completion reserve apply uses when none is given; fromValues resolves the model's own.

Attributes

Source
CohereConfig.scala