The Agentic Types module defines foundational data structures for agentic systems.
This module defines several important type definitions, such as ToolSpec and ChatMessage, which are designed to be "model-neutral" as much as possible, allowing developers to build agentic systems using different models.
Function
Bases: TypedDict
The function that the model called.
Source code in bridgic/core/agentic/types/_chat_message.py
| class Function(TypedDict, total=True):
"""The function that the model called."""
arguments: Required[str]
"""
The arguments to call the function with, as generated by the model in JSON
format. Note that the model does not always generate valid JSON, and may
hallucinate parameters not defined by your function schema. Validate the
arguments in your code before calling your function.
"""
name: Required[str]
"""The name of the function to call."""
|
arguments instance-attribute
The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
name instance-attribute
The name of the function to call.
Bases: TypedDict
A call to a function tool created by the model.
Source code in bridgic/core/agentic/types/_chat_message.py
| class FunctionToolCall(TypedDict, total=True):
"""A call to a function tool created by the model."""
id: Required[str]
"""The ID of the tool call."""
function: Required[Function]
"""The function that the model called."""
type: Required[Literal["function"]]
"""The type of the tool. Currently, only `function` is supported."""
|
The function that the model called.
type: Required[Literal['function']]
The type of the tool. Currently, only function is supported.
SystemMessage
Bases: TypedDict
Developer-provided instructions that the model should follow, regardless of messages sent by the user.
Source code in bridgic/core/agentic/types/_chat_message.py
| class SystemMessage(TypedDict, total=False):
"""Developer-provided instructions that the model should follow, regardless of messages sent by the user."""
role: Required[Literal["system"]]
"""The role of the messages author, in this case `system`."""
content: Required[str]
"""The contents of the system message, which is a text."""
|
role instance-attribute
role: Required[Literal['system']]
The role of the messages author, in this case system.
content instance-attribute
The contents of the system message, which is a text.
UserTextMessage
Bases: TypedDict
Messages sent by an end user, containing prompts.
Source code in bridgic/core/agentic/types/_chat_message.py
| class UserTextMessage(TypedDict, total=False):
"""Messages sent by an end user, containing prompts."""
role: Required[Literal["user"]]
"""The role of the messages author, in this case `user`."""
content: Required[str]
"""The content of the user message, which is a text."""
|
role instance-attribute
role: Required[Literal['user']]
The role of the messages author, in this case user.
content instance-attribute
The content of the user message, which is a text.
AssistantTextMessage
Bases: TypedDict
Messages sent by the model in response to user messages.
Source code in bridgic/core/agentic/types/_chat_message.py
| class AssistantTextMessage(TypedDict, total=False):
"""Messages sent by the model in response to user messages."""
role: Required[Literal["assistant"]]
"""The role of the messages author, in this case `assistant`."""
content: Optional[str]
"""The content of the assistant message, which is a text. Required unless `tool_calls` is specified."""
tool_calls: Optional[Iterable[FunctionToolCall]]
"""The tool calls generated by the model, such as function calls."""
|
role instance-attribute
role: Required[Literal['assistant']]
The role of the messages author, in this case assistant.
content instance-attribute
The content of the assistant message, which is a text. Required unless tool_calls is specified.
tool_calls instance-attribute
The tool calls generated by the model, such as function calls.
Bases: TypedDict
Messages generated by tools.
Source code in bridgic/core/agentic/types/_chat_message.py
| class ToolMessage(TypedDict, total=False):
"""Messages generated by tools."""
role: Required[Literal["tool"]]
"""The role of the messages author, in this case `tool`."""
content: Required[str]
"""The contents of the tool message."""
tool_call_id: Required[str]
"""Tool call that this message is responding to."""
|
role: Required[Literal['tool']]
The role of the messages author, in this case tool.
content instance-attribute
The contents of the tool message.
tool_call_id: Required[str]
Tool call that this message is responding to.