mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 19:57:04 +08:00
34 lines
539 B
Python
34 lines
539 B
Python
from __future__ import annotations
|
|
|
|
import typing
|
|
import enum
|
|
import pydantic
|
|
|
|
|
|
class FunctionCall(pydantic.BaseModel):
|
|
name: str
|
|
|
|
arguments: str
|
|
|
|
|
|
class ToolCall(pydantic.BaseModel):
|
|
id: str
|
|
|
|
type: str
|
|
|
|
function: FunctionCall
|
|
|
|
|
|
class Message(pydantic.BaseModel):
|
|
role: str
|
|
|
|
name: typing.Optional[str] = None
|
|
|
|
content: typing.Optional[str] = None
|
|
|
|
function_call: typing.Optional[FunctionCall] = None
|
|
|
|
tool_calls: typing.Optional[list[ToolCall]] = None
|
|
|
|
tool_call_id: typing.Optional[str] = None
|