From d353c36c963a70ebbac32e111018435715f51f3c Mon Sep 17 00:00:00 2001 From: coderbeastdude <46804761+coderbeastdude@users.noreply.github.com> Date: Wed, 14 May 2025 02:17:43 -0500 Subject: [PATCH] Update call_llm.py import_load_dotenv added_model_gemini_2.0_flash (Cause 2.5 did not have api access) --- utils/call_llm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/call_llm.py b/utils/call_llm.py index 9259b54..a6315db 100644 --- a/utils/call_llm.py +++ b/utils/call_llm.py @@ -4,6 +4,10 @@ import json from datetime import datetime +# Load environment variables from .env file +from dotenv import load_dotenv +load_dotenv() + # Configure logging log_directory = os.getenv("LOG_DIR", "logs") os.makedirs(log_directory, exist_ok=True) @@ -58,7 +62,7 @@ def call_llm(prompt: str, use_cache: bool = True) -> str: client = genai.Client( api_key=os.getenv("GEMINI_API_KEY", ""), ) - model = os.getenv("GEMINI_MODEL", "gemini-2.5-pro-exp-03-25") + model = os.getenv("GEMINI_MODEL", "gemini-2.0-flash") # gemini-2.0-flash is available in the api but the newer models like gemini-2.5-flash-preview-04-17 are not!!! # model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash-preview-04-17") response = client.models.generate_content(model=model, contents=[prompt])