From ca0ce2b35369e137d7e9e7faa755a42a46beffa0 Mon Sep 17 00:00:00 2001 From: Joao Moura Date: Sun, 5 Nov 2023 17:44:09 -0300 Subject: [PATCH] starting agent voting system --- crewai/__init__.py | 4 +++- crewai/{agent => agents}/agent_vote.py | 0 crewai/prompts.py | 26 ++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) rename crewai/{agent => agents}/agent_vote.py (100%) diff --git a/crewai/__init__.py b/crewai/__init__.py index 14a5689f8..e3d8d20db 100644 --- a/crewai/__init__.py +++ b/crewai/__init__.py @@ -1,2 +1,4 @@ +from .task import Task from .crew import Crew -from .agent import Agent \ No newline at end of file +from .agent import Agent +from .process import Process \ No newline at end of file diff --git a/crewai/agent/agent_vote.py b/crewai/agents/agent_vote.py similarity index 100% rename from crewai/agent/agent_vote.py rename to crewai/agents/agent_vote.py diff --git a/crewai/prompts.py b/crewai/prompts.py index 857807e1d..ff0ab18c1 100644 --- a/crewai/prompts.py +++ b/crewai/prompts.py @@ -15,6 +15,14 @@ class Prompts(BaseModel): {agent_scratchpad} """) + MEMORY_SLICE: ClassVar[str] = dedent("""\ + This is the summary of your work so far: + {chat_history} + + This is your understanding of the current situation: + {entities} + """) + ROLE_PLAYING_SLICE: ClassVar[str] = dedent("""\ You are {role}. {backstory} @@ -47,6 +55,20 @@ class Prompts(BaseModel): ``` """) - AGENT_EXECUTION_PROMPT: ClassVar[str] = PromptTemplate.from_template( - ROLE_PLAYING_SLICE + TOOLS_SLICE + TASK_SLICE + VOTING_SLICE: ClassVar[str] = dedent("""\ + You are working on a crew with your co-workers and need to decide who will execute the task. + + These are tyour format instructions: + {format_instructions} + + These are your co-workers and their roles: + {coworkers} + """) + + TASK_EXECUTION_PROMPT: ClassVar[str] = PromptTemplate.from_template( + ROLE_PLAYING_SLICE + TOOLS_SLICE + MEMORY_SLICE + TASK_SLICE + ) + + CONSENSUNS_VOTING_PROMPT: ClassVar[str] = PromptTemplate.from_template( + ROLE_PLAYING_SLICE + VOTING_SLICE + TASK_SLICE ) \ No newline at end of file