Fix: Rename call_gemini_flash to call_gemini_api and add temperature parameter

This commit is contained in:
Jarvis
2026-01-31 06:29:56 +00:00
parent 14dd48b22a
commit 0f0033ff9b
2 changed files with 4 additions and 3 deletions

View File

@@ -95,7 +95,7 @@ def generate_insight(db: Session, meeting_id: int, insight_type: str) -> databas
db.commit()
try:
generated_text = call_gemini_flash(prompt=final_prompt, temperature=0.5)
generated_text = call_gemini_api(prompt=final_prompt, temperature=0.5)
# 5. Store the new insight
new_insight = database.AnalysisResult(

View File

@@ -6,12 +6,13 @@ import time
# Configure logging
logging.basicConfig(level=logging.INFO)
def call_gemini_api(prompt: str, retries: int = 3, timeout: int = 600) -> str:
def call_gemini_api(prompt: str, temperature: float = 0.7, retries: int = 3, timeout: int = 600) -> str:
"""
Calls the Gemini Pro API with a given prompt.
Args:
prompt: The text prompt to send to the API.
temperature: Controls randomness in output.
retries: The number of times to retry on failure.
timeout: The request timeout in seconds.
@@ -33,7 +34,7 @@ def call_gemini_api(prompt: str, retries: int = 3, timeout: int = 600) -> str:
"parts": [{"text": prompt}]
}],
"generationConfig": {
"temperature": 0.7,
"temperature": temperature,
"topK": 40,
"topP": 0.95,
"maxOutputTokens": 8192,