Kackle commited on
Commit
318eefa
·
verified ·
1 Parent(s): 4661344

Update gemini_agent.py

Browse files
Files changed (1) hide show
  1. 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.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.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"""This question refers to attached Python code. Based on typical code execution patterns, provide the most likely numeric output:\n\n{question}\n\nAnswer:"""
193
  elif '.mp3' in question.lower():
194
- prompt = f"""This question refers to an attached audio file. Provide the most likely answer based on the context:\n\n{question}\n\nAnswer:"""
195
  else:
196
- prompt = f"""This question refers to an attached file. Provide the most likely answer:\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:"""
 
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:"""