Skip to content

Latest commit

 

History

History
182 lines (119 loc) · 10.3 KB

File metadata and controls

182 lines (119 loc) · 10.3 KB

Beta.Rag.SearchIndexes

Overview

Available Operations

get_deployment_summaries

Fetch all indexes available to a user

Example Usage

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_deployment_summaries()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetDeploymentSummariesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

register_deployment

Register (or re-register) a search index

Example Usage

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_deployment(name="<value>", deployment={
        "type": "vespa",
        "vespa_version": "<value>",
        "indexes": [],
        "query_url": "https://joyful-granny.info",
    }, status="offline")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
name str ✔️ N/A
deployment models.RegisterDeploymentRequestDeploymentDeployment ✔️ N/A
status Optional[models.RegisterDeploymentRequestDeploymentStatus] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.RegisterSearchIndexResponseIndex

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

unregister_deployment

Delete all information about a deployment

Example Usage

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_deployment(deployment_id="240a5e63-fd68-4806-8290-04cce22b4c37")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
deployment_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

update_index_metrics

Update the metrics for a given index

Example Usage

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(deployment_id="b0c2f463-8aef-437d-83ac-d4bfae874584", request_body={
        "status": "offline",
        "clear_metrics": False,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
deployment_id str ✔️ N/A
request_body models.MetricsData ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*