Skip to content

Latest commit

 

History

History
313 lines (204 loc) · 19 KB

README.md

File metadata and controls

313 lines (204 loc) · 19 KB

Audio.Agents

Overview

Available Operations

list

List audio agents

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.list(page_size=10)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
page_size Optional[int] ➖ Maximum number of agents to return
page_token OptionalNullable[str] ➖ Cursor returned as next_page_token by the previous page
search OptionalNullable[str] ➖ Substring match on the agent name
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.ListAgentsV1AudioAgentsGetResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

create

Create an audio agent

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.create(name="<value>", configuration={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
name str ✔️ N/A
configuration models.AudioAgentConfigurationRequest ✔️ N/A
description OptionalNullable[str] ➖ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.AudioAgentResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

get

Get an audio agent

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.get(agent_id="967ae3d5-7e26-4ae8-9f9e-4dd9ab8fbfb9")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
agent_id str ✔️ N/A
version OptionalNullable[int] ➖ Version to return. Defaults to the latest version.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.AudioAgentResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

update

Update an audio agent

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.update(agent_id="70039ed8-34b8-4a49-ac83-e37ca84d423b", name="<value>", configuration={})

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
agent_id str ✔️ N/A
name str ✔️ N/A
configuration models.AudioAgentConfigurationRequest ✔️ N/A
description OptionalNullable[str] ➖ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.AudioAgentResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

delete

Delete an audio agent

Example Usage

from mistralai.client import Mistral
import os


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

    mistral.audio.agents.delete(agent_id="b6128dca-4b79-48e5-ab7f-d746ef13d05b")

    # Use the SDK ...

Parameters

Parameter Type Required Description
agent_id str ✔️ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_versions

List audio agent versions

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.list_versions(agent_id="89c92180-d7a8-47e4-98cc-96e5539d54cc", page_size=10)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
agent_id str ✔️ N/A
page_size Optional[int] ➖ Maximum number of versions to return
page_token OptionalNullable[str] ➖ Cursor returned as next_page_token by the previous page
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.ListAgentVersionsV1AudioAgentsAgentIDVersionsGetResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_sessions

List audio agent sessions

Example Usage

from mistralai.client import Mistral
import os


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

    res = mistral.audio.agents.list_sessions(agent_id="8acd4f69-1e55-4801-85fe-b7864f46c0ac", page_size=10)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
agent_id str ✔️ N/A
page_size Optional[int] ➖ Maximum number of sessions to return
page_token OptionalNullable[str] ➖ Cursor returned as next_page_token by the previous page
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.ListAgentSessionsV1AudioAgentsAgentIDSessionsGetResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*