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()
|
db.commit()
|
||||||
|
|
||||||
try:
|
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
|
# 5. Store the new insight
|
||||||
new_insight = database.AnalysisResult(
|
new_insight = database.AnalysisResult(
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import time
|
|||||||
# Configure logging
|
# Configure logging
|
||||||
logging.basicConfig(level=logging.INFO)
|
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.
|
Calls the Gemini Pro API with a given prompt.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
prompt: The text prompt to send to the API.
|
prompt: The text prompt to send to the API.
|
||||||
|
temperature: Controls randomness in output.
|
||||||
retries: The number of times to retry on failure.
|
retries: The number of times to retry on failure.
|
||||||
timeout: The request timeout in seconds.
|
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}]
|
"parts": [{"text": prompt}]
|
||||||
}],
|
}],
|
||||||
"generationConfig": {
|
"generationConfig": {
|
||||||
"temperature": 0.7,
|
"temperature": temperature,
|
||||||
"topK": 40,
|
"topK": 40,
|
||||||
"topP": 0.95,
|
"topP": 0.95,
|
||||||
"maxOutputTokens": 8192,
|
"maxOutputTokens": 8192,
|
||||||
|
|||||||
Reference in New Issue
Block a user