# Workflows.Deployments ## Overview ### Available Operations * [listDeployments](#listdeployments) - List Deployments * [getDeployment](#getdeployment) - Get Deployment * [getDeploymentLogs](#getdeploymentlogs) - Get Deployment Logs * [streamDeploymentLogs](#streamdeploymentlogs) - Stream Deployment Logs ## listDeployments List Deployments ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.workflows.deployments.listDeployments({}); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { workflowsDeploymentsListDeployments } from "@mistralai/mistralai/funcs/workflowsDeploymentsListDeployments.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 workflowsDeploymentsListDeployments(mistral, {}); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("workflowsDeploymentsListDeployments failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ListDeploymentsV1WorkflowsDeploymentsGetRequest](../../models/operations/listdeploymentsv1workflowsdeploymentsgetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.DeploymentListResponse](../../models/components/deploymentlistresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## getDeployment Get Deployment ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.workflows.deployments.getDeployment({ name: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { workflowsDeploymentsGetDeployment } from "@mistralai/mistralai/funcs/workflowsDeploymentsGetDeployment.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 workflowsDeploymentsGetDeployment(mistral, { name: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("workflowsDeploymentsGetDeployment failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetDeploymentV1WorkflowsDeploymentsNameGetRequest](../../models/operations/getdeploymentv1workflowsdeploymentsnamegetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.DeploymentDetailResponse](../../models/components/deploymentdetailresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## getDeploymentLogs Retrieve logs for a deployment (across all of its workers). Use `after`/`before`/`order` on the first request to set the time range and sort order; for the next pages pass the `cursor` from the previous response (it remembers the range and order). ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.workflows.deployments.getDeploymentLogs({ name: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { workflowsDeploymentsGetDeploymentLogs } from "@mistralai/mistralai/funcs/workflowsDeploymentsGetDeploymentLogs.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 workflowsDeploymentsGetDeploymentLogs(mistral, { name: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("workflowsDeploymentsGetDeploymentLogs failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetDeploymentLogsRequest](../../models/operations/getdeploymentlogsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.DeploymentLogSearchResponse](../../models/components/deploymentlogsearchresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## streamDeploymentLogs Stream logs for a deployment (all of its workers) via SSE. Resume cursor comes from the `Last-Event-ID` header or `last_event_id` query param (header wins) and takes precedence over `after`; omit all to tail from the deployment start. ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.workflows.deployments.streamDeploymentLogs({ name: "", }); for await (const event of result) { console.log(event); } } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { workflowsDeploymentsStreamDeploymentLogs } from "@mistralai/mistralai/funcs/workflowsDeploymentsStreamDeploymentLogs.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 workflowsDeploymentsStreamDeploymentLogs(mistral, { name: "", }); if (res.ok) { const { value: result } = res; for await (const event of result) { console.log(event); } } else { console.log("workflowsDeploymentsStreamDeploymentLogs failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.StreamDeploymentLogsRequest](../../models/operations/streamdeploymentlogsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[EventStream](../../models/.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* |