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
845 changes: 411 additions & 434 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 3.8.0
version: 3.9.0
additionalDependencies:
dev:
pytest: ^8.2.2
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ sources:
- 1.0.0
mistral-openapi:
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:6441873fab21311e396b17c3470a67ba76f56913be59c79268c323a00bb4eea4
sourceBlobDigest: sha256:b411ae12070945d5822bc3e421566c8ffd00e28a234e3948b5ff41c1026836bd
sourceRevisionDigest: sha256:063546f721a2fa07d26e90fddc31f4317e9e337979736b3f218bd288ef275494
sourceBlobDigest: sha256:299c23ba84cfb85774160e24158cc6de3ac1f34e974ec7d01ada86e9d3d540fa
tags:
- latest
- 1.0.0
Expand All @@ -39,10 +39,10 @@ targets:
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:6441873fab21311e396b17c3470a67ba76f56913be59c79268c323a00bb4eea4
sourceBlobDigest: sha256:b411ae12070945d5822bc3e421566c8ffd00e28a234e3948b5ff41c1026836bd
sourceRevisionDigest: sha256:063546f721a2fa07d26e90fddc31f4317e9e337979736b3f218bd288ef275494
sourceBlobDigest: sha256:299c23ba84cfb85774160e24158cc6de3ac1f34e974ec7d01ada86e9d3d540fa
codeSamplesNamespace: mistral-openapi-python-code-samples
codeSamplesRevisionDigest: sha256:650e5e46f796ed806de0a697d0b8c705375ab2395cb22103d8ca67e30bff556f
codeSamplesRevisionDigest: sha256:d7e11d407412b2b3956e55036ba28180d7bdba0b1b8954238742b344546294da
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.807.0
Expand Down
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,29 @@ There are also package-specific ownership files:

If a file is not listed in the relevant `.genignore` and it has the generated header, assume it should not be edited directly.

Custom SDK hooks are hand-written too, though the root `.genignore` does not list them: in `src/mistralai/client/_hooks/`
(and `packages/*/src/mistralai/*/client/_hooks/`), every file without the generated header, such as `registration.py`
and `custom_user_agent.py`. Speakeasy writes `registration.py` once and never overwrites it (the package `.genignore`
files also list it); `sdkhooks.py`, `types.py` and `__init__.py` carry the header and are regenerated.

## PR Review Rule Of Thumb

- Prefer PRs that change hand-owned files listed in `.genignore`.
- Be skeptical of direct edits to generated SDK files under `src/`, `docs/`, or `packages/*/src/`.
- If a generated file changed, look for the corresponding source/config change that explains the regeneration.

## How a Change Reaches PyPI

This directory is the source of truth; the public `mistralai/client-python` repository is a copy of it. Releasing
runs in the Buildkite pipeline `eng-sdk-codegen` in the dashboard monorepo, not in GitHub Actions:

1. Regenerate: a cron every Friday at 06:17 UTC, or a manual build with `Action = regenerate`, runs Speakeasy on
`openapi/specs/v2/` and opens the rolling dashboard pull request from `sdk/regen-client-python`. Review and merge it.
2. Publish: a person starts a build with `Action = publish`, from the Buildkite UI or through the Buildkite API or
MCP with `action=publish`, `dry_run=false`, `clients=python` as build meta-data. It copies this directory into a
pull request on the `sdk-sync` branch of `mistralai/client-python`. Publishing never regenerates, so merge step 1
first.
3. Merging that public pull request is the release: it publishes to PyPI.

The full procedure, its options and its safety checks are in the dashboard skill
`openapi/.agents/skills/deploy-public-sdk/SKILL.md`.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ help:
@echo " make update-speakeasy-version VERSION=x.y.z Update Speakeasy CLI version"
@echo " make check-config Check gen.yaml against recommended defaults"
@echo ""
@echo "Note: Production SDK generation is done via GitHub Actions:"
@echo " .github/workflows/sdk_generation_mistralai_sdk.yaml"
@echo "Note: Production SDK generation and release run in the Buildkite pipeline eng-sdk-codegen"
@echo " (dashboard monorepo); see openapi/.agents/skills/deploy-public-sdk/SKILL.md"

# Generate all SDKs (main, Azure, GCP)
generate:
speakeasy run -t all

# Test SDK generation locally.
# For production, use GitHub Actions: .github/workflows/sdk_generation_mistralai_sdk.yaml
# For production, use the Buildkite pipeline eng-sdk-codegen (see the help target).
# This uses the Speakeasy CLI version defined in .speakeasy/workflow.yaml
test-generate:
speakeasy run --skip-versioning
Expand Down
54 changes: 24 additions & 30 deletions README-PYPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ with Mistral(
res = mistral.files.upload(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, visibility="workspace")
}, visibility="workspace", purpose="batch")

# Handle response
print(res)
Expand All @@ -259,7 +259,7 @@ async def main():
res = await mistral.files.upload_async(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, visibility="workspace")
}, visibility="workspace", purpose="batch")

# Handle response
print(res)
Expand Down Expand Up @@ -577,23 +577,23 @@ print(res.choices[0].message.content)
* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#update) - Update a connector.
* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#delete) - Delete a connector.

