Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/lint_custom_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6

- name: Install dependencies
run: |
touch README-PYPI.md
poetry install --all-extras
uv sync --all-extras

# The init, sdkhooks.py and types.py files in the _hooks folders are generated by Speakeasy hence the exclusion
- name: Run all linters
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run_example_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6

- name: Set VERSION
run: |
Expand All @@ -40,13 +40,13 @@ jobs:
- name: Build the package
run: |
touch README-PYPI.md # Create this file since the client is not built by Speakeasy
poetry build
uv build

- name: For python 3.9, install the client and run examples without extra dependencies.
if: matrix.python-version == '3.9'
run: |
PACKAGE="dist/$(ls dist | grep whl | head -n 1)"
python3 -m pip install "$PACKAGE"
uv pip install --system "$PACKAGE"
./scripts/run_examples.sh --no-extra-dep
env:
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}
Expand All @@ -56,7 +56,7 @@ jobs:
if: matrix.python-version != '3.9'
run: |
PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]"
python3 -m pip install "$PACKAGE"
uv pip install --system "$PACKAGE"
./scripts/run_examples.sh
env:
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/test_custom_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,13 @@ jobs:
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6

- name: Install dependencies
# Install dependencies if cache does not exist
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
run: |
touch README-PYPI.md
uv sync --all-extras

- name: Run the 'src/mistralai/extra' package unit tests
run: |
source .venv/bin/activate
python3.12 -m unittest discover -s src/mistralai/extra/tests -t src
run: uv run python3.12 -m unittest discover -s src/mistralai/extra/tests -t src
12 changes: 4 additions & 8 deletions .github/workflows/update_speakeasy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ jobs:
with:
python-version: '3.11'

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6

- name: Install dependencies
run: |
cp README.md README-PYPI.md
poetry install --with dev
uv sync --group dev --no-default-groups

- name: Install Speakeasy CLI
run: |
Expand All @@ -70,7 +66,7 @@ jobs:
TARGETS_ARGS="$TARGETS_ARGS --targets $target"
done

poetry run inv update-speakeasy \
uv run inv update-speakeasy \
--version "${{ github.event.inputs.version }}" \
$TARGETS_ARGS
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
**/__pycache__/
**/.speakeasy/temp/
**/.speakeasy/logs/
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ python:
methodArguments: infer-optional-args
moduleName: ""
outputModelSuffix: output
packageManager: poetry
packageManager: uv
packageName: mistralai
pytestFilterWarnings: []
pytestTimeout: 0
Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,7 @@ 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 *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
```
The SDK can be installed with either *pip* or *uv* package managers.

### PIP

Expand All @@ -76,12 +68,12 @@ uv add mistralai
pip install mistralai
```

### Poetry
### UV

*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.
*UV* is an extremely fast Python package and project manager. You can use it to add the SDK to your project:

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

### Shell and script usage with `uv`
Expand Down Expand Up @@ -347,7 +339,7 @@ asyncio.run(main())

### More examples

You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`.
You can run the examples in the `examples/` directory using `uv run`.


## Providers' SDKs Example Usage
Expand Down Expand Up @@ -991,4 +983,4 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
4 changes: 2 additions & 2 deletions packages/mistralai_azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PIP
pip install mistralai
```

Poetry
UV
```bash
poetry add mistralai
uv add mistralai
```

**Prerequisites**
Expand Down
Loading