robinsmits commited on
Commit
90a12ad
Β·
1 Parent(s): b800e08

Various Small Updates

Browse files
Files changed (3) hide show
  1. agents.py +3 -3
  2. app.py +4 -11
  3. tooling.py +2 -2
agents.py CHANGED
@@ -30,7 +30,7 @@ def create_vision_agent():
30
  name = 'vision_agent',
31
  planning_interval = 2,
32
  verbosity_level = 2,
33
- max_steps = 4,
34
  provide_run_summary = True,
35
  description = """
36
  A team member that will use a vision language model to answer a question about an image.
@@ -61,7 +61,7 @@ def create_web_agent():
61
  name = 'web_agent',
62
  planning_interval = 3,
63
  verbosity_level = 2,
64
- max_steps = 12,
65
  provide_run_summary = True,
66
  description = """
67
  A team member that will use various tools to search for websites, to visit websites and to parse and read information from websites.
@@ -95,6 +95,6 @@ def create_manager_agent():
95
  planning_interval = 3,
96
  verbosity_level = 2,
97
  stream_outputs = True,
98
- max_steps = 12,
99
  provide_run_summary = True,
100
  managed_agents = [vision_agent, web_agent])
 
30
  name = 'vision_agent',
31
  planning_interval = 2,
32
  verbosity_level = 2,
33
+ max_steps = 6,
34
  provide_run_summary = True,
35
  description = """
36
  A team member that will use a vision language model to answer a question about an image.
 
61
  name = 'web_agent',
62
  planning_interval = 3,
63
  verbosity_level = 2,
64
+ max_steps = 15,
65
  provide_run_summary = True,
66
  description = """
67
  A team member that will use various tools to search for websites, to visit websites and to parse and read information from websites.
 
95
  planning_interval = 3,
96
  verbosity_level = 2,
97
  stream_outputs = True,
98
+ max_steps = 15,
99
  provide_run_summary = True,
100
  managed_agents = [vision_agent, web_agent])
app.py CHANGED
@@ -70,7 +70,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
70
  print(f"An unexpected error occurred fetching questions: {e}")
71
  return f"An unexpected error occurred fetching questions: {e}", None
72
 
73
-
74
  # 3. Run your Agent
75
  results_log = []
76
  answers_payload = []
@@ -82,9 +81,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
82
  question_text = item.get("question")
83
  file_name = item.get("file_name")
84
 
85
- # File Check
86
- file_prompt = check_for_file_name_and_return_prompt(file_name)
87
-
88
  # File Download
89
  if file_name != '':
90
  # GET /files/{task_id}: Download a specific file associated with a given task ID.
@@ -107,7 +103,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
107
  except Exception as e:
108
  print(f"An unexpected error occurred while saving the file: {e}")
109
  return f"An unexpected error occurred while saving the file: {e}", None
110
-
 
 
111
 
112
  ################################################################################
113
  ###### RUN MANAGER AGENT
@@ -226,9 +224,4 @@ if __name__ == "__main__":
226
  print("-"*(60 + len(" App Starting ")) + "\n")
227
 
228
  print("Launching Gradio Interface for Basic Agent Evaluation...")
229
- demo.launch(debug=True, share=False)
230
-
231
-
232
- """
233
- Submission Failed: Server responded with status 422. Detail: [{'type': 'string_type', 'loc': ['body', 'answers', 13, 'submitted_answer', 'str'], 'msg': 'Input should be a valid string', 'input': ['45', '50', '67', '89']}, {'type': 'int_type', 'loc': ['body', 'answers', 13, 'submitted_answer', 'int'], 'msg': 'Input should be a valid integer', 'input': ['45', '50', '67', '89']}, {'type': 'float_type', 'loc': ['body', 'answers', 13, 'submitted_answer', 'float'], 'msg': 'Input should be a valid number', 'input': ['45', '50', '67', '89']}]
234
- """
 
70
  print(f"An unexpected error occurred fetching questions: {e}")
71
  return f"An unexpected error occurred fetching questions: {e}", None
72
 
 
73
  # 3. Run your Agent
74
  results_log = []
75
  answers_payload = []
 
81
  question_text = item.get("question")
82
  file_name = item.get("file_name")
83
 
 
 
 
84
  # File Download
85
  if file_name != '':
86
  # GET /files/{task_id}: Download a specific file associated with a given task ID.
 
103
  except Exception as e:
104
  print(f"An unexpected error occurred while saving the file: {e}")
105
  return f"An unexpected error occurred while saving the file: {e}", None
106
+
107
+ # File Check
108
+ file_prompt = check_for_file_name_and_return_prompt(file_name)
109
 
110
  ################################################################################
111
  ###### RUN MANAGER AGENT
 
224
  print("-"*(60 + len(" App Starting ")) + "\n")
225
 
226
  print("Launching Gradio Interface for Basic Agent Evaluation...")
227
+ demo.launch(debug=True, share=False)
 
 
 
 
 
tooling.py CHANGED
@@ -91,8 +91,8 @@ The file is already downloaded and available for use. Use the 'vision_agent' to
91
  Make sure to pass the file name and question!!"""
92
  elif '.py' in file_name:
93
  file_type = 'Python Script File'
94
- with open(file_name, "r") as py_file:
95
- python_script_contents = py_file.read()
96
  return f"""
97
  # File Information
98
  For this question there is a file named '{file_name}' with additional information related to the question available.
 
91
  Make sure to pass the file name and question!!"""
92
  elif '.py' in file_name:
93
  file_type = 'Python Script File'
94
+ with open(file_name, "r") as pyfile:
95
+ python_script_contents = pyfile.read()
96
  return f"""
97
  # File Information
98
  For this question there is a file named '{file_name}' with additional information related to the question available.