Spaces:
Sleeping
Sleeping
update prompt template
Browse files
app.py
CHANGED
@@ -55,11 +55,11 @@ def initialize_tools():
|
|
55 |
'search_accommodations': SearchAccommodationsTool(max_results=8),
|
56 |
}
|
57 |
|
58 |
-
# ====================
|
59 |
|
60 |
-
def
|
61 |
-
"""
|
62 |
-
|
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 =
|
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 |
-
|
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 |
-
|
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
|