Skip to content

feat: Add Gemini LLMs #322

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

Merged
merged 2 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def get_models() -> dict[str, str]:
models |= {"OpenAI GPT-4o": "gpt-4o"}
if "ANTHROPIC_API_KEY" in os.environ:
models |= {"Anthropic Claude 3.5 Sonnet": "claude-3-5-sonnet-20240620"}
if "GEMINI_API_KEY" in os.environ:
models |= {
"Google Gemini 1.5 Pro": "gemini/gemini-1.5-pro",
"Google Gemini 2.5 Pro": "gemini/gemini-2.5-pro-preview-06-05",
}
if _has_aws_access():
# If you get "You don't have access to the model with the specified model ID." error,
# remember to request access to Bedrock models ...aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess
Expand Down
2 changes: 2 additions & 0 deletions app/tests/src/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def test_get_models(monkeypatch):
monkeypatch.delenv("AWS_ACCESS_KEY_ID")
if "OPENAI_API_KEY" in os.environ:
monkeypatch.delenv("OPENAI_API_KEY")
if "GEMINI_API_KEY" in os.environ:
monkeypatch.delenv("GEMINI_API_KEY")
if "OLLAMA_HOST" in os.environ:
monkeypatch.delenv("OLLAMA_HOST")
assert get_models() == {}
Expand Down
4 changes: 4 additions & 0 deletions infra/app/app-config/env-config/environment_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ locals {
manage_method = "manual"
secret_store_name = "/${var.app_name}-${var.environment}/OPENAI_API_KEY"
}
GEMINI_API_KEY = {
manage_method = "manual"
secret_store_name = "/${var.app_name}-${var.environment}/GEMINI_API_KEY"
}
LITERAL_API_KEY = {
manage_method = "manual"
secret_store_name = "/${var.app_name}-${var.environment}/LITERAL_API_KEY"
Expand Down