Register (or re-register) a search index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.register(name="<value>", index={
"type": "vespa",
"k8s_cluster": "<value>",
"k8s_namespace": "<value>",
"vespa_instance_name": "<value>",
"vespa_version": "<value>",
"schemas": [
{
"name": "<value>",
"fields": [],
"sd": "<value>",
},
],
"query_url": "https://shiny-range.com/",
}, status="offline")
# Handle response
print(res)
models.RegisterSearchIndexResponseIndex
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Fetch summary view of all indexes available to a user
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.get_index_summaries()
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
List[models.GetSearchIndexSummaryResponseIndex]
| Error Type |
Status Code |
Content Type |
| errors.SDKError |
4XX, 5XX |
*/* |
Delete all information about an index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.unregister(index_id="0e59f390-f2e4-428e-a81c-c9c2f2ced09e")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Update the metrics for a given index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.update_index_metrics(index_id="cb562a81-38ce-49a7-86ec-592676de32a8", request_body={
"status": "online",
"document_count": 864436,
"schema_metrics": [
{
"name": "<value>",
"document_count": 109412,
},
],
})
# Handle response
print(res)
Any
| Error Type |
Status Code |
Content Type |
| errors.SDKError |
4XX, 5XX |
*/* |
Get a detailed view of the stored data for a single index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.get_index_detail(index_id="f6ffec01-1f00-47ec-bf94-a08bdc049edc")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.GetSearchIndexDetailResponseIndex
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Update the summary field for an index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.set_index_summary(index_id="e77375ab-1284-42f3-9224-d42f3c120e57", summary="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
summary |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Get a detailed view of the stored information for a schema
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.get_index_schema_detail(index_id="af850b81-3290-4f41-83af-f0d2ac1b070d", schema_id="fc2825a7-a8ef-4bec-9729-f7486e8327cb")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
schema_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.GetSearchIndexSchemaDetailResponseSchemaModel
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Update the summary field for an index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.set_schema_summary(index_id="1a7d0662-5542-453a-8120-6e22a4fa6187", schema_id="bb5f0528-b652-4c47-81eb-574cb5c442a5", summary="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
schema_id |
str |
✔️ |
N/A |
summary |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
Any
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Get Index Schema File
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.get_index_schema_file(index_id="252c6de5-4c9b-43b5-8c30-54524a59cb57", schema_id="93166e46-2e3c-4b20-b9a5-8607304372d2")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
schema_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.GetSearchIndexSchemaSDFileResponseSDFile
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Fetch stored information about a retrievable element stored in an index
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.document_lookup(index_id="77308a24-2d8e-4392-9ab4-38770b2bb993", schema_id="1fe735e7-4ec0-4264-b715-12a944fe2b87", document_id="<id>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
schema_id |
str |
✔️ |
N/A |
document_id |
str |
✔️ |
the native ID in the underlying index |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VespaGetRetrievableResponseRetrievable
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Fetch a few stored retrievable elements from the index/schema
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.documents_fetch(index_id="7c9f7007-1a54-48fd-b6da-93e91f31f6aa", schema_id="7eb7703c-1b80-4ecc-8a8b-288b43e1f30e")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
index_id |
str |
✔️ |
N/A |
schema_id |
str |
✔️ |
N/A |
group_id |
OptionalNullable[str] |
➖ |
Only retrieve from this group |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
List[models.VespaGetRetrievableResponseRetrievable]
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |