forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.py
More file actions
39 lines (32 loc) · 796 Bytes
/
Copy pathtypes.py
File metadata and controls
39 lines (32 loc) · 796 Bytes
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
37
38
39
"""State for CopilotKit"""
from typing import TypedDict
from enum import Enum
from typing_extensions import NotRequired
class MessageRole(Enum):
"""Message role"""
ASSISTANT = "assistant"
SYSTEM = "system"
USER = "user"
class Message(TypedDict):
"""Message"""
id: str
createdAt: str
class TextMessage(Message):
"""Text message"""
role: MessageRole
content: str
class ActionExecutionMessage(Message):
"""Action execution message"""
name: str
arguments: dict
scope: str
class ResultMessage(Message):
"""Result message"""
actionExecutionId: str
actionName: str
result: str
class IntermediateStateConfig(TypedDict):
"""Intermediate state config"""
state_key: str
tool: str
tool_argument: NotRequired[str]