(batch.jobs)
Get a list of batch jobs for your organization and user.
from mistralai import Mistral
import os
s = Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
)
res = s.batch.jobs.list()
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
page |
Optional[int] |
➖ |
N/A |
page_size |
Optional[int] |
➖ |
N/A |
model |
OptionalNullable[str] |
➖ |
N/A |
metadata |
Dict[str, Any] |
➖ |
N/A |
created_after |
date |
➖ |
N/A |
created_by_me |
Optional[bool] |
➖ |
N/A |
status |
OptionalNullable[models.BatchJobStatus] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.BatchJobsOut
Error Type |
Status Code |
Content Type |
models.SDKError |
4XX, 5XX |
*/* |
Create a new batch job, it will be queued for processing.
from mistralai import Mistral
import os
s = Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
)
res = s.batch.jobs.create(input_files=[
"a621cf02-1cd9-4cf5-8403-315211a509a3",
], endpoint="/v1/fim/completions", model="2")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
input_files |
List[str] |
✔️ |
N/A |
endpoint |
models.APIEndpoint |
✔️ |
N/A |
model |
str |
✔️ |
N/A |
metadata |
Dict[str, str] |
➖ |
N/A |
timeout_hours |
Optional[int] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.BatchJobOut
Error Type |
Status Code |
Content Type |
models.SDKError |
4XX, 5XX |
*/* |
Get a batch job details by its UUID.
from mistralai import Mistral
import os
s = Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
)
res = s.batch.jobs.get(job_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
job_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.BatchJobOut
Error Type |
Status Code |
Content Type |
models.SDKError |
4XX, 5XX |
*/* |
Request the cancellation of a batch job.
from mistralai import Mistral
import os
s = Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
)
res = s.batch.jobs.cancel(job_id="0f713502-9233-41c6-9ebd-c570b7edb496")
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
job_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.BatchJobOut
Error Type |
Status Code |
Content Type |
models.SDKError |
4XX, 5XX |
*/* |