Skip to content

Messages

QueueMessage #

Bases: BaseModel

A message for the message queue.

Attributes:

Name Type Description
id_ str

The id of the message.

publisher_id str

The id of the publisher.

data Dict[str, Any]

The data of the message.

action Optional[ActionTypes]

The action of the message, used for deciding how to process the message.

stats QueueMessageStats

The stats of the message.

type str

The type of the message. Typically this is a service name.

Source code in llama-agents/llama_deploy/messages/base.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class QueueMessage(BaseModel):
    """A message for the message queue.

    Attributes:
        id_ (str):
            The id of the message.
        publisher_id (str):
            The id of the publisher.
        data (Dict[str, Any]):
            The data of the message.
        action (Optional[ActionTypes]):
            The action of the message, used for deciding how to process the message.
        stats (QueueMessageStats):
            The stats of the message.
        type (str):
            The type of the message. Typically this is a service name.
    """

    model_config = ConfigDict(arbitrary_types_allowed=True)
    id_: str = Field(default_factory=lambda: str(uuid.uuid4()))
    publisher_id: str = Field(default="default", description="Id of publisher.")
    data: Dict[str, Any] = Field(default_factory=dict)
    action: Optional[ActionTypes] = None
    stats: QueueMessageStats = Field(default_factory=QueueMessageStats)
    type: str = Field(
        default="default", description="Type of the message, used for routing."
    )

options: members: - QueueMessage