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

Adding Gemini Api Integration #150

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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 .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ AZURE_API_BASE=""
# AZURE_API_VERSION: The version of Azure's API to use.
AZURE_API_VERSION=""

# ENABLE_GEMINI: Set to true to enable Gemini as a language model provider.
ENABLE_GEMINI=false
# GEMINI_API_KEY: Your Gemini API key for accessing models like GPT-4.
GEMINI_API_KEY=""

# LLM_KEY: The chosen language model to use. This should be one of the models
# provided by the enabled LLM providers (e.g., OPENAI_GPT4_TURBO, OPENAI_GPT4V, ANTHROPIC_CLAUDE3, AZURE_OPENAI_GPT4V).
LLM_KEY=""
Expand Down
17 changes: 17 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ setup_llm_providers() {
else
update_or_add_env_var "ENABLE_AZURE" "false"
fi

#Gemini Configuartion
echo "To enable Gemini, you must have an Gemini API key."
read -p "Do you want to enable Gemini (y/n)? " enable_gemini
if [[ "$enable_gemini" == "y" ]]; then
read -p "Enter your Gemini API key: " gemini_api_key
if [ -z "$gemini_api_key" ]; then
echo "Error: Gemini API key is required."
echo "Gemini will not be enabled."
else
update_or_add_env_var "GEMINI_API_KEY" "$gemini_api_key"
update_or_add_env_var "ENABLE_GEMINI" "true"
model_options+=("GEMINI_PRO_VISION")
fi
else
update_or_add_env_var "ENABLE_GEMINI" "false"
fi

# Model Selection
if [ ${#model_options[@]} -eq 0 ]; then
Expand Down
Loading