Skip to main content

Module language_model

Module language_model 

Source
Expand description

Gemini language model (generateContent / streamGenerateContent).

Structs§

GoogleLanguageModel
Language model backed by generateContent.

Constants§

EXTERNAL_URL_MEDIA_TYPES
Media types the Gemini API fetches from arbitrary HTTPS URLs.
FAMILY
Provider id family of the language model.

Functions§

base_supported_urls
URLs every Gemini request accepts: Files API URIs (public endpoint and the configured base URL) and YouTube videos.
convert_generate_content_response
Converts a parsed generateContent response (raw is the original JSON) into a result using mapping to restore custom tool names; warnings are attached to the result.
is_gemini_model
Whether model_id is a Gemini model (used by the image model).
supported_urls
Supported URLs of model_id: the base set plus, for Gemini models other than Gemini 2.0, any HTTPS URL for EXTERNAL_URL_MEDIA_TYPES.