Add support for options and dynamic fetching of Gemini models #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds the following changes:
Introduced a
GeminiOptions
class that extendsllm.Options
and provides configuration options for the Gemini models, such asmax_tokens
,temperature
,top_p
, andtop_k
.Implemented a
fetch_available_models
function that uses the Gemini API to dynamically fetch the list of available models and their supported generation methods.Updated the
register_models
function to use thefetch_available_models
function to register all available Gemini models, rather than hardcoding a limited set.Similarly, the
register_embedding_models
function was updated to dynamically register all Gemini embedding models.These changes make the Gemini integration more robust and flexible, allowing it to adapt to changes in the available Gemini models without requiring manual updates to the code.