mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
32 lines
456 B
Python
32 lines
456 B
Python
from __future__ import annotations
|
|
|
|
import typing
|
|
import enum
|
|
import pydantic
|
|
|
|
|
|
class MessageRole(enum.Enum):
|
|
|
|
SYSTEM = 'system'
|
|
|
|
USER = 'user'
|
|
|
|
ASSISTANT = 'assistant'
|
|
|
|
FUNCTION = 'function'
|
|
|
|
|
|
class FunctionCall(pydantic.BaseModel):
|
|
name: str
|
|
|
|
args: dict[str, typing.Any]
|
|
|
|
|
|
class Message(pydantic.BaseModel):
|
|
|
|
role: MessageRole
|
|
|
|
content: typing.Optional[str] = None
|
|
|
|
function_call: typing.Optional[FunctionCall] = None
|