PLBot commited on
Commit
f0dfd71
·
verified ·
1 Parent(s): 0d4d05f

force the agent to use web search tool

Browse files
Files changed (1) hide show
  1. agents/tour_guide_agent.py +19 -8
agents/tour_guide_agent.py CHANGED
@@ -33,19 +33,30 @@ class TourGuideAgent(CodeAgent):
33
  **kwargs
34
  )
35
 
36
- # Add specialized agent prompt
37
  self.system_prompt_extension = """
38
  You are the Tour Guide Agent for Journi, an AI travel companion system.
39
  Your expertise is in finding popular tourist attractions and destinations.
40
 
41
- When given a task from the Coordinator Agent, you should:
42
- 1. Focus on finding the most popular tourist destinations for the location
43
- 2. Use web_search to get up-to-date information about tourist spots
44
- 3. Return a concise list of the top 5-7 attractions with 1-2 sentence descriptions
45
- 4. Format your response as a bulleted list for easy reading
 
46
 
47
- Only focus on actual tourist attractions and sights - not hotels, restaurants, or general travel advice.
48
- Provide a clear, organized list of the must-see places for travelers.
 
 
 
 
 
 
 
 
 
 
49
  """
50
 
51
  if prompt_templates and "system_prompt" in prompt_templates:
 
33
  **kwargs
34
  )
35
 
36
+ # Updated agent prompt with explicit instructions to use web search
37
  self.system_prompt_extension = """
38
  You are the Tour Guide Agent for Journi, an AI travel companion system.
39
  Your expertise is in finding popular tourist attractions and destinations.
40
 
41
+ When given a task from the Coordinator Agent, you MUST:
42
+ 1. ALWAYS use web_search to get up-to-date information about tourist spots
43
+ 2. Print the raw search results first
44
+ 3. Then extract the top 5-7 attractions from the search results
45
+ 4. Always cite your sources with the URLs from the search results
46
+ 5. Format your response as a bulleted list with citations
47
 
48
+ For example:
49
+ ```python
50
+ # Step 1: Search for tourist attractions
51
+ search_results = web_search(query=f"top tourist attractions in {destination}")
52
+ print("Raw search results:")
53
+ print(search_results)
54
+
55
+ # Step 2: Extract and format information from the search results
56
+ # Format the information with sources
57
+ ```
58
+
59
+ Only report attractions mentioned in the search results, do not make up information.
60
  """
61
 
62
  if prompt_templates and "system_prompt" in prompt_templates: