Installation
Prerequisites
- API key — sign in to console.topk.io and generate an API key.
- Region — available regions are listed at docs.topk.io/regions.
Usage
Async usage
Simply importAsyncClient instead of Client and use await with each API call:
Handling errors
| Error | Description |
|---|---|
CollectionNotFoundError | Collection does not exist |
CollectionAlreadyExistsError | Collection with this name already exists |
CollectionValidationError | Invalid collection name or schema |
DatasetNotFoundError | Dataset does not exist |
DatasetAlreadyExistsError | Dataset with this name already exists |
DocumentValidationError | Invalid document |
SchemaValidationError | Invalid schema |
PermissionDeniedError | Invalid or missing API key |
QuotaExceededError | Usage quota exceeded |
RequestTooLargeError | Request payload too large |
SlowDownError | Rate limited by the server (retried automatically) |
QueryLsnTimeoutError | Timed out waiting for write consistency |
Retries
The client automatically retries onSlowDownError and on LSN consistency
timeouts. Retry behaviour can be configured via RetryConfig: