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
180 changes: 155 additions & 25 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 @@ -21,7 +21,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 1.9.11
version: 1.10.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 @@ -14,11 +14,11 @@ sources:
- latest
mistral-openapi:
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd
sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8
sourceRevisionDigest: sha256:cb63bd997cefe7b3b36e91a475df57cb779bf79f183340e0713d8ffb16a2dabc
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
tags:
- latest
- speakeasy-sdk-regen-1759420102
- speakeasy-sdk-regen-1765914268
targets:
mistralai-azure-sdk:
source: mistral-azure-source
Expand All @@ -37,10 +37,10 @@ targets:
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd
sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8
sourceRevisionDigest: sha256:cb63bd997cefe7b3b36e91a475df57cb779bf79f183340e0713d8ffb16a2dabc
sourceBlobDigest: sha256:f0caa06fb9bcadc35b097aa5ff69bb5020937652df311722b5e44a282bd95d6d
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:8ed158c9c1ed8252f86b620219dd93e9650b45e7c6403cda7fdd9b4ee0d17dac
codeSamplesRevisionDigest: sha256:b1eacff97275a14ab0c2143e07bdfa4f4bd58f5370b2f106bcc6ada92b754d08
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.606.10
Expand Down
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = mistral.chat.complete(model="mistral-small-latest", messages=[
res = mistral.chat.complete(model="mistral-large-latest", messages=[
{
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], stream=False)
], stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand All @@ -171,12 +173,14 @@ async def main():
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = await mistral.chat.complete_async(model="mistral-small-latest", messages=[
res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[
{
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], stream=False)
], stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand Down Expand Up @@ -252,7 +256,9 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>", stream=False)
], agent_id="<id>", stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand All @@ -278,7 +284,9 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>", stream=False)
], agent_id="<id>", stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand Down Expand Up @@ -448,7 +456,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
#### [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)
* [stream](docs/sdks/transcriptions/README.md#stream) - Create Streaming Transcription (SSE)

### [batch](docs/sdks/batch/README.md)

Expand All @@ -469,13 +477,15 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
* [list](docs/sdks/mistralagents/README.md#list) - List agent entities.
* [get](docs/sdks/mistralagents/README.md#get) - Retrieve an agent entity.
* [update](docs/sdks/mistralagents/README.md#update) - Update an agent entity.
* [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)

* [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.
* [get](docs/sdks/conversations/README.md#get) - Retrieve a conversation information.
* [delete](docs/sdks/conversations/README.md#delete) - Delete a conversation.
* [append](docs/sdks/conversations/README.md#append) - Append new entries to an existing conversation.
* [get_history](docs/sdks/conversations/README.md#get_history) - Retrieve all entries in a conversation.
* [get_messages](docs/sdks/conversations/README.md#get_messages) - Retrieve all messages in a conversation.
Expand All @@ -500,7 +510,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA

#### [beta.libraries.documents](docs/sdks/documents/README.md)

* [list](docs/sdks/documents/README.md#list) - List document in a given library.
* [list](docs/sdks/documents/README.md#list) - List documents in a given library.
* [upload](docs/sdks/documents/README.md#upload) - Upload a new document.
* [get](docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document.
* [update](docs/sdks/documents/README.md#update) - Update the metadata of a specific document.
Expand Down Expand Up @@ -597,7 +607,11 @@ with Mistral(
"tool_call_id": "<id>",
"result": "<value>",
},
], stream=True)
], stream=True, completion_args={
"response_format": {
"type": "text",
},
})

with res as event_stream:
for event in event_stream:
Expand Down Expand Up @@ -712,7 +726,7 @@ with Mistral(
res = None
try:

res = mistral.models.list()
res = mistral.models.retrieve(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

# Handle response
print(res)
Expand Down Expand Up @@ -746,7 +760,7 @@ with Mistral(


**Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**:
* [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
* [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 48 of 70 methods.*
* [`ResponseValidationError`](./src/mistralai/models/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
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,14 @@ Based on:
### Generated
- [python v1.9.11] .
### Releases
- [PyPI v1.9.11] https://pypi.org/project/mistralai/1.9.11 - .
- [PyPI v1.9.11] https://pypi.org/project/mistralai/1.9.11 - .

## 2025-12-16 19:44:09
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v1.10.0] .
### Releases
- [PyPI v1.10.0] https://pypi.org/project/mistralai/1.10.0 - .
20 changes: 14 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = mistral.chat.complete(model="mistral-small-latest", messages=[
res = mistral.chat.complete(model="mistral-large-latest", messages=[
{
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], stream=False)
], stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand All @@ -39,12 +41,14 @@ async def main():
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

res = await mistral.chat.complete_async(model="mistral-small-latest", messages=[
res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[
{
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], stream=False)
], stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand Down Expand Up @@ -120,7 +124,9 @@ with Mistral(
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>", stream=False)
], agent_id="<id>", stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand All @@ -146,7 +152,9 @@ async def main():
"content": "Who is the best French painter? Answer in one short sentence.",
"role": "user",
},
], agent_id="<id>", stream=False)
], agent_id="<id>", stream=False, response_format={
"type": "text",
})

# Handle response
print(res)
Expand Down
6 changes: 5 additions & 1 deletion docs/models/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
| `name` | *str* | :heavy_check_mark: | N/A |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `version` | *int* | :heavy_check_mark: | N/A |
| `versions` | List[*int*] | :heavy_check_mark: | N/A |
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `deployment_chat` | *bool* | :heavy_check_mark: | N/A |
| `source` | *str* | :heavy_check_mark: | N/A |
4 changes: 3 additions & 1 deletion docs/models/agentconversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. |
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. |
| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
| `agent_id` | *str* | :heavy_check_mark: | N/A |
| `agent_id` | *str* | :heavy_check_mark: | N/A |
| `agent_version` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
3 changes: 2 additions & 1 deletion docs/models/agentcreationrequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
| `model` | *str* | :heavy_check_mark: | N/A |
| `name` | *str* | :heavy_check_mark: | N/A |
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A |
| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
8 changes: 8 additions & 0 deletions docs/models/agentsapiv1agentsdeleterequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# AgentsAPIV1AgentsDeleteRequest


## Fields

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `agent_id` | *str* | :heavy_check_mark: | N/A |
Loading