OpenAIConfig

org.llm4s.llmconnect.config.OpenAIConfig
See theOpenAIConfig companion class
object OpenAIConfig

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def fromValues(modelName: String, apiKey: String, organization: Option[String], baseUrl: String): OpenAIConfig

Constructs an OpenAIConfig, resolving contextWindow and reserveCompletion from the model name automatically.

Constructs an OpenAIConfig, resolving contextWindow and reserveCompletion from the model name automatically.

The resolver first consults a bundled model-metadata catalogue; if the model is not listed there it falls back to name-pattern matching before defaulting to 8192 tokens. Prefer this factory over the primary constructor so that new models receive correct context-window values without manual lookup.

Value parameters

apiKey

OpenAI API key; must be non-empty.

baseUrl

API base URL; must be non-empty. Pass a URL containing "openrouter.ai" to route through OpenRouter.

modelName

Model identifier, e.g. "gpt-4o".

organization

Optional OpenAI organisation ID.

Attributes