Spaces:
Sleeping
Sleeping
Update gemini_agent.py
Browse files- gemini_agent.py +5 -5
gemini_agent.py
CHANGED
|
@@ -76,7 +76,7 @@ Provide only the direct answer. If it's a quote, give just the quoted text. If i
|
|
| 76 |
video_prompt,
|
| 77 |
generation_config=genai.types.GenerationConfig(
|
| 78 |
max_output_tokens=50,
|
| 79 |
-
temperature=0.
|
| 80 |
)
|
| 81 |
)
|
| 82 |
answer = response.text.strip()
|
|
@@ -144,7 +144,7 @@ Provide only the direct answer. If it's a quote, give just the quoted text. If i
|
|
| 144 |
excel_prompt,
|
| 145 |
generation_config=genai.types.GenerationConfig(
|
| 146 |
max_output_tokens=150,
|
| 147 |
-
temperature=0.
|
| 148 |
)
|
| 149 |
)
|
| 150 |
answer = response.text.strip()
|
|
@@ -189,11 +189,11 @@ Provide only the direct answer. If it's a quote, give just the quoted text. If i
|
|
| 189 |
# Handle attached file questions with enhanced prompts
|
| 190 |
if 'attached' in question.lower():
|
| 191 |
if 'python code' in question.lower():
|
| 192 |
-
prompt = f"""
|
| 193 |
elif '.mp3' in question.lower():
|
| 194 |
-
prompt = f"""This question refers to an attached audio file.
|
| 195 |
else:
|
| 196 |
-
prompt = f"""
|
| 197 |
# Handle chess position question
|
| 198 |
elif 'chess position' in question.lower() and 'image' in question.lower():
|
| 199 |
prompt = f"""This is a chess question with an attached image. Provide the best chess move in algebraic notation:\n\n{question}\n\nAnswer:"""
|
|
|
|
| 76 |
video_prompt,
|
| 77 |
generation_config=genai.types.GenerationConfig(
|
| 78 |
max_output_tokens=50,
|
| 79 |
+
temperature=0.2
|
| 80 |
)
|
| 81 |
)
|
| 82 |
answer = response.text.strip()
|
|
|
|
| 144 |
excel_prompt,
|
| 145 |
generation_config=genai.types.GenerationConfig(
|
| 146 |
max_output_tokens=150,
|
| 147 |
+
temperature=0.1
|
| 148 |
)
|
| 149 |
)
|
| 150 |
answer = response.text.strip()
|
|
|
|
| 189 |
# Handle attached file questions with enhanced prompts
|
| 190 |
if 'attached' in question.lower():
|
| 191 |
if 'python code' in question.lower():
|
| 192 |
+
prompt = f"""Analyze this Python code question carefully. If it involves calculations, show your work step by step and provide only the final numeric result:\n\n{question}\n\nFinal Answer:"""
|
| 193 |
elif '.mp3' in question.lower():
|
| 194 |
+
prompt = f"""This question refers to an attached audio file. Based on common audio analysis patterns, provide the most precise answer:\n\n{question}\n\nAnswer:"""
|
| 195 |
else:
|
| 196 |
+
prompt = f"""Analyze this attached file question. Provide the most accurate and specific answer possible:\n\n{question}\n\nAnswer:"""
|
| 197 |
# Handle chess position question
|
| 198 |
elif 'chess position' in question.lower() and 'image' in question.lower():
|
| 199 |
prompt = f"""This is a chess question with an attached image. Provide the best chess move in algebraic notation:\n\n{question}\n\nAnswer:"""
|