Skip to content

Commit

Permalink
Add instructions note
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed May 10, 2024
1 parent 56ead7b commit 2fc74c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions examples/choose_a_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
@ai_flow
def demo():
task = Task("choose a number between 1 and 100", agents=[a1, a2], result_type=int)
task.run_until_complete()

return task
return task.run_until_complete()


demo()
13 changes: 7 additions & 6 deletions src/control_flow/core/controller/instruction_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ class AgentTemplate(Template):
# Agent
You are an AI agent. Your name is "{{ agent.name }}".
This is your description, which all other agents can see: "{{ agent.description or 'An AI agent assigned to complete tasks.'}}"
These are your instructions: "{{ agent.instructions or 'No additional instructions provided.'}}"
This is your description, which all other agents can see: "{{ agent.description or 'An AI agent assigned to complete tasks.'}}"
You must follow these instructions at all times. They define your role and behavior.
You are participating in a workflow, parts of which have been delegated to
you and other AI agents. DO NOT speak on behalf of other agents or the
Expand All @@ -40,15 +43,13 @@ class AgentTemplate(Template):

class InstructionsTemplate(Template):
template: str = """
## Instructions
You must follow these instructions, which only you can see: "{{ agent.instructions or 'No additional instructions provided.'}}"
## Additional instructions
You must follow these instructions for this part of the workflow:
{% if additional_instructions %}
In addition, you must follow these instructions for this part of the workflow:
{% for instruction in additional_instructions %}
- {{ instruction }}
{% endfor %}
{% endif %}
"""
agent: Agent
Expand Down

0 comments on commit 2fc74c4

Please sign in to comment.