-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchat_message.py
More file actions
52 lines (41 loc) · 1.54 KB
/
chat_message.py
File metadata and controls
52 lines (41 loc) · 1.54 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
# This file was auto-generated by Fern from our API Definition.
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .chat_message_content import ChatMessageContent
from .chat_message_thinking_item import ChatMessageThinkingItem
from .chat_role import ChatRole
from .tool_call import ToolCall
class ChatMessage(UncheckedBaseModel):
content: typing.Optional[ChatMessageContent] = pydantic.Field(default=None)
"""
The content of the message.
"""
name: typing.Optional[str] = pydantic.Field(default=None)
"""
Optional name of the message author.
"""
tool_call_id: typing.Optional[str] = pydantic.Field(default=None)
"""
Tool call that this message is responding to.
"""
role: ChatRole = pydantic.Field()
"""
Role of the message author.
"""
tool_calls: typing.Optional[typing.List[ToolCall]] = pydantic.Field(default=None)
"""
A list of tool calls requested by the assistant.
"""
thinking: typing.Optional[typing.List[ChatMessageThinkingItem]] = pydantic.Field(default=None)
"""
Model's chain-of-thought for providing the response. Present on assistant messages if model supports it.
"""
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow