Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .genignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ examples/*
src/mistral/extra/*
pylintrc
scripts/prepare_readme.py
src/mistralai/workflows/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env.local
.idea
**/__pycache__/
**/.speakeasy/temp/
Expand Down
4,406 changes: 3,658 additions & 748 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,32 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
persistentEdits: {}
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 1.10.0
version: 1.11.0
additionalDependencies:
dev:
pytest: ^8.2.2
pytest-asyncio: ^0.23.7
main:
mistral-workflows: ^1.2.2
allowedRedefinedBuiltins:
- id
- object
asyncMode: both
authors:
- Mistral
baseErrorName: MistralError
clientServerStatusCodesAsErrors: true
constFieldCasing: upper
defaultErrorName: SDKError
description: Python Client SDK for the Mistral AI API.
enableCustomCodeRegions: true
Expand All @@ -51,14 +60,19 @@ python:
operations: ""
shared: ""
webhooks: ""
inferUnionDiscriminators: true
inputModelSuffix: input
license: ""
maxMethodParams: 15
methodArguments: infer-optional-args
moduleName: ""
multipartArrayFormat: legacy
outputModelSuffix: output
packageManager: uv
packageName: mistralai
preApplyUnionDiscriminators: false
pytestFilterWarnings: []
pytestTimeout: 0
responseFormat: flat
sseFlatResponse: false
templateVersion: v2
5 changes: 2 additions & 3 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.606.10
speakeasyVersion: 1.683.1
sources:
mistral-azure-source:
sourceNamespace: mistral-openapi-azure
Expand All @@ -18,7 +18,6 @@ sources:
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
tags:
- latest
- speakeasy-sdk-regen-1765914268
targets:
mistralai-azure-sdk:
source: mistral-azure-source
Expand All @@ -40,7 +39,7 @@ targets:
sourceRevisionDigest: sha256:cb63bd997cefe7b3b36e91a475df57cb779bf79f183340e0713d8ffb16a2dabc
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:b1eacff97275a14ab0c2143e07bdfa4f4bd58f5370b2f106bcc6ada92b754d08
codeSamplesRevisionDigest: sha256:9bb041f76008838d352cc0430f21f652bc595d8ddd28f80f36ab1ac143c194ae
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.606.10
Expand Down
67 changes: 33 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with either *pip* or *uv* package managers.
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.

### uv

*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

```bash
uv add mistralai
```

### PIP

Expand All @@ -68,12 +76,12 @@ The SDK can be installed with either *pip* or *uv* package managers.
pip install mistralai
```

### UV
### Poetry

*UV* is an extremely fast Python package and project manager. You can use it to add the SDK to your project:
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.

```bash
uv add mistralai
poetry add mistralai
```

### Shell and script usage with `uv`
Expand All @@ -89,7 +97,7 @@ It's also possible to write a standalone Python script without needing to set up
```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.9"
# dependencies = [
# "mistralai",
# ]
Expand Down Expand Up @@ -152,6 +160,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -205,6 +214,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -258,6 +268,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -311,6 +322,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -436,33 +448,24 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
<details open>
<summary>Available methods</summary>

### [agents](docs/sdks/agents/README.md)
### [Agents](docs/sdks/agents/README.md)

* [complete](docs/sdks/agents/README.md#complete) - Agents Completion
* [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion

### [audio](docs/sdks/audio/README.md)


#### [audio.transcriptions](docs/sdks/transcriptions/README.md)
### [Audio.Transcriptions](docs/sdks/transcriptions/README.md)

* [complete](docs/sdks/transcriptions/README.md#complete) - Create Transcription
* [stream](docs/sdks/transcriptions/README.md#stream) - Create Streaming Transcription (SSE)

### [batch](docs/sdks/batch/README.md)


#### [batch.jobs](docs/sdks/mistraljobs/README.md)
### [Batch.Jobs](docs/sdks/mistraljobs/README.md)

* [list](docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs
* [create](docs/sdks/mistraljobs/README.md#create) - Create Batch Job
* [get](docs/sdks/mistraljobs/README.md#get) - Get Batch Job
* [cancel](docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job

### [beta](docs/sdks/beta/README.md)


#### [beta.agents](docs/sdks/mistralagents/README.md)
### [Beta.Agents](docs/sdks/mistralagents/README.md)

* [create](docs/sdks/mistralagents/README.md#create) - Create a agent that can be used within a conversation.
* [list](docs/sdks/mistralagents/README.md#list) - List agent entities.
Expand All @@ -471,7 +474,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [delete](docs/sdks/mistralagents/README.md#delete) - Delete an agent entity.
* [update_version](docs/sdks/mistralagents/README.md#update_version) - Update an agent version.

#### [beta.conversations](docs/sdks/conversations/README.md)
### [Beta.Conversations](docs/sdks/conversations/README.md)

* [start](docs/sdks/conversations/README.md#start) - Create a conversation and append entries to it.
* [list](docs/sdks/conversations/README.md#list) - List all created conversations.
Expand All @@ -485,21 +488,21 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [append_stream](docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation.
* [restart_stream](docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry.

#### [beta.libraries](docs/sdks/libraries/README.md)
### [Beta.Libraries](docs/sdks/libraries/README.md)

* [list](docs/sdks/libraries/README.md#list) - List all libraries you have access to.
* [create](docs/sdks/libraries/README.md#create) - Create a new Library.
* [get](docs/sdks/libraries/README.md#get) - Detailed information about a specific Library.
* [delete](docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document.
* [update](docs/sdks/libraries/README.md#update) - Update a library.

#### [beta.libraries.accesses](docs/sdks/accesses/README.md)
#### [Beta.Libraries.Accesses](docs/sdks/accesses/README.md)

* [list](docs/sdks/accesses/README.md#list) - List all of the access to this library.
* [update_or_create](docs/sdks/accesses/README.md#update_or_create) - Create or update an access level.
* [delete](docs/sdks/accesses/README.md#delete) - Delete an access level.

#### [beta.libraries.documents](docs/sdks/documents/README.md)
#### [Beta.Libraries.Documents](docs/sdks/documents/README.md)

* [list](docs/sdks/documents/README.md#list) - List documents in a given library.
* [upload](docs/sdks/documents/README.md#upload) - Upload a new document.
Expand All @@ -512,23 +515,23 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [extracted_text_signed_url](docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document.
* [reprocess](docs/sdks/documents/README.md#reprocess) - Reprocess a document.

### [chat](docs/sdks/chat/README.md)
### [Chat](docs/sdks/chat/README.md)

* [complete](docs/sdks/chat/README.md#complete) - Chat Completion
* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion

### [classifiers](docs/sdks/classifiers/README.md)
### [Classifiers](docs/sdks/classifiers/README.md)

* [moderate](docs/sdks/classifiers/README.md#moderate) - Moderations
* [moderate_chat](docs/sdks/classifiers/README.md#moderate_chat) - Chat Moderations
* [classify](docs/sdks/classifiers/README.md#classify) - Classifications
* [classify_chat](docs/sdks/classifiers/README.md#classify_chat) - Chat Classifications

### [embeddings](docs/sdks/embeddings/README.md)
### [Embeddings](docs/sdks/embeddings/README.md)

* [create](docs/sdks/embeddings/README.md#create) - Embeddings

### [files](docs/sdks/files/README.md)
### [Files](docs/sdks/files/README.md)

* [upload](docs/sdks/files/README.md#upload) - Upload File
* [list](docs/sdks/files/README.md#list) - List Files
Expand All @@ -537,24 +540,20 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [download](docs/sdks/files/README.md#download) - Download File
* [get_signed_url](docs/sdks/files/README.md#get_signed_url) - Get Signed Url

### [fim](docs/sdks/fim/README.md)
### [Fim](docs/sdks/fim/README.md)

* [complete](docs/sdks/fim/README.md#complete) - Fim Completion
* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion

### [fine_tuning](docs/sdks/finetuning/README.md)


#### [fine_tuning.jobs](docs/sdks/jobs/README.md)
### [FineTuning.Jobs](docs/sdks/jobs/README.md)

* [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
* [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
* [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
* [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
* [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job


### [models](docs/sdks/models/README.md)
### [Models](docs/sdks/models/README.md)

* [list](docs/sdks/models/README.md#list) - List Models
* [retrieve](docs/sdks/models/README.md#retrieve) - Retrieve Model
Expand All @@ -563,7 +562,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [archive](docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
* [unarchive](docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model

### [ocr](docs/sdks/ocr/README.md)
### [Ocr](docs/sdks/ocr/README.md)

* [process](docs/sdks/ocr/README.md#process) - OCR

Expand Down
4 changes: 4 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -82,6 +83,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -135,6 +137,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down Expand Up @@ -188,6 +191,7 @@ with Mistral(
</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand Down
3 changes: 1 addition & 2 deletions docs/sdks/accesses/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Accesses
(*beta.libraries.accesses*)
# Beta.Libraries.Accesses

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/agents/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Agents
(*agents*)

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/chat/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Chat
(*chat*)

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/classifiers/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Classifiers
(*classifiers*)

## Overview

Expand Down
3 changes: 1 addition & 2 deletions docs/sdks/conversations/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Conversations
(*beta.conversations*)
# Beta.Conversations

## Overview

Expand Down
3 changes: 1 addition & 2 deletions docs/sdks/documents/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Documents
(*beta.libraries.documents*)
# Beta.Libraries.Documents

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/embeddings/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Embeddings
(*embeddings*)

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/files/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Files
(*files*)

## Overview

Expand Down
1 change: 0 additions & 1 deletion docs/sdks/fim/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Fim
(*fim*)

## Overview

Expand Down
3 changes: 1 addition & 2 deletions docs/sdks/jobs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Jobs
(*fine_tuning.jobs*)
# FineTuning.Jobs

## Overview

Expand Down
Loading
Loading