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
2 changes: 1 addition & 1 deletion .github/workflows/lint_custom_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
touch README-PYPI.md
poetry install
poetry install --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
39 changes: 20 additions & 19 deletions .github/workflows/run_example_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1

- name: Build and install client
run: |
touch README-PYPI.md # Create this file since the client is not built from Speakeasy
poetry build
python3 -m pip install dist/mistralai-*.whl

- name: Set VERSION
run: |
VERSION=$(echo ${{ matrix.python-version }} | tr -d .)
Expand All @@ -43,20 +37,27 @@ jobs:
run: |
echo "MISTRAL_API_KEY=${{ secrets[format('CI_MISTRAL_API_KEY_PYTHON_{0}', env.VERSION)] }}" >> $GITHUB_ENV

- name: Run the example scripts
- name: Build the package
run: |
touch README-PYPI.md # Create this file since the client is not built by Speakeasy
poetry 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"
./scripts/run_examples.sh --no-extra-dep
env:
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}
MISTRAL_API_KEY: ${{ env.MISTRAL_API_KEY }}

- name: For python 3.10+, install client with extras and run all examples.
if: matrix.python-version != '3.9'
run: |
failed=0
for file in examples/*.py; do
if [ -f "$file" ] && [ "$file" != "examples/chatbot_with_streaming.py" ]; then
echo "Running $file"
# Do not fail if the script fails, but save it in the failed variable
python3 "$file" > /dev/null || failed=1
fi
done
# If one of the example script failed then exit
if [ $failed -ne 0 ]; then
exit 1
fi
PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]"
python3 -m pip install "$PACKAGE"
./scripts/run_examples.sh
env:
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}
MISTRAL_API_KEY: ${{ env.MISTRAL_API_KEY }}
Loading