Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,9 +52,16 @@ model = LiteLLMModel(
|
|
| 52 |
# Import tool from Hub
|
| 53 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 54 |
|
|
|
|
| 55 |
with open("prompts.yaml", 'r') as stream:
|
| 56 |
prompt_templates = yaml.safe_load(stream)
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
tools=[final_answer, polite_guard, get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
|
|
@@ -64,7 +71,7 @@ agent = CodeAgent(
|
|
| 64 |
planning_interval=None,
|
| 65 |
name=None,
|
| 66 |
description=None,
|
| 67 |
-
prompt_templates=
|
| 68 |
)
|
| 69 |
|
| 70 |
|
|
|
|
| 52 |
# Import tool from Hub
|
| 53 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 54 |
|
| 55 |
+
# Load prompts.yaml
|
| 56 |
with open("prompts.yaml", 'r') as stream:
|
| 57 |
prompt_templates = yaml.safe_load(stream)
|
| 58 |
+
|
| 59 |
+
# Load contentprompts.yml
|
| 60 |
+
with open("contentprompts.yml", 'r') as stream:
|
| 61 |
+
content_prompts = yaml.safe_load(stream)
|
| 62 |
+
|
| 63 |
+
combined_prompts = {**prompt_templates, **content_prompts}
|
| 64 |
+
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
tools=[final_answer, polite_guard, get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
|
|
|
|
| 71 |
planning_interval=None,
|
| 72 |
name=None,
|
| 73 |
description=None,
|
| 74 |
+
prompt_templates=combined_prompts
|
| 75 |
)
|
| 76 |
|
| 77 |
|