starting agent voting system

This commit is contained in:
Joao Moura
2023-11-05 17:44:09 -03:00
parent c936181cc1
commit ca0ce2b353
3 changed files with 27 additions and 3 deletions

View File

@@ -1,2 +1,4 @@
from .task import Task
from .crew import Crew
from .agent import Agent
from .agent import Agent
from .process import Process

View File

@@ -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
)