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/transcriptions

Transcriptions

(audio.transcriptions)

Overview

API for audio transcription.

Available Operations

  • complete - Create Transcription
  • stream - Create streaming transcription (SSE)

complete

Create Transcription

Example Usage

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

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

async function run() {
  const result = await mistral.audio.transcriptions.complete({
    model: "Model X",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { audioTranscriptionsComplete } from "@mistralai/mistralai/funcs/audioTranscriptionsComplete.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 audioTranscriptionsComplete(mistral, {
    model: "Model X",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("audioTranscriptionsComplete failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request components.AudioTranscriptionRequest ✔️ 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.TranscriptionResponse>

Errors

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

stream

Create streaming transcription (SSE)

Example Usage

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

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

async function run() {
  const result = await mistral.audio.transcriptions.stream({
    model: "Camry",
  });

  for await (const event of result) {
    // Handle the event
    console.log(event);
  }
}

run();

Standalone function

The standalone function version of this method:

import { MistralCore } from "@mistralai/mistralai/core.js";
import { audioTranscriptionsStream } from "@mistralai/mistralai/funcs/audioTranscriptionsStream.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 audioTranscriptionsStream(mistral, {
    model: "Camry",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const event of result) {
    // Handle the event
    console.log(event);
  }
  } else {
    console.log("audioTranscriptionsStream failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request components.AudioTranscriptionRequestStream ✔️ 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<EventStream<components.TranscriptionStreamEvents>>

Errors

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