Alexandre Gazola commited on
Commit
58755f6
·
1 Parent(s): a6c0647
Files changed (2) hide show
  1. app.py +3 -2
  2. constants.py +2 -2
app.py CHANGED
@@ -58,7 +58,7 @@ class LangChainAgent:
58
  download_file_as_base64
59
 
60
  print("Waiting 60s before answering")
61
- time.sleep(15) # Delay for 60 seconds
62
 
63
  result = self.executor.invoke({
64
  "input": question,
@@ -134,8 +134,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
134
  print(f"Skipping item with missing task_id or question: {item}")
135
  continue
136
  try:
 
137
  question_text_for_agent = question_text
138
- if task_id:
139
  base64_attatched_file = download_file_as_base64(task_id)
140
  question_text_for_agent += f'. The content in base64 of the attatched file mentioned in the question is the following: {base64_attatched_file}'
141
  submitted_answer = agent(question_text_for_agent)
 
58
  download_file_as_base64
59
 
60
  print("Waiting 60s before answering")
61
+ time.sleep(30) # Delay for 60 seconds
62
 
63
  result = self.executor.invoke({
64
  "input": question,
 
134
  print(f"Skipping item with missing task_id or question: {item}")
135
  continue
136
  try:
137
+ file_name = item.get("file_name")
138
  question_text_for_agent = question_text
139
+ if file_name:
140
  base64_attatched_file = download_file_as_base64(task_id)
141
  question_text_for_agent += f'. The content in base64 of the attatched file mentioned in the question is the following: {base64_attatched_file}'
142
  submitted_answer = agent(question_text_for_agent)
constants.py CHANGED
@@ -1,8 +1,8 @@
1
  import os
2
 
3
- # MODEL = 'gemini-2.0-flash'
4
  # MODEL = 'gemini-2.0-flash-exp'
5
- MODEL = 'gemini-2.5-pro-exp-03-25'
6
  # 'gemini-2.5-pro-exp-03-25'
7
  # gemini-2.0-flash
8
  # gemini-2.5-pro-exp-03-25
 
1
  import os
2
 
3
+ MODEL = 'gemini-2.0-flash'
4
  # MODEL = 'gemini-2.0-flash-exp'
5
+ # MODEL = 'gemini-2.5-pro-exp-03-25'
6
  # 'gemini-2.5-pro-exp-03-25'
7
  # gemini-2.0-flash
8
  # gemini-2.5-pro-exp-03-25