## 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.

### Parameters

- `dataset_id: str`

### Returns

- `class RetrievalIndex: …`

  - `dataset_id: str`

  - `status: Literal["pending", "running", "succeeded", "failed"]`

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

    - `"pending"`

    - `"running"`

    - `"succeeded"`

    - `"failed"`

  - `error: Optional[str]`

    Why indexing failed. Present only when `status` is `failed`.

### Example

```python
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)
```

#### Response

```json
{
  "dataset_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "status": "pending",
  "error": "error"
}
```