### [Beta.Context.SearchIndexes](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md)

* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#create) - Create a managed index
* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#list) - List managed indexes
* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#get) - Get a managed index
* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#update) - Update a managed index schema
* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#delete) - Delete a managed index
* [ingest_documents](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#ingest_documents) - Ingest documents into a managed index
* [delete_documents](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#delete_documents) - Delete documents from a managed index
* [search](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#search) - Search a managed index
* [navigate](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#navigate) - Navigate to adjacent chunks
* [read](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#read) - Read chunks within a span
* [grep](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#grep) - Grep for a pattern within a source
* [get_chunk](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#get_chunk) - Get a single chunk by id
* [get_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#get_index_summary) - Get Managed Index Summary
* [generate_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#generate_index_summary) - Generate a summary field for a managed index
* [set_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/contextsearchindexes/README.md#set_index_summary) - Set Managed Index Summary
### [Beta.Context.SearchIndexes](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md)

* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#create) - Create a managed index
* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#list) - List managed indexes
* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#get) - Get a managed index
* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#update) - Update a managed index schema
* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#delete) - Delete a managed index
* [ingest_documents](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#ingest_documents) - Ingest documents into a managed index
* [delete_documents](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#delete_documents) - Delete documents from a managed index
* [search](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#search) - Search a managed index
* [navigate](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#navigate) - Navigate to adjacent chunks
* [read](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#read) - Read chunks within a span
* [grep](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#grep) - Grep for a pattern within a source
* [get_chunk](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#get_chunk) - Get a single chunk by id
* [get_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#get_index_summary) - Get Managed Index Summary
* [generate_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#generate_index_summary) - Generate a summary field for a managed index
* [set_index_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/searchindexes/README.md#set_index_summary) - Set Managed Index Summary

### [Beta.Conversations](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md)

Expand Down Expand Up @@ -647,8 +647,8 @@ print(res.choices[0].message.content)
* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#update) - Patch dataset
* [list_records](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#list_records) - List existing records in the dataset
* [create_record](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#create_record) - Add a record to the dataset
* [create_records](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#create_records) - Add several records to the dataset
* [import_from_file](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_file) - Populate the dataset with records from an uploaded file
* [import_from_playground](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_playground) - Populate the dataset with records from playground conversations
* [import_from_spans](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_spans) - Populate the dataset with records mapped from telemetry spans
* [import_from_dataset_records](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_dataset_records) - Populate the dataset with records from another dataset
* [export_to_jsonl](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#export_to_jsonl) - Export to the Files API and retrieve presigned URL to download the resulting JSONL file
Expand Down Expand Up @@ -752,13 +752,6 @@ print(res.choices[0].message.content)
* [register](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md#register) - Register Config
* [update_run_info](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md#update_run_info) - Update Run Info

### [Beta.Rag.SearchIndexes](https://github.com/mistralai/client-python/blob/main/docs/sdks/ragsearchindexes/README.md)

* [get_deployment_summaries](https://github.com/mistralai/client-python/blob/main/docs/sdks/ragsearchindexes/README.md#get_deployment_summaries) - Get Deployment Summaries
* [register_deployment](https://github.com/mistralai/client-python/blob/main/docs/sdks/ragsearchindexes/README.md#register_deployment) - Register (or re-register) a search index
* [unregister_deployment](https://github.com/mistralai/client-python/blob/main/docs/sdks/ragsearchindexes/README.md#unregister_deployment) - Unregister Deployment
* [update_index_metrics](https://github.com/mistralai/client-python/blob/main/docs/sdks/ragsearchindexes/README.md#update_index_metrics) - Update Index Metrics

### [Beta.ServiceAccounts](https://github.com/mistralai/client-python/blob/main/docs/sdks/serviceaccounts/README.md)

* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/serviceaccounts/README.md#create) - Create Service Account
Expand Down Expand Up @@ -890,6 +883,7 @@ print(res.choices[0].message.content)
* [restart_deployment](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#restart_deployment) - Restart Deployment
* [list_deployment_workers](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#list_deployment_workers) - List Deployment Workers
* [get_deployment_archive](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#get_deployment_archive) - Get Deployment Archive
* [create_deployment_archive](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#create_deployment_archive) - Create Deployment Archive
* [get_deployment_logs](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#get_deployment_logs) - Get Deployment Logs
* [stream_deployment_logs](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#stream_deployment_logs) - Stream Deployment Logs

Expand Down Expand Up @@ -1188,9 +1182,9 @@ with Mistral(


**Inherit from [`MistralError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/mistralerror.py)**:
* [`HTTPValidationError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 190 of 303 methods.*
* [`ObservabilityError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 63 of 303 methods.*
* [`ConnectorErrorResponse`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/connectorerrorresponse.py): Applicable to 4 of 303 methods.*
* [`HTTPValidationError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 189 of 300 methods.*
* [`ObservabilityError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 63 of 300 methods.*
* [`ConnectorErrorResponse`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/connectorerrorresponse.py): Applicable to 4 of 300 methods.*
* [`ResponseValidationError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.

</details>
Expand Down
Loading
Loading