yera.models.interfaces.llms.gemini
Yera LLM interface for the Gemini Developer API.
Symbols
GeminiLLM
BaseLLMInterfaceLLM interface for models invoked through the Gemini Developer API.
Methods
GeminiLLM.__init__
__init__(
config: LLMConfig,
connection: GeminiConnection,
overrides: dict,
) → NoneInitialize a Gemini interface without starting its API client.
Parameters
Model identity, capabilities, and default inference settings.
Gemini connection used when the client is started.
Inference values to apply over the model defaults.
Raises
If the model does not declare Gemini capabilities.
GeminiLLM.start
start() → NoneInitialise the Gemini client.
GeminiLLM.stop
stop() → NoneClose and clear the Gemini client.
GeminiLLM.chat
chat(
messages: list[Message],
reasoning_level: ReasoningLevel | None = None,
**overrides,
) → Iterator[LLMToken]Stream a chat response from Gemini.
Parameters
Conversation history to send to Gemini.
Optional reasoning effort overriding the configured default.
Per-call inference settings applied over the configured defaults.
GeminiLLM.make_struct
make_struct(
messages: list[Message],
reasoning_level: ReasoningLevel | None = None,
**overrides,
) → Iterator[LLMToken]Stream JSON conforming to a strict schema from Gemini.
Parameters
Conversation history to send to Gemini.
Struct class defining the required JSON response schema.
Optional reasoning effort overriding the configured default.
Per-call inference settings applied over the configured defaults.
Raises
If the generated Gemini request does not contain the expected configuration type.
If the model does not support structured outputs.
GeminiLLM.make_request_struct
make_request_struct(
messages: list[Message],
reasoning_level: ReasoningLevel | None = None,
**overrides,
) → Iterator[LLMToken]Stream a forced structured function call from Gemini.
Parameters
Conversation history to send to Gemini.
Struct class defining the forced function call and its arguments.
Optional reasoning effort overriding the configured default.
Per-call inference settings applied over the configured defaults.
Raises
If the generated Gemini request does not contain the expected configuration type.
If the model does not support tool calling or forced tool choice.