Mistral AI TypeScript SDK

repository·main·Indexed 41 days ago

https://github.com/mistralai/client-ts

A type-safe, ESM-only TypeScript client library (v2.7.0) for accessing Mistral AI's Chat Completion, Embeddings, Agents, and File APIs. It provides both a standard client and a MistralCore implementation with standalone functions to optimize bundle size through better tree-shaking.

Tokens
488.5K
Snippets
1.5K
Records
1.9K
Agent score
96%

What's inside Mistral AI

  1. Overview of Classifiers API operations

    main

    The Classifiers API provides tools for content moderation and classification. The available operations are:

    • moderate: Performs moderations on text inputs.
    • moderateChat: Performs chat-based moderations.
    • classify: Performs text classifications.
    • classifyChat: Performs chat-based classifications.
  2. Overview of Mistral SDK Resources and Operations

    main

    The Mistral TypeScript Client provides access to a wide range of AI capabilities organized into several functional modules. Key resource groups include:

    • Core AI Tasks: Chat (completions and streaming), Embeddings, Classifiers (moderation and classification), Fim (Fill-in-the-middle), and Ocr.
    • Audio Services: Audio.Speech (text-to-speech), Audio.Transcriptions (speech-to-text with streaming support), and Audio.Voices (voice management).
    • Agentic & Conversational: Agents (completion and streaming), Beta.Agents (agent entity management), Beta.Conversations (managing conversation state and history), and Beta.Connectors (tool calling and authentication).
    • Data & Knowledge: Files (upload/download), Beta.Libraries (library and document management), Beta.Rag (search indexes and ingestion pipelines), and Beta.Observability.Datasets (dataset and record management).
    • Workflow Orchestration: Workflows (execution, deployments, schedules, and metrics) and Workflows.Executions (tracking and signaling workflow runs).
    • Observability: Beta.Observability modules for Logs, Spans, Traces, Judges, and Evaluations to monitor and assess AI performance.
    • Infrastructure & Management: Models (fine-tuning management), Batch.Jobs (asynchronous batch processing), Beta.ServiceAccounts (access control), and Beta.Users (identity and organization management).
  3. Overview of the MistralAzure SDK

    main
    The MistralAzure SDK is the TypeScript client designed specifically for accessing Mistral AI services hosted on Microsoft Azure. It provides programmatic access to Mistral AI's Chat Completion and Embeddings APIs within the Azure ecosystem. To use these services, you must have a Mistral AI account on La Plateforme and follow the Azure-specific integration guidelines provided in the official Mistral documentation.
  4. Overview of Beta Observability Datasets

    main
    The beta.observability.datasets namespace provides tools for managing datasets used in observability workflows. You can create, list, fetch, update, and delete datasets, as well as manage the records within them. The API also supports importing data from files, playground conversations, or other datasets, and exporting datasets to JSONL format.
  5. Available operations in Beta.Observability.Traces

    main

    The beta.observability.traces namespace provides several operations for managing and inspecting traces:

    • search: Search for specific traces.
    • aggregate: Aggregate trace data.
    • getTraceFields: Get trace field definitions.
    • getTraceById: Retrieve a specific trace by its ID.
    • getTraceSpans: Retrieve spans associated with a trace.
    • fetchOptions: Get options for a specific trace field.
    • getSpanById: Retrieve a specific span by its ID.
  6. Available Deployment Operations

    main

    The workflows.deployments namespace provides several operations to manage Mistral deployments:

    • listDeployments: List all deployments
    • createDeployment: Create a new deployment
    • updateDeployment: Update an existing deployment
    • deleteDeployment: Delete a deployment
    • getDeployment: Retrieve details for a specific deployment
    • stopDeployment: Stop a running deployment
    • startDeployment: Start a stopped deployment
    • restartDeployment: Restart a deployment
    • listDeploymentWorkers: List workers associated with a deployment
    • getDeploymentLogs: Retrieve deployment logs
    • streamDeploymentLogs: Stream deployment logs in real-time
  7. Available operations in Beta.Observability.Judges

    main

    The judges API provides the following operations for managing and running judges:

    • create: Create a new judge
    • list: Get judges with optional filtering and search
    • fetch: Get judge by id
    • delete: Delete a judge
    • update: Update a judge
    • judgeConversation: Run a saved judge on a conversation
  8. Manage connectors with the Beta.Connectors API

    main

    The beta.connectors namespace provides an API for managing connectors, which allow you to integrate MCP (Model Context Protocol) or HTTP servers with Mistral.

    Available operations include:

    • Lifecycle Management: create, get, update, delete.
    • Discovery: list, listTools, getAuthenticationMethods.
    • Sharing & Visibility: share, unshare, shareToOrganization, unshareFromOrganization, activateForConsumer, deactivateForConsumer.
    • Execution: callTool.
    • Credential Management: createCredentials, updateCredentials, listOrganizationCredentials, listWorkspaceCredentials, listUserCredentials, deleteOrganizationCredentials, deleteWorkspaceCredentials, deleteUserCredentials, deleteAllUserCredentials.
  9. Manage Mistral Observability Dataset Records

    main

    The beta.observability.datasets.records namespace provides operations to manage individual records within Mistral observability datasets.

    Available operations include:

    • fetch: Get the content of a specific dataset record.
    • delete: Delete a single record.
    • bulkDelete: Delete multiple records from datasets.
    • judge: Run a Judge operation on a dataset record based on provided options.
    • updatePayload: Update the payload of a dataset record.
    • updateProperties: Update the properties of a dataset record.
  10. Available operations in the Beta Agents API

    main

    The Beta Agents API provides several operations for managing agent entities and their versions:

    • create: Create a new agent.
    • listPages: List agent entities using cursor-based pagination (Recommended).
    • get: Retrieve a specific agent.
    • update: Update an existing agent.
    • delete: Delete an agent.
    • updateVersion: Update an agent version.
    • listVersions: List all versions of an agent.
    • getVersion: Retrieve a specific version of an agent.
    • createVersionAlias: Create or update an agent version alias.
    • listVersionAliases: List all aliases for an agent.
    • deleteVersionAlias: Delete an agent version alias.
    WARNING

    The list operation is Deprecated. Use listPages instead.