This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/@mistralai/mistralai/docs/sdks/libraries

Libraries

(beta.libraries)

Overview

(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.

Available Operations

  • 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

List all libraries that you have created or have been shared with you.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.libraries.list();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaLibrariesList } from "@mistralai/mistralai/funcs/betaLibrariesList.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await betaLibrariesList(mistral);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("betaLibrariesList failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListLibraryOut>

Errors

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

create

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.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.libraries.create({
    name: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaLibrariesCreate } from "@mistralai/mistralai/funcs/betaLibrariesCreate.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await betaLibrariesCreate(mistral, {
    name: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("betaLibrariesCreate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request components.LibraryIn ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.LibraryOut>

Errors

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

get

Given a library id, details information about that Library.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.libraries.get({
    libraryId: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaLibrariesGet } from "@mistralai/mistralai/funcs/betaLibrariesGet.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await betaLibrariesGet(mistral, {
    libraryId: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("betaLibrariesGet failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LibrariesGetV1Request ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.LibraryOut>

Errors

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

delete

Given a library id, deletes it together with all documents that have been uploaded to that library.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.libraries.delete({
    libraryId: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaLibrariesDelete } from "@mistralai/mistralai/funcs/betaLibrariesDelete.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await betaLibrariesDelete(mistral, {
    libraryId: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("betaLibrariesDelete failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LibrariesDeleteV1Request ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.LibraryOut>

Errors

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

update

Given a library id, you can update the name and description.

Example Usage

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.libraries.update({
    libraryId: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4",
    libraryInUpdate: {},
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaLibrariesUpdate } from "@mistralai/mistralai/funcs/betaLibrariesUpdate.js";

// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const res = await betaLibrariesUpdate(mistral, {
    libraryId: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4",
    libraryInUpdate: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("betaLibrariesUpdate failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LibrariesUpdateV1Request ✔️ The request object to use for the request.
options RequestOptions ➖ Used to set various options for making HTTP requests.
options.fetchOptions RequestInit ➖ Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig ➖ Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.LibraryOut>

Errors

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