Classes
Client
Client for interacting with the TopK API. For available regions see regions Methods Constructor| Parameter | Type |
|---|---|
api_key | str |
region | str |
host | str |
https | bool |
retry_config | Optional[RetryConfig | dict[str, Any]] |
collection()
| Parameter | Type |
|---|---|
collection | str |
CollectionClient
collections()
CollectionsClient
AsyncClient
Async client for interacting with the TopK API. For available regions see regions Methods Constructor| Parameter | Type |
|---|---|
api_key | str |
region | str |
host | str |
https | bool |
retry_config | Optional[RetryConfig | dict[str, Any]] |
collection()
| Parameter | Type |
|---|---|
collection | str |
AsyncCollectionClient
collections()
AsyncCollectionsClient
CollectionClient
Synchronous client for collection operations. Methodsget()
| Parameter | Type |
|---|---|
ids | Sequence[str] |
fields | Optional[Sequence[str]] |
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
count()
| Parameter | Type |
|---|---|
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
query()
| Parameter | Type |
|---|---|
query | query.Query |
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
upsert()
| Parameter | Type |
|---|---|
documents | Sequence[Mapping[str, Any]] |
update()
LSN at which the update was applied.
If no updates were applied, this will be empty.
Parameters
| Parameter | Type |
|---|---|
documents | Sequence[Mapping[str, Any]] |
fail_on_missing | Optional[bool] |
delete()
| Parameter | Type |
|---|---|
expr | Sequence[str] | query.LogicalExpr |
AsyncCollectionClient
Asynchronous client for collection operations. Methodsget()
| Parameter | Type |
|---|---|
ids | Sequence[str] |
fields | Optional[Sequence[str]] |
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
count()
| Parameter | Type |
|---|---|
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
query()
| Parameter | Type |
|---|---|
query | query.Query |
lsn | Optional[str] |
consistency | Optional[ConsistencyLevel] |
upsert()
| Parameter | Type |
|---|---|
documents | Sequence[Mapping[str, Any]] |
update()
LSN at which the update was applied.
If no updates were applied, this will be empty.
Parameters
| Parameter | Type |
|---|---|
documents | Sequence[Mapping[str, Any]] |
fail_on_missing | Optional[bool] |
delete()
| Parameter | Type |
|---|---|
expr | Sequence[str] | query.LogicalExpr |
Collection
Represents a collection in the TopK system. Properties| Property | Type | |
|---|---|---|
name | str | |
org_id | str | |
project_id | str | |
region | str | |
schema | dict[str, schema.FieldSpec] |
CollectionsClient
Synchronous client for managing collections. Methodsget()
| Parameter | Type |
|---|---|
collection_name | str |
Collection
list()
Collection]
create()
| Parameter | Type |
|---|---|
collection_name | str |
schema | Mapping[str, schema.FieldSpec] |
Collection
delete()
| Parameter | Type |
|---|---|
collection_name | str |
AsyncCollectionsClient
Asynchronous client for managing collections. Methodsget()
| Parameter | Type |
|---|---|
collection_name | str |
Collection]
list()
Collection]]
create()
| Parameter | Type |
|---|---|
collection_name | str |
schema | Mapping[str, schema.FieldSpec] |
Collection]
delete()
| Parameter | Type |
|---|---|
collection_name | str |
ConsistencyLevel
Enumeration of consistency levels for operations. Values| Value | Description |
|---|---|
Indexed | indexed |
Strong | strong |
RetryConfig
Configuration for retry behavior. By default, retries occur in two situations:- When the server requests the client to reduce its request rate, resulting in a SlowDownError.
- When using the
query(..., lsn=N)to wait for writes to be available.
| Property | Type | |
|---|---|---|
max_retries | Optional[int] | Maximum number of retries to attempt. Default is 3 retries. |
timeout | Optional[int] | The total timetout for the retry chain in milliseconds. Default is 30,000 milliseconds (30 seconds) |
backoff | Optional[BackoffConfig] | The backoff configuration for the client. |
| Parameter | Type |
|---|---|
max_retries | Optional[int] |
timeout | Optional[int] |
backoff | Optional[BackoffConfig] |
BackoffConfig
Configuration for backoff behavior in retries. Properties| Property | Type | |
|---|---|---|
base | Optional[int] | The base for the backoff. Default is 2x backoff. |
init_backoff | Optional[int] | The initial backoff in milliseconds. Default is 100 milliseconds. |
max_backoff | Optional[int] | The maximum backoff in milliseconds. Default is 10,000 milliseconds (10 seconds). |
| Parameter | Type |
|---|---|
base | Optional[int] |
init_backoff | Optional[int] |
max_backoff | Optional[int] |