Skip to content
Open
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
437 changes: 338 additions & 99 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 @@ -32,7 +32,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 2.6.0
version: 2.7.0
additionalDependencies:
dev:
pytest: ^8.2.2
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ sources:
- speakeasy-mistralai-gcp-sdk-26292830187-1
mistral-openapi:
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:b590d544f976dba688dfda05229cee0be00c376a9c3c209d527c1508ff0cb9da
sourceBlobDigest: sha256:293e895fc5dae852d73e3893db3843828c80fb136f03ce835d2c4cff122902ba
sourceRevisionDigest: sha256:45f48569f77b2594726990a398bbfc067534087872b4b354909874aea2947eec
sourceBlobDigest: sha256:79a21b93193e5d5b63b79a79c55aed6778c98b6dfebc96066c5db2fd9580476b
tags:
- latest
- speakeasy-mistralai-sdk-28798837538-1
- speakeasy-mistralai-sdk-29108619696-1
targets:
mistralai-azure-sdk:
source: mistral-azure-source
Expand All @@ -39,10 +39,10 @@ targets:
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:b590d544f976dba688dfda05229cee0be00c376a9c3c209d527c1508ff0cb9da
sourceBlobDigest: sha256:293e895fc5dae852d73e3893db3843828c80fb136f03ce835d2c4cff122902ba
sourceRevisionDigest: sha256:45f48569f77b2594726990a398bbfc067534087872b4b354909874aea2947eec
sourceBlobDigest: sha256:79a21b93193e5d5b63b79a79c55aed6778c98b6dfebc96066c5db2fd9580476b
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:324af77a787d4b6910a5ee12332fd3095a5ff7fcefe4a2d5aebcfea5935e353e
codeSamplesRevisionDigest: sha256:1287373c382da57b707e755a2eb775ead35bbe8e00b4ed7c8312cf52166a3617
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.763.6
Expand Down
79 changes: 71 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
* [Providers' SDKs Example Usage](#providers-sdks-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Server-sent event streaming](#server-sent-event-streaming)
* [Json Streaming](#json-streaming)
* [Pagination](#pagination)
* [File uploads](#file-uploads)
* [Retries](#retries)
Expand Down Expand Up @@ -498,7 +499,8 @@ print(res.choices[0].message.content)
### [Beta.Agents](docs/sdks/betaagents/README.md)

* [create](docs/sdks/betaagents/README.md#create) - Create a agent that can be used within a conversation.
* [list](docs/sdks/betaagents/README.md#list) - List agent entities.
* [~~list~~](docs/sdks/betaagents/README.md#list) - List agent entities. :warning: **Deprecated** Use [list_pages](docs/sdks/betaagents/README.md#list_pages) instead.
* [list_pages](docs/sdks/betaagents/README.md#list_pages) - List agent entities, cursor-paginated.
* [get](docs/sdks/betaagents/README.md#get) - Retrieve an agent entity.
* [update](docs/sdks/betaagents/README.md#update) - Update an agent entity.
* [delete](docs/sdks/betaagents/README.md#delete) - Delete an agent entity.
Expand Down Expand Up @@ -530,6 +532,7 @@ print(res.choices[0].message.content)
* [create_or_update_workspace_credentials](docs/sdks/connectors/README.md#create_or_update_workspace_credentials) - Create or update workspace credentials for a connector.
* [list_user_credentials](docs/sdks/connectors/README.md#list_user_credentials) - List user credentials for a connector.
* [create_or_update_user_credentials](docs/sdks/connectors/README.md#create_or_update_user_credentials) - Create or update user credentials for a connector.
* [delete_all_user_credentials](docs/sdks/connectors/README.md#delete_all_user_credentials) - Delete all user credentials for a connector.
* [delete_organization_credentials](docs/sdks/connectors/README.md#delete_organization_credentials) - Delete organization credentials for a connector.
* [delete_workspace_credentials](docs/sdks/connectors/README.md#delete_workspace_credentials) - Delete workspace credentials for a connector.
* [delete_user_credentials](docs/sdks/connectors/README.md#delete_user_credentials) - Delete user credentials for a connector.
Expand Down Expand Up @@ -689,9 +692,13 @@ print(res.choices[0].message.content)
* [unregister](docs/sdks/searchindexes/README.md#unregister) - Unregister Search Index
* [update_index_metrics](docs/sdks/searchindexes/README.md#update_index_metrics) - Update Index Metrics
* [get_index_detail](docs/sdks/searchindexes/README.md#get_index_detail) - Get Index Details
* [get_index_summary](docs/sdks/searchindexes/README.md#get_index_summary) - Get Index Summary
* [generate_index_summary](docs/sdks/searchindexes/README.md#generate_index_summary) - Generate a summary field for an index
* [set_index_summary](docs/sdks/searchindexes/README.md#set_index_summary) - Set Index Summary
* [get_index_schema_detail](docs/sdks/searchindexes/README.md#get_index_schema_detail) - Get Index Schema Detail
* [get_schema_summary](docs/sdks/searchindexes/README.md#get_schema_summary) - Get Schema Summary
* [generate_schema_summary](docs/sdks/searchindexes/README.md#generate_schema_summary) - Generate a summary field for a schema
* [set_schema_summary](docs/sdks/searchindexes/README.md#set_schema_summary) - Set Schema Summary
* [get_index_schema_detail](docs/sdks/searchindexes/README.md#get_index_schema_detail) - Get Index Schema Detail
* [get_index_schema_file](docs/sdks/searchindexes/README.md#get_index_schema_file) - Get Index Schema File
* [document_lookup](docs/sdks/searchindexes/README.md#document_lookup) - Document Lookup
* [documents_fetch](docs/sdks/searchindexes/README.md#documents_fetch) - Document Fetch
Expand Down Expand Up @@ -876,6 +883,41 @@ with Mistral(
[context-manager]: https://book.pythontips.com/en/latest/context_managers.html
<!-- End Server-sent event streaming [eventstream] -->

<!-- Start Json Streaming [jsonl] -->
## Json Streaming

Json Streaming ([jsonl][jsonl-format] / [x-ndjson][x-ndjson]) content type can be used to stream content from certain operations. These operations will expose the stream as [Generator][generator] that
can be consumed using a simple `for` loop. The loop will
terminate when the server no longer has any events to send and closes the
underlying connection.

The stream is also a [Context Manager][context-manager] and can be used with the `with` statement and will close the
underlying connection when the context is exited.

```python
from mistralai.client import Mistral
import os


with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = mistral.beta.rag.search_indexes.generate_index_summary(index_id="b0cfd77c-9cc3-46b6-ad70-1024386259b9", language="pl")

with res as jsonl_stream:
for event in jsonl_stream:
# handle event
print(event, flush=True)

```

[jsonl-format]: https://jsonlines.org/
[x-ndjson]: https://github.com/ndjson/ndjson-spec
[generator]: https://book.pythontips.com/en/latest/generators.html
[context-manager]: https://book.pythontips.com/en/latest/context_managers.html
<!-- End Json Streaming [jsonl] -->

<!-- Start Pagination [pagination] -->
## Pagination

Expand Down Expand Up @@ -1045,8 +1087,8 @@ with Mistral(


**Inherit from [`MistralError`](./src/mistralai/client/errors/mistralerror.py)**:
* [`HTTPValidationError`](./src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 146 of 243 methods.*
* [`ObservabilityError`](./src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 57 of 243 methods.*
* [`HTTPValidationError`](./src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 152 of 249 methods.*
* [`ObservabilityError`](./src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 57 of 249 methods.*
* [`ResponseValidationError`](./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 All @@ -1061,9 +1103,11 @@ with Mistral(

You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

| Name | Server | Description |
| ---- | ------------------------ | -------------------- |
| `eu` | `https://api.mistral.ai` | EU Production server |
| Name | Server | Description |
| -------- | --------------------------- | ------------------------ |
| `global` | `https://api.mistral.ai` | Global Production server |
| `eu` | `https://api.eu.mistral.ai` | EU Production server |
| `us` | `https://api.us.mistral.ai` | US Production server |

#### Example

Expand All @@ -1073,7 +1117,7 @@ import os


with Mistral(
server="eu",
server="global",
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

Expand Down Expand Up @@ -1218,6 +1262,25 @@ with Mistral(

res = res.next()

```

### Per-Operation Security Schemes

Some operations in this SDK require the security scheme to be specified at the request level. For example:
```python
from mistralai.client import Mistral, models
import os


with Mistral() as mistral:

res = mistral.beta.users.get_identity(security=models.UsersAPIGetIdentitySecurity(
dashboard_user_context_auth=os.getenv("MISTRAL_DASHBOARD_USER_CONTEXT_AUTH", ""),
))

# Handle response
print(res)

```
<!-- End Authentication [security] -->

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,4 +758,14 @@ Based on:
### Generated
- [python v2.6.0] .
### Releases
- [PyPI v2.6.0] https://pypi.org/project/mistralai/2.6.0 - .
- [PyPI v2.6.0] https://pypi.org/project/mistralai/2.6.0 - .

## 2026-07-10 16:48:51
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.763.6 (2.884.13) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v2.7.0] .
### Releases
- [PyPI v2.7.0] https://pypi.org/project/mistralai/2.7.0 - .
10 changes: 10 additions & 0 deletions docs/models/agentlistpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AgentListPage


## Fields

| Field | Type | Required | Description |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `object` | *Optional[Literal["list"]]* | :heavy_minus_sign: | N/A |
| `data` | List[[models.Agent](../models/agent.md)] | :heavy_check_mark: | N/A |
| `next_page_token` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
15 changes: 15 additions & 0 deletions docs/models/agentsapiv1agentslistpagesrequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# AgentsAPIV1AgentsListPagesRequest


## Fields

| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of agents per page |
| `deployment_chat` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `sources` | List[[models.RequestSource](../models/requestsource.md)] | :heavy_minus_sign: | N/A |
| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by agent name |
| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Search agents by name or ID |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
| `page_token` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor from a previous response's next_page_token. When set, results page forward from the cursor. |
8 changes: 8 additions & 0 deletions docs/models/agentsapiv1agentslistpagesresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# AgentsAPIV1AgentsListPagesResponse


## Fields

| Field | Type | Required | Description |
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
| `result` | [models.AgentListPage](../models/agentlistpage.md) | :heavy_check_mark: | N/A |
1 change: 1 addition & 0 deletions docs/models/authenticationconfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `name` | *str* | :heavy_check_mark: | N/A |
| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `authentication_type` | [models.OutboundAuthenticationType](../models/outboundauthenticationtype.md) | :heavy_check_mark: | N/A |
| `scope` | [models.ConsumerType](../models/consumertype.md) | :heavy_check_mark: | N/A |
| `status` | [OptionalNullable[models.CredentialsStatus]](../models/credentialsstatus.md) | :heavy_minus_sign: | N/A |
Expand Down
Loading
Loading