Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 2.82 KB

File metadata and controls

58 lines (40 loc) · 2.82 KB

Fim

(fim)

Overview

Fill-in-the-middle API.

Available Operations

create

FIM completion.

Example Usage

import { MistralGoogleCloud } from "@mistralai/mistralai-gcp";

const MistralGoogleCloud = new MistralGoogleCloud({
  region: "europe-west4",
  projectId: process.env["GOOGLE_PROJECT_ID"],
});

async function run() {
  const result = await MistralGoogleCloud.fim.complete({
    model: "codestral-2405",
    prompt: "def",
    suffix: "return a+b",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

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

Errors

Error Object Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4xx-5xx /