(fim)
Fill-in-the-middle API.
- create - Fim Completion
FIM completion.
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();
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. |
Promise<components.FIMCompletionResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.HTTPValidationError | 422 | application/json |
errors.SDKError | 4xx-5xx | / |