store
AttachmentStore
Bases: ABC, Generic[TContext]
Source code in chatkit/store.py
delete_attachment
abstractmethod
async
create_attachment
async
create_attachment(
input: AttachmentCreateParams, context: TContext
) -> Attachment
Create an attachment record from upload metadata.
Source code in chatkit/store.py
generate_attachment_id
Return a new identifier for a file. Override this method to customize file ID generation.
Store
Bases: ABC, Generic[TContext]
Source code in chatkit/store.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
generate_thread_id
Return a new identifier for a thread. Override this method to customize thread ID generation.
generate_item_id
generate_item_id(
item_type: StoreItemType,
thread: ThreadMetadata,
context: TContext,
) -> str
Return a new identifier for a thread item. Override this method to customize item ID generation.
load_thread
abstractmethod
async
load_thread(
thread_id: str, context: TContext
) -> ThreadMetadata
save_thread
abstractmethod
async
save_thread(
thread: ThreadMetadata, context: TContext
) -> None
load_thread_items
abstractmethod
async
load_thread_items(
thread_id: str,
after: str | None,
limit: int,
order: str,
context: TContext,
) -> Page[ThreadItem]
Load a page of thread items with pagination controls.
save_attachment
abstractmethod
async
save_attachment(
attachment: Attachment, context: TContext
) -> None
load_attachment
abstractmethod
async
load_attachment(
attachment_id: str, context: TContext
) -> Attachment
delete_attachment
abstractmethod
async
load_threads
abstractmethod
async
load_threads(
limit: int,
after: str | None,
order: str,
context: TContext,
) -> Page[ThreadMetadata]
Load a page of threads with pagination controls.
add_thread_item
abstractmethod
async
add_thread_item(
thread_id: str, item: ThreadItem, context: TContext
) -> None
save_item
abstractmethod
async
save_item(
thread_id: str, item: ThreadItem, context: TContext
) -> None
load_item
abstractmethod
async
load_item(
thread_id: str, item_id: str, context: TContext
) -> ThreadItem