mirror of
https://github.com/aljazceru/Tutorial-Codebase-Knowledge.git
synced 2025-12-18 15:04:20 +01:00
Merge pull request #8 from SkrOYC/patch-1
Update call_llm.py with beginner friendly AI Studio key support
This commit is contained in:
@@ -48,6 +48,10 @@ def call_llm(prompt: str, use_cache: bool = True) -> str:
|
||||
project=os.getenv("GEMINI_PROJECT_ID", "your-project-id"),
|
||||
location=os.getenv("GEMINI_LOCATION", "us-central1")
|
||||
)
|
||||
# You can comment the previous line and use the AI Studio key instead:
|
||||
# client = genai.Client(
|
||||
# api_key=os.getenv("GEMINI_API_KEY", "your-api_key"),
|
||||
# )
|
||||
model = os.getenv("GEMINI_MODEL", "gemini-2.5-pro-exp-03-25")
|
||||
response = client.models.generate_content(
|
||||
model=model,
|
||||
@@ -118,4 +122,4 @@ if __name__ == "__main__":
|
||||
print("Making call...")
|
||||
response1 = call_llm(test_prompt, use_cache=False)
|
||||
print(f"Response: {response1}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user