Skip to content

Commit

Permalink
include changes from main
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Oct 23, 2024
1 parent f4af514 commit 4ff9346
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions llama_deploy/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
CONTROL_PLANE_NAME,
ActionTypes,
ChatMessage,
EventDefinition,
HumanResponse,
MessageRole,
PydanticValidatedUrl,
Expand All @@ -20,6 +21,7 @@
"CONTROL_PLANE_NAME",
"ActionTypes",
"ChatMessage",
"EventDefinition",
"HumanResponse",
"MessageRole",
"PydanticValidatedUrl",
Expand Down
21 changes: 18 additions & 3 deletions llama_deploy/types/core.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import uuid
from enum import Enum
from pydantic import BaseModel, Field, BeforeValidator, HttpUrl, TypeAdapter
from pydantic.v1 import BaseModel as V1BaseModel
from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated

from llama_index.core.llms import MessageRole
from pydantic import BaseModel, BeforeValidator, Field, HttpUrl, TypeAdapter
from pydantic.v1 import BaseModel as V1BaseModel
from typing_extensions import Annotated


def generate_id() -> str:
Expand Down Expand Up @@ -78,6 +78,7 @@ class ActionTypes(str, Enum):
NEW_TOOL_CALL = "new_tool_call"
COMPLETED_TOOL_CALL = "completed_tool_call"
TASK_STREAM = "task_stream"
SEND_EVENT = "send_event"


class TaskDefinition(BaseModel):
Expand Down Expand Up @@ -127,6 +128,20 @@ def current_task_id(self) -> Optional[str]:
return self.task_ids[-1]


class EventDefinition(BaseModel):
"""The definition of event.
To be used as payloads for service endpoints when wanting to send serialized
Events.
Attributes:
event_object_str (str): serialized string of event.
"""

agent_id: str
event_obj_str: str


class TaskResult(BaseModel):
"""
The result of a task.
Expand Down

0 comments on commit 4ff9346

Please sign in to comment.