GeminiConfig

org.llm4s.llmconnect.config.GeminiConfig
See theGeminiConfig companion class
object GeminiConfig

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 apply(apiKey: String, model: String, baseUrl: String, contextWindow: Int, reserveCompletion: Int, timeouts: ProviderTimeouts, googleSearch: Boolean): GeminiConfig

Builds a config without validating it or normalising baseUrl; fromValues does both. timeouts defaults to ProviderTimeouts.default and googleSearch to false.

Builds a config without validating it or normalising baseUrl; fromValues does both. timeouts defaults to ProviderTimeouts.default and googleSearch to false.

Attributes

def apply(apiKey: String, model: String): GeminiConfig

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. The base URL is DEFAULT_BASE_URL, Google Search grounding is off, and contextWindow and reserveCompletion come from the model name alone (1M tokens for current Gemini models); set them, and the rest, with the with* setters, or use fromValues to consult the bundled model catalogue.

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. The base URL is DEFAULT_BASE_URL, Google Search grounding is off, and contextWindow and reserveCompletion come from the model name alone (1M tokens for current Gemini models); set them, and the rest, with the with* setters, or use fromValues to consult the bundled model catalogue.

Attributes

def fromValues(modelName: String, apiKey: String, baseUrl: String)(using resolver: ContextWindowResolver): Result[GeminiConfig]

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

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

Value parameters

apiKey

Google API key; must be non-empty.

baseUrl

API base URL; must be non-empty.

modelName

Model identifier, e.g. "gemini-2.0-flash".

Attributes

Concrete fields

val DEFAULT_BASE_URL: String

The Gemini API base URL used when a named provider section sets no baseUrl.

The Gemini API base URL used when a named provider section sets no baseUrl.

This was DefaultConfig.DEFAULT_GEMINI_BASE_URL in llm4s-core until the provider moved to llm4s-gemini (#1132).

Attributes