Skip to content
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

feat(llm): support Gemini provider #272

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

lloydchang
Copy link
Contributor

@lloydchang lloydchang commented Nov 24, 2024

fix #161


Important

Add support for Gemini provider, including API key handling, model initialization, and documentation updates.

  • Provider Support:
    • Add Gemini as a provider in models.py, init.py, and llm/__init__.py.
    • Update init_llm() in llm/__init__.py to initialize Gemini using OpenAI client.
    • Add Gemini API key handling in init.py and llm_openai.py.
  • Documentation:
    • Update providers.rst to include Gemini setup instructions.
  • Model Handling:
    • Add Gemini model gemini-1.5-flash-latest to models.py with context, max output, and pricing.
    • Update get_recommended_model() and get_summary_model() in models.py to include Gemini.
  • Evaluation:
    • Add Gemini model to default models in eval/main.py.

This description was created by Ellipsis for 321a31d. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 321a31d in 19 seconds

More details
  • Looked at 164 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. gptme/init.py:95
  • Draft comment:
    Update the API key prompt to include Gemini, as it is now supported.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of Gemini as a provider is consistent across the codebase. However, the API key prompt and documentation need to be updated to reflect this change.
2. gptme/init.py:105
  • Draft comment:
    Update the message to include Gemini, as it is now supported.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of Gemini as a provider is consistent across the codebase. However, the API key prompt and documentation need to be updated to reflect this change.
3. gptme/llm/__init__.py:254
  • Draft comment:
    Ensure that the provider detection logic correctly identifies Gemini based on the base URL.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of Gemini as a provider is consistent across the codebase. However, the API key prompt and documentation need to be updated to reflect this change.

Workflow ID: wflow_dqRjxwm5GUkqahW5


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@lloydchang lloydchang mentioned this pull request Nov 24, 2024
@lloydchang
Copy link
Contributor Author

Relates to #161 (comment)

@lloydchang lloydchang changed the title feat: add Gemini feat(docs, eval, llm): add Gemini Nov 24, 2024
@ErikBjare
Copy link
Owner

Very nice! Thanks :)

@ErikBjare ErikBjare changed the title feat(docs, eval, llm): add Gemini feat(docs, eval, llm): support Gemini provider Nov 24, 2024
@ErikBjare ErikBjare changed the title feat(docs, eval, llm): support Gemini provider feat(docs, llm): support Gemini provider Nov 24, 2024
@ErikBjare ErikBjare changed the title feat(docs, llm): support Gemini provider feat(llm): support Gemini provider Nov 24, 2024
@ErikBjare ErikBjare merged commit e875c55 into ErikBjare:master Nov 24, 2024
5 of 7 checks passed
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.

Google Gemini
2 participants