PLBot commited on
Commit
957b955
·
1 Parent(s): 5b9b728

update prompt template

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -55,11 +55,11 @@ def initialize_tools():
55
  'search_accommodations': SearchAccommodationsTool(max_results=8),
56
  }
57
 
58
- # ==================== COORDINATOR PROMPT ====================
59
 
60
- def get_coordinator_prompt():
61
- """Get the specialized prompt for the coordinator agent."""
62
- return """
63
  You are the Coordinator Agent for Journi, a multi-agent AI travel companion system.
64
  Your role is to understand the user's travel request, break it down into sub-tasks,
65
  and delegate these tasks to the appropriate specialized agents.
@@ -72,7 +72,7 @@ def get_coordinator_prompt():
72
 
73
  IMPORTANT: To delegate a task to a managed agent, use this format:
74
  ```python
75
- result = managed_agent(task="Your detailed task description here")
76
  print(result)
77
  ```
78
 
@@ -90,6 +90,8 @@ def get_coordinator_prompt():
90
 
91
  Remember to provide a thorough, enthusiastic response that covers all aspects of the user's travel query.
92
  """
 
 
93
 
94
  # ==================== MULTI-AGENT SYSTEM SETUP ====================
95
 
@@ -139,8 +141,8 @@ def create_multi_agent_system():
139
  description="Creates destination descriptions, searches real accommodations, and suggests activities",
140
  )
141
 
142
- # Create coordinator agent with custom prompt and managed agents
143
- system_prompt = get_coordinator_prompt()
144
 
145
  coordinator_agent = CodeAgent(
146
  model=model,
@@ -149,7 +151,7 @@ def create_multi_agent_system():
149
  max_steps=8,
150
  name="Journi",
151
  description="Your AI Travel Companion",
152
- system_prompt=system_prompt
153
  )
154
 
155
  return coordinator_agent
 
55
  'search_accommodations': SearchAccommodationsTool(max_results=8),
56
  }
57
 
58
+ # ==================== PROMPT TEMPLATES ====================
59
 
60
+ def create_coordinator_prompt_templates():
61
+ """Create prompt templates with coordinator-specific instructions."""
62
+ system_prompt = """
63
  You are the Coordinator Agent for Journi, a multi-agent AI travel companion system.
64
  Your role is to understand the user's travel request, break it down into sub-tasks,
65
  and delegate these tasks to the appropriate specialized agents.
 
72
 
73
  IMPORTANT: To delegate a task to a managed agent, use this format:
74
  ```python
75
+ result = information_retrieval_agent(task="Your detailed task description here")
76
  print(result)
77
  ```
78
 
 
90
 
91
  Remember to provide a thorough, enthusiastic response that covers all aspects of the user's travel query.
92
  """
93
+
94
+ return {"system_prompt": system_prompt}
95
 
96
  # ==================== MULTI-AGENT SYSTEM SETUP ====================
97
 
 
141
  description="Creates destination descriptions, searches real accommodations, and suggests activities",
142
  )
143
 
144
+ # Create coordinator agent with custom prompt templates and managed agents
145
+ prompt_templates = create_coordinator_prompt_templates()
146
 
147
  coordinator_agent = CodeAgent(
148
  model=model,
 
151
  max_steps=8,
152
  name="Journi",
153
  description="Your AI Travel Companion",
154
+ prompt_templates=prompt_templates
155
  )
156
 
157
  return coordinator_agent