mikethor007 commited on
Commit
f3c8a54
·
verified ·
1 Parent(s): 21a9953

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -47,7 +47,7 @@ prompt_recomendado = """You are a general AI assistant. I will ask you a questio
47
  If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
48
  If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
49
  To assist in your task, you can supervise other agents who perform specific tasks that could not be handled by tools, since they require the processing of another LLM. Below, I will inform you about your assistants:
50
- - web_research_agent. Assign web research related tasks to this agent
51
  Assign work to one agent at a time, do not call agents in parallel.
52
  Priorize the use of tools and another agents to help in reasoning.
53
  When a file or URL is entered at the prompt, use it in tools or other agents, both are prepared to handle files and URLs."""
@@ -55,12 +55,13 @@ prompt_recomendado = """You are a general AI assistant. I will ask you a questio
55
  prompt_search = """You are a web research agent.
56
  INSTRUCTIONS:
57
  Assist ONLY with research-related tasks, DO NOT do any math
 
58
  After you're done with your tasks, respond to the supervisor directly
59
  Respond ONLY with the results of your work, do NOT include ANY other text."""
60
 
61
  #TOOLS
62
  web_search = TavilySearch(
63
- max_results=5,
64
  topic="general",
65
  )
66
 
@@ -146,7 +147,7 @@ class BasicAgent:
146
  start_index = answer.find("FINAL ANSWER: ")
147
  substring=""
148
  if start_index != -1:
149
- substring = answer[start_index+14:-1]
150
 
151
  final_answer = substring #answer.removeprefix("FINAL ANSWER: ") #re.search(r"FINAL ANSWER:\s*(.*)", answer)
152
  print(f"Agent returning answer: {final_answer}\n")
 
47
  If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
48
  If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
49
  To assist in your task, you can supervise other agents who perform specific tasks that could not be handled by tools, since they require the processing of another LLM. Below, I will inform you about your assistants:
50
+ - web_research_agent. Assign web research related tasks to this agent, prioritizing the use of Wikipedia sources
51
  Assign work to one agent at a time, do not call agents in parallel.
52
  Priorize the use of tools and another agents to help in reasoning.
53
  When a file or URL is entered at the prompt, use it in tools or other agents, both are prepared to handle files and URLs."""
 
55
  prompt_search = """You are a web research agent.
56
  INSTRUCTIONS:
57
  Assist ONLY with research-related tasks, DO NOT do any math
58
+ If a source is provided in the task, you MUST use it as your primary source of information
59
  After you're done with your tasks, respond to the supervisor directly
60
  Respond ONLY with the results of your work, do NOT include ANY other text."""
61
 
62
  #TOOLS
63
  web_search = TavilySearch(
64
+ max_results=10,
65
  topic="general",
66
  )
67
 
 
147
  start_index = answer.find("FINAL ANSWER: ")
148
  substring=""
149
  if start_index != -1:
150
+ substring = answer[start_index+14:]
151
 
152
  final_answer = substring #answer.removeprefix("FINAL ANSWER: ") #re.search(r"FINAL ANSWER:\s*(.*)", answer)
153
  print(f"Agent returning answer: {final_answer}\n")