(beta.libraries)
(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.
- list - List all libraries you have access to.
- create - Create a new Library.
- get - Detailed information about a specific Library.
- delete - Delete a library and all of it's document.
- update - Update a library.
List all libraries that you have created or have been shared with you.
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.list()
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListLibraryOut
| Error Type |
Status Code |
Content Type |
| models.SDKError |
4XX, 5XX |
*/* |
Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you.
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.create(name="<value>")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
name |
str |
✔️ |
N/A |
description |
OptionalNullable[str] |
➖ |
N/A |
chunk_size |
OptionalNullable[int] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.LibraryOut
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Given a library id, details information about that Library.
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.get(library_id="d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
library_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.LibraryOut
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Given a library id, deletes it together with all documents that have been uploaded to that library.
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.delete(library_id="6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
library_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.LibraryOut
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Given a library id, you can update the name and description.
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.update(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
library_id |
str |
✔️ |
N/A |
name |
OptionalNullable[str] |
➖ |
N/A |
description |
OptionalNullable[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.LibraryOut
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |