LLM¶
Data Structures for LLMs.
ChatRole
¶
ChatMessage
¶
Bases: BaseModel
The chat message data model.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
ChatRole
|
The role of the message. |
content |
str
|
The content of the message. |
tool_calls |
list[ToolCall] | None
|
Tool calls associated with the message. |
Source code in src/llm_agents_from_scratch/data_structures/llm.py
from_tool_call_result
classmethod
¶
Create a ChatMessage from a ToolCallResult.
Source code in src/llm_agents_from_scratch/data_structures/llm.py
CompleteResult
¶
Bases: BaseModel
The llm completion result data model.
Attributes:
| Name | Type | Description |
|---|---|---|
response |
str
|
The completion response provided by the LLM. |
full_response |
str
|
Input prompt and completion text. |