File size: 783 Bytes
01523b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from pydantic import BaseModel, Field
from typing import List, Tuple, Set, Union, Any

from agentverse.utils import AgentAction


class Message(BaseModel):
    content: Any = Field(default="")
    sender: str = Field(default="")
    receiver: Set[str] = Field(default=set({"all"}))
    sender_agent: object = Field(default=None)
    tool_response: List[Tuple[AgentAction, str]] = Field(default=[])


class SolverMessage(Message):
    pass


class CriticMessage(Message):
    is_agree: bool
    criticism: str = ""


class ExecutorMessage(Message):
    tool_name: str = Field(default="")
    tool_input: Any = None


class EvaluatorMessage(Message):
    score: Union[bool, List[bool], int, List[int]]
    advice: str = Field(default="")


class RoleAssignerMessage(Message):
    pass