- create - Create an agent session
- get - Get session status
- update - Update a live agent session
- close - Stop an agent session
Create a real-time audio agent session.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:
res = mistral.audio.sessions.create()
# Handle response
print(res)
models.AudioSessionCreateResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Retrieve an audio agent session with the transcript of its conversation.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:
res = mistral.audio.sessions.get(session_id="4f4cc199-091a-4c84-bbe2-7e1c1dfeb849")
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
session_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.AudioSessionResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Update the instructions, tools or turn handling of a live session.
The agent applies the update at its next turn boundary, so it is not yet
applied when this returns.
The agent's session_updated and session_update_failed webhooks report
the outcome to your server.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:
res = mistral.audio.sessions.update(session_id="e7fa5d49-3528-45a6-942c-da6c39ecb063")
# Handle response
print(res)
models.AudioSessionUpdateResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Stop an audio agent session and release its resources.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:
mistral.audio.sessions.close(session_id="ce48313c-2e04-4918-9c23-e227a406a9e0")
# Use the SDK ...
| Parameter |
Type |
Required |
Description |
session_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |