Skip to content
SupportLogin
Get the retrieval index status of a dataset

Get the retrieval index status of a dataset

datasets.get_retrieval_index(strdataset_id) -> RetrievalIndex
GET/api/v1/datasets/{dataset_id}/retrieval-index

Poll after POST /datasets/{dataset_id}/retrieval-index. Once status is succeeded, the dataset can be searched with file_search on POST /responses. A failed index carries an error; repeat the POST to retry it.

ParametersExpand Collapse
dataset_id: str
ReturnsExpand Collapse
class RetrievalIndex: …
dataset_id: str
formatuuid
status: Literal["pending", "running", "succeeded", "failed"]

The dataset can be searched with file_search once this is succeeded.

One of the following:
"pending"
"running"
"succeeded"
"failed"
error: Optional[str]

Why indexing failed. Present only when status is failed.

Get the retrieval index status of a dataset

import os
from adaption import Adaption

client = Adaption(
    api_key=os.environ.get("ADAPTION_API_KEY"),  # This is the default and can be omitted
)
retrieval_index = client.datasets.get_retrieval_index(
    "dataset_id",
)
print(retrieval_index.dataset_id)
{
  "dataset_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "status": "pending",
  "error": "error"
}
Returns Examples
{
  "dataset_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "status": "pending",
  "error": "error"
}