Service¶
unique_toolkit.agentic_table.service.AgenticTableService
¶
Provides methods to interact with the Agentic Table.
Attributes:
| Name | Type | Description |
|---|---|---|
#event |
ChatEvent
|
The ChatEvent object. |
logger |
Optional[Logger]
|
The logger object. Defaults to None. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
deregister_agent()
async
¶
Deregisters the agent for the Agentic Table by updating the sheet state to IDLE.
Raises:
| Type | Description |
|---|---|
LockedAgenticTableError
|
If the Agentic Table is busy. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
get_cell(row, column, include_row_metadata=True)
async
¶
Gets the value of a cell in the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
The row index. |
required |
column
|
int
|
The column index. |
required |
include_row_metadata
|
bool
|
Whether to include the row metadata. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
MagicTableCell |
MagicTableCell
|
The MagicTableCell object. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
get_num_rows()
async
¶
Gets the number of rows in the Agentic Table.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of rows in the Agentic Table. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
get_sheet(start_row=0, end_row=None, batch_size=100, include_log_history=False, include_cell_meta_data=False, include_row_metadata=False)
async
¶
Gets the sheet data from the Agentic Table paginated by batch_size.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_row
|
int
|
The start row (inclusive). |
0
|
end_row
|
int | None
|
The end row (not inclusive). |
None
|
batch_size
|
int
|
The batch size. |
100
|
include_log_history
|
bool
|
Whether to include the log history. |
False
|
include_cell_meta_data
|
bool
|
Whether to include the cell metadata (renderer, selection, agreement status). |
False
|
include_row_metadata
|
bool
|
Whether to include the row metadata (key value pairs). |
False
|
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |
get_sheet_metadata()
async
¶
Gets the sheet metadata from the Agentic Table.
Returns:
| Type | Description |
|---|---|
list[RowMetadataEntry]
|
list[RowMetadataEntry]: The sheet metadata. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
register_agent()
async
¶
Registers the agent for the Agentic Table by updating the sheet state to PROCESSING.
Raises:
| Type | Description |
|---|---|
LockedAgenticTableError
|
If the Agentic Table is busy. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_activity(text, activity, status=ActivityStatus.IN_PROGRESS)
async
¶
Sets the activity of the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
activity
|
str
|
The activity to set. |
required |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_artifact(artifact_type, content_id, mime_type, name)
async
¶
Upload/set report files to the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact_type
|
ArtifactType
|
The type of artifact to set. |
required |
content_id
|
str
|
The content ID of the artifact. |
required |
mime_type
|
str
|
The MIME type of the artifact. |
required |
name
|
str
|
The name of the artifact. |
required |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_cell(row, column, text, log_entries=None)
async
¶
Sets the value of a cell in the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
The row index. |
required |
column
|
int
|
The column index. |
required |
text
|
str
|
The text to set. |
required |
log_entries
|
Optional[list[LogEntry]]
|
The log entries to set. |
None
|
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_cell_metadata(row, column, selected=None, selection_method=None, agreement_status=None)
async
¶
Sets the cell metadata for the Agentic Table. NOTE: This is not to be confused with the sheet metadata and is associated rather with selection and agreement status, row locking etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
The row index. |
required |
column
|
int
|
The column index. |
required |
selected
|
bool | None
|
Whether the cell is selected. |
None
|
selection_method
|
SelectionMethod | None
|
The method of selection. |
None
|
agreement_status
|
AgreementStatus | None
|
The agreement status. |
None
|
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_column_style(column, width=None, cell_renderer=None, filter=None, editable=None)
async
¶
Sets the style of a column in the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
int
|
The column index. |
required |
width
|
int | None
|
The width of the column. Defaults to None. |
None
|
cell_renderer
|
CellRenderer | None
|
The cell renderer of the column. Defaults to None. |
None
|
filter
|
FilterComponents | None
|
The filter of the column. Defaults to None. |
None
|
editable
|
bool | None
|
Whether the column is editable. Defaults to None. |
None
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the column style is not set. |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
set_multiple_cells(cells, batch_size=4000)
async
¶
Sets the values of multiple cells in the Agentic Table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cells
|
list[MagicTableCell]
|
The cells to set sorted by row and column. |
required |
batch_size
|
int
|
Number of cells to set in a single request. |
4000
|
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
update_row_verification_status(row_orders, status)
async
¶
Update the verification status of multiple rows at once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row_orders
|
list[int]
|
The row indexes to update. |
required |
status
|
RowVerificationStatus
|
The verification status to set. |
required |
Source code in unique_toolkit/unique_toolkit/agentic_table/service.py
Schemas¶
Event¶
The primary event type is MagicTableEvent.
unique_toolkit.agentic_table.schemas.MagicTableEvent
pydantic-model
¶
Bases: ChatEvent
Fields:
-
id(str) -
user_id(str) -
company_id(str) -
created_at(Optional[int]) -
version(Optional[str])
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
Event Payload Schemas¶
All event payloads inherit from the MagicTableBasePayload schema.
unique_toolkit.agentic_table.schemas.MagicTableBasePayload
pydantic-model
¶
Bases: BaseModel, Generic[A, T]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
The following payload schemas correspond to the events listed above:
unique_toolkit.agentic_table.schemas.MagicTableUpdateCellPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[UPDATE_CELL], DDMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableAddMetadataPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[ADD_META_DATA], DDMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableGenerateArtifactPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[GENERATE_ARTIFACT], BaseMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableSheetCompletedPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[SHEET_COMPLETED], SheetCompletedMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableLibrarySheetRowVerifiedPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[LIBRARY_SHEET_ROW_VERIFIED], LibrarySheetRowVerifiedMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableSheetCreatedPayload
pydantic-model
¶
Bases: MagicTableBasePayload[Literal[SHEET_CREATED], SheetCreatedMetadata]
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
Supporting Schemas¶
unique_toolkit.agentic_table.schemas.BaseMetadata
pydantic-model
¶
Bases: BaseModel
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.DDMetadata
pydantic-model
¶
Bases: BaseMetadata
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.SheetCompletedMetadata
pydantic-model
¶
Bases: BaseMetadata
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.SheetCreatedMetadata
pydantic-model
¶
unique_toolkit.agentic_table.schemas.LibrarySheetRowVerifiedMetadata
pydantic-model
¶
unique_toolkit.agentic_table.schemas.ArtifactData
pydantic-model
¶
unique_toolkit.agentic_table.schemas.ArtifactType
¶
unique_toolkit.agentic_table.schemas.MagicTableCell
pydantic-model
¶
Bases: BaseModel
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.MagicTableSheet
pydantic-model
¶
Bases: BaseModel
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.LogEntry
pydantic-model
¶
Bases: BaseModel
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.LogDetail
pydantic-model
¶
Bases: BaseModel
Source code in unique_toolkit/unique_toolkit/agentic_table/schemas.py
unique_toolkit.agentic_table.schemas.RowMetadataEntry
pydantic-model
¶
Bases: BaseModel