ant_ai.core.types
InvocationContext
pydantic-model
Bases: BaseModel
Request-scoped execution context. Treat as read-only during a request.
Show JSON schema:
{
"description": "Request-scoped execution context. Treat as read-only during a request.",
"properties": {
"session_id": {
"title": "Session Id",
"type": "string"
},
"llm_settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Llm Settings"
},
"workflow_settings": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Workflow Settings"
}
},
"required": [
"session_id"
],
"title": "InvocationContext",
"type": "object"
}
Config:
frozen:True
Fields:
-
session_id(str) -
llm_settings(dict[str, Any] | None) -
workflow_settings(dict[str, Any] | None)
Source code in src/ant_ai/core/types.py
10 11 12 13 14 15 16 17 18 19 | |
State
pydantic-model
Bases: BaseModel
Shared mutable state passed through agent steps and workflow nodes.
Subclass to add domain-specific fields:
class MyState(State):
user_id: str = ""
Show JSON schema:
{
"$defs": {
"Message": {
"description": "Generic message used in a conversation",
"properties": {
"kind": {
"const": "message",
"default": "message",
"title": "Kind",
"type": "string"
},
"role": {
"title": "Role",
"type": "string"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Content"
},
"metadata": {
"additionalProperties": true,
"title": "Metadata",
"type": "object"
}
},
"required": [
"role"
],
"title": "Message",
"type": "object"
}
},
"description": "Shared mutable state passed through agent steps and workflow nodes.\n\nSubclass to add domain-specific fields:\n\n class MyState(State):\n user_id: str = \"\"",
"properties": {
"messages": {
"items": {
"$ref": "#/$defs/Message"
},
"title": "Messages",
"type": "array"
},
"artefacts": {
"items": {},
"title": "Artefacts",
"type": "array"
}
},
"title": "State",
"type": "object"
}
Fields:
-
messages(list[Message]) -
artefacts(list[Any])
Source code in src/ant_ai/core/types.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |