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] | :heavy_minus_sign: | 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 | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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)
| Parameter | Type | Required | Description |
|---|
index_id | str | :heavy_check_mark: | N/A |
request_body | models.MetricsData | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
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 | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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 | */* |
Retrieve the summary field for an index if it exists
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_summary(index_id="d83e93f2-1d03-4133-90d2-fae51463c71e", language="pt_br")
# Handle response
print(res)
models.GetSummaryResponseSummary
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Streams a summary for the index in chunks of json.
The first chunk contains metadata for the summary, the following contain
chunks of 'content' that should be joined together to form a full summary.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.generate_index_summary(index_id="b0cfd77c-9cc3-46b6-ad70-1024386259b9", language="pl")
with res as jsonl_stream:
for event in jsonl_stream:
# handle event
print(event, flush=True)
Union[jsonl.JsonLStream[models.GenerateIndexSummaryV1RagIndexesIndexIndexIDSummaryFieldLanguagePostSummaryStreamTypes], jsonl.JsonLStreamAsync[models.GenerateIndexSummaryV1RagIndexesIndexIndexIDSummaryFieldLanguagePostSummaryStreamTypes]]
| 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="e199a723-75b3-43fe-98fb-5d576435c591", language="pt_br", content="<value>", status="handwritten", translated=True)
# Handle response
print(res)
Any
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Retrieve the summary field for a schema if it exists
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_schema_summary(index_id="077fb72c-10cd-442d-832e-51fd35136195", schema_id="39f80401-7fc3-4ade-8b1c-b2cd613bab20", language="en")
# Handle response
print(res)
models.GetSummaryResponseSummary
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Streams a summary for the schema in chunks of json.
The first chunk contains metadata for the summary, the following contain
chunks of 'content' that should be joined together to form a full summary.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.rag.search_indexes.generate_schema_summary(index_id="582076c8-276e-4a50-b7a6-2f266925a448", schema_id="5c471724-f36e-41cc-a302-af4f92ea7413", language="it")
with res as jsonl_stream:
for event in jsonl_stream:
# handle event
print(event, flush=True)
Union[jsonl.JsonLStream[models.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIDSchemasSchemaSchemaIDSummaryFieldLanguagePostSummaryStreamTypes], jsonl.JsonLStreamAsync[models.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIDSchemasSchemaSchemaIDSummaryFieldLanguagePostSummaryStreamTypes]]
| 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="d22ebdfa-6465-4f25-9a27-3e59d85ee544", schema_id="cc29f795-986b-483d-a658-acb000a16f70", language="nl", content="<value>", status="generated_confirmed", translated=True)
# Handle response
print(res)
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 | :heavy_check_mark: | N/A |
schema_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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 | */* |
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 | :heavy_check_mark: | N/A |
schema_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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 | :heavy_check_mark: | N/A |
schema_id | str | :heavy_check_mark: | N/A |
document_id | str | :heavy_check_mark: | the native ID in the underlying index |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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 | :heavy_check_mark: | N/A |
schema_id | str | :heavy_check_mark: | N/A |
group_id | OptionalNullable[str] | :heavy_minus_sign: | Only retrieve from this group |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | 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 | */* |