Reference
Types
Every result the SDK returns, with its fields in Python and TypeScript.
Every SDK call returns a typed object. In Python, results are typed models with attribute access. In TypeScript, they're plain objects with exported types.
DockIngestResult
Returned by flush and flush_sync.
| Python | TypeScript | Type | Description |
|---|---|---|---|
batch_id | batchId | string | The ID of the batch. Quote it to support. |
accepted | accepted | number | Events stored. |
rejected | rejected | number | Events not stored. |
errors | errors | list | One entry per rejected event, with index, error, and message. |
KnowledgeResult
Returned by query and query_sync without stream.
| Python | TypeScript | Type | Description |
|---|---|---|---|
answer | answer | string | The answer, written from your sources. |
confidence | confidence | number | How well the sources support the answer, from 0 to 1. |
citations | citations | list of Citation | The chunks the answer is based on. |
engine_id | engineId | string | The engine that answered. |
Citation
| Python | TypeScript | Type | Description |
|---|---|---|---|
chunk_id | chunkId | string | The chunk the answer drew on. |
page_number | pageNumber | number or null | The page in the source, when it has pages. |
KnowledgeChunk
Returned by retrieve and retrieve_sync, best match first.
| Python | TypeScript | Type | Description |
|---|---|---|---|
chunk_id | chunkId | string | The chunk's ID. |
content | content | string | The chunk's text. |
metadata | metadata | object | The metadata stored with the chunk. |
MemoryRecord
Returned by recall and recall_sync, best match first.
| Python | TypeScript | Type | Description |
|---|---|---|---|
memory_id | memoryId | string | The memory's ID. |
content | content | string | The remembered text. |
memory_type | memoryType | string | The storage class. See Memory types. |
confidence | confidence | number | How strongly the memory answers the query, from 0 to 1. |
Option types in TypeScript
| Type | Describes |
|---|---|
DockConfig | The options for new Dock(). See Configuration. |
LynkConfig | The options for new Lynk(). See Configuration. |
Next steps
You know every result. See what happens when a call fails next.