Skip to content

add Gemini LLM integration #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

add Gemini LLM integration #55

wants to merge 7 commits into from

Conversation

lecheel
Copy link

@lecheel lecheel commented Feb 28, 2025

- Implements the `Gemini` struct and `LLM` trait for interacting with the Gemini API.
- Includes error handling for missing API key.
- Supports streaming responses and termination.

- Implements the `Xai` struct and `LLM` trait for interacting with the X.AI API.
- Includes error handling for missing API key.
- Supports streaming responses and termination.
- Implements the `Gemini` struct and `LLM` trait for interacting with the Gemini API.
- Includes error handling for missing API key.
- Supports streaming responses and termination.
- Remove Xai LLM backend
- Remove xai config
- Uncomment release profile settings
- Enable LTO, stripping, and single codegen unit
src/gemini.rs Outdated
Comment on lines 16 to 21
// Configuration file example
//
// [gemini]
// base_url = "https://generativelanguage.googleapis.com/v1beta/models"
// model = "gemini-2.0-flash"
//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

src/gemini.rs Outdated
Comment on lines 200 to 206
let body: Value = json!({
"contents": contents,
"generationConfig": {
"temperature": 0.7,
"topK": 32,
"topP": 0.95,
"maxOutputTokens": 8192
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should put that somewhere where it can be configured 🤔 what do you think ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think which depend on entire proj to provide the configured option, in gemini without this also work fine. yes the comment can be removed just the reference for correct url in config.toml

@pythops
Copy link
Owner

pythops commented Apr 29, 2025

@lecheel
sorry for being slow, been busy recently.
Can you fix the CI then I'll look into it again.

Copy link
Author

@lecheel lecheel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed using just build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants