Fix: Rename call_gemini_flash to call_gemini_api and add temperature parameter
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user