diff --git a/transcription-tool/backend/services/insights_service.py b/transcription-tool/backend/services/insights_service.py index 28236d8e..8ba529ad 100644 --- a/transcription-tool/backend/services/insights_service.py +++ b/transcription-tool/backend/services/insights_service.py @@ -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( diff --git a/transcription-tool/backend/services/llm_service.py b/transcription-tool/backend/services/llm_service.py index 2ea72ebd..67583e22 100644 --- a/transcription-tool/backend/services/llm_service.py +++ b/transcription-tool/backend/services/llm_service.py @@ -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,