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

Add Google Gemini API support to aisuite #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eliasjudin
Copy link

Add support for Google Gemini API to aisuite and provide a guide.

  • New Provider Implementation

    • Add GoogleGenaiProvider class in aisuite/providers/google_genai_provider.py to handle Gemini API calls.
    • Implement chat_completions_create, generate_content, list_models, and normalize_response methods.
    • Handle authentication and API key management.
  • Provider Factory Update

    • Update ProviderFactory in aisuite/provider.py to include GoogleGenaiProvider.
  • Documentation

    • Add guides/google_genai.md with instructions for setting up and using the Gemini API with aisuite.
    • Update README.md to include the Gemini API as a supported provider and provide a brief example of how to use it.
  • Dependencies

    • Add google-genai to dependencies in pyproject.toml.

Add support for Google Gemini API to `aisuite` and provide a guide.

* **New Provider Implementation**
  - Add `GoogleGenaiProvider` class in `aisuite/providers/google_genai_provider.py` to handle Gemini API calls.
  - Implement `chat_completions_create`, `generate_content`, `list_models`, and `normalize_response` methods.
  - Handle authentication and API key management.

* **Provider Factory Update**
  - Update `ProviderFactory` in `aisuite/provider.py` to include `GoogleGenaiProvider`.

* **Documentation**
  - Add `guides/google_genai.md` with instructions for setting up and using the Gemini API with `aisuite`.
  - Update `README.md` to include the Gemini API as a supported provider and provide a brief example of how to use it.

* **Dependencies**
  - Add `google-genai` to dependencies in `pyproject.toml`.

Choose a reason for hiding this comment

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

I had some issues with the parsing of the name so I just changed the name to Ggenai for the class and the file.
Also the genai api doesn't accept the temperature so you must change
``**kwargs to config=types.GenerateContentConfig(**kwargs)```
in generate_content and chat_completions_create.

Copy link
Author

Choose a reason for hiding this comment

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

I’ll take a look. Appreciate any edits as I’m not too experienced integrating apis.

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