Skip to content
Draft
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 .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,659 additions & 747 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,30 @@ 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
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 +58,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
27 changes: 13 additions & 14 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
speakeasyVersion: 1.606.10
speakeasyVersion: 1.681.0
sources:
mistral-azure-source:
sourceNamespace: mistral-openapi-azure
sourceRevisionDigest: sha256:670c460702ec74f7077491464a6dc5ee9d873969c80e812c48dbf4deb160e470
sourceBlobDigest: sha256:5a3ebfa4cb00a015bb7bb03ec7442fc7e0b9c17ca66ab35d3045290b2ad87eac
sourceRevisionDigest: sha256:fcc7262f29ef89a07cb718d7e6094c272627cf9f531588aef15a6e92dd50130a
sourceBlobDigest: sha256:9e6fc34474062726ceb96e424e858a0ae1b0506659cd11a58c72e1dd50dae885
tags:
- latest
mistral-google-cloud-source:
sourceNamespace: mistral-openapi-google-cloud
sourceRevisionDigest: sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8
sourceBlobDigest: sha256:3327f078a11596abdcbc21cd8a1adcf0b2aa474975cd9ab1feb745a2e50d555f
sourceRevisionDigest: sha256:bc59aaf55dc46e94ddf6cc687292807629d7a17ee5f573a504e7e44fd365e147
sourceBlobDigest: sha256:545fe85c5dae11def2741fc7a99f297b7f0728c9677c3c7b94d56ddbed70581d
tags:
- latest
mistral-openapi:
Expand All @@ -18,32 +18,31 @@ sources:
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
tags:
- latest
- speakeasy-sdk-regen-1765914268
targets:
mistralai-azure-sdk:
source: mistral-azure-source
sourceNamespace: mistral-openapi-azure
sourceRevisionDigest: sha256:670c460702ec74f7077491464a6dc5ee9d873969c80e812c48dbf4deb160e470
sourceBlobDigest: sha256:5a3ebfa4cb00a015bb7bb03ec7442fc7e0b9c17ca66ab35d3045290b2ad87eac
sourceRevisionDigest: sha256:fcc7262f29ef89a07cb718d7e6094c272627cf9f531588aef15a6e92dd50130a
sourceBlobDigest: sha256:9e6fc34474062726ceb96e424e858a0ae1b0506659cd11a58c72e1dd50dae885
codeSamplesNamespace: mistral-openapi-azure-code-samples
codeSamplesRevisionDigest: sha256:e6802c97fd9783aa91cc0853de1a889944f699b88e0dafcf9fecd83de6e2c6c9
codeSamplesRevisionDigest: sha256:c01681b7fafd643cd608f569863a4f2be4e46a4a156d3ee877d36d90f91078e9
mistralai-gcp-sdk:
source: mistral-google-cloud-source
sourceNamespace: mistral-openapi-google-cloud
sourceRevisionDigest: sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8
sourceBlobDigest: sha256:3327f078a11596abdcbc21cd8a1adcf0b2aa474975cd9ab1feb745a2e50d555f
sourceRevisionDigest: sha256:bc59aaf55dc46e94ddf6cc687292807629d7a17ee5f573a504e7e44fd365e147
sourceBlobDigest: sha256:545fe85c5dae11def2741fc7a99f297b7f0728c9677c3c7b94d56ddbed70581d
codeSamplesNamespace: mistral-openapi-google-cloud-code-samples
codeSamplesRevisionDigest: sha256:03b3e82c20d10faa8622f14696632b96b1a2e8d747b266fff345061298d5f3e4
codeSamplesRevisionDigest: sha256:09ffc080d6c15263774be0f3ff05ca02928bbc28224cf4e720254aa91852c9e0
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:cb63bd997cefe7b3b36e91a475df57cb779bf79f183340e0713d8ffb16a2dabc
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:b1eacff97275a14ab0c2143e07bdfa4f4bd58f5370b2f106bcc6ada92b754d08
codeSamplesRevisionDigest: sha256:787c3614f1d0b8c10d93a11289117cb8dfd95da61ebfeb3754bc23fe8615f4f0
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.606.10
speakeasyVersion: 1.681.0
sources:
mistral-azure-source:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
workflowVersion: 1.0.0
speakeasyVersion: 1.606.10
speakeasyVersion: 1.681.0
sources:
mistral-azure-source:
inputs:
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
Loading