Skip to content

ChatObjectMeta

ChatObjectMeta is a Pydantic BaseModel that stores identification, event, and timing metadata for a ChatObject instance.

Overview

This model captures a snapshot of a chat object's state, primarily used by ChatManager for tracking and managing running chat objects.

Fields

FieldTypeDefaultDescription
stream_idstrChat stream ID (unique identifier)
session_idstrSession ID this chat belongs to
user_inputlist[TextContent | ImageContent] | strThe user's input content
timedatetimefactory: datetime.now()Creation timestamp
last_calldatetimefactory: datetime.now()Last interaction timestamp

Usage

python
from amrita_core.chatmanager import ChatObjectMeta

# The ChatObjectMeta is typically created internally
# by ChatManager.add_chat_object() from the chat object's snapshot

# Access metadata from ChatManager
from amrita_core.chatmanager import chat_manager

metas = chat_manager.get_all_objs()
for meta in metas:
    print(f"Session: {meta.session_id}, Stream: {meta.stream_id}")
    print(f"Created: {meta.time}, Last call: {meta.last_call}")

Apache 2.0 License