Skip to content

Commit 62fad8e

Browse files
author
GitHub Actions
committed
Update version to v0.0.119
1 parent 1b12b64 commit 62fad8e

File tree

11 files changed

+72
-35
lines changed

11 files changed

+72
-35
lines changed

docs/capabilities/agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ curl --location "https://api.mistral.ai/v1/agents" \
7676
### Use an agent
7777

7878

79-
<Tabs>
79+
<Tabs groupId="code">
8080
<TabItem value="python" label="python" default>
8181

8282
```python

docs/capabilities/batch.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Here's an example of how to structure a batch request:
2222

2323
Save your batch into a .jsonl file. Once saved, you can upload your batch input file to ensure it is correctly referenced when initiating batch processes:
2424

25-
<Tabs>
25+
<Tabs groupId="code">
2626
<TabItem value="python" label="python" default>
27+
2728
```python
2829
from mistralai import Mistral
2930
import os
@@ -40,8 +41,10 @@ batch_data = client.files.upload(
4041

4142
)
4243
```
44+
4345
</TabItem>
4446
<TabItem value="typescript" label="typescript">
47+
4548
```typescript
4649
import { Mistral } from '@mistralai/mistralai';
4750
import fs from 'fs';
@@ -58,14 +61,17 @@ const batchData = await client.files.upload({
5861
}
5962
});
6063
```
64+
6165
</TabItem>
6266
<TabItem value="curl" label="curl">
67+
6368
```curl
6469
curl https://api.mistral.ai/v1/files \
6570
-H "Authorization: Bearer $MISTRAL_API_KEY" \
6671
-F purpose="batch" \
6772
-F file="@batch_input_file.jsonl"
6873
```
74+
6975
</TabItem>
7076
</Tabs>
7177

@@ -78,7 +84,7 @@ Create a new batch job, it will be queued for processing.
7884
- `endpoint`: we currently support `/v1/embeddings`, `/v1/chat/completions`, `/v1/fim/completions`, `/v1/moderations`, `/v1/chat/moderations`.
7985
- `metadata`: optional custom metadata for the batch.
8086

81-
<Tabs>
87+
<Tabs groupId="code">
8288
<TabItem value="python" label="python" default>
8389
```python
8490
created_job = client.batch.jobs.create(
@@ -90,6 +96,7 @@ created_job = client.batch.jobs.create(
9096
```
9197
</TabItem>
9298
<TabItem value="typescript" label="typescript">
99+
93100
```typescript
94101
import { Mistral } from '@mistralai/mistralai';
95102

@@ -105,7 +112,9 @@ const createdJob = await client.batch.jobs.create({
105112
});
106113
```
107114
</TabItem>
115+
108116
<TabItem value="curl" label="curl">
117+
109118
```bash
110119
curl --location "https://api.mistral.ai/v1/batch/jobs" \
111120
--header "Authorization: Bearer $MISTRAL_API_KEY" \
@@ -128,43 +137,55 @@ curl --location "https://api.mistral.ai/v1/batch/jobs" \
128137

129138
## Get a batch job details
130139

131-
<Tabs>
140+
<Tabs groupId="code">
132141
<TabItem value="python" label="python" default>
142+
133143
```python
134144
retrieved_job = client.batch.jobs.get(job_id=created_job.id)
135145
```
146+
136147
</TabItem>
137148
<TabItem value="typescript" label="typescript">
149+
138150
```typescript
139151
const retrievedJob = await client.batch.jobs.get({ jobId: createdJob.id});
140152
```
153+
141154
</TabItem>
142155
<TabItem value="curl" label="curl">
156+
143157
```bash
144158
curl https://api.mistral.ai/v1/batch/jobs/<jobid> \
145159
--header "Authorization: Bearer $MISTRAL_API_KEY" \
146160
--header 'Content-Type: application/json'
147161
```
162+
148163
</TabItem>
149164
</Tabs>
150165

151166
## Get batch job results
152-
<Tabs>
167+
<Tabs groupId="code">
153168
<TabItem value="python" label="python" default>
169+
154170
```python
155171
client.files.download(file_id=retrieved_job.output_file)
156172
```
173+
157174
</TabItem>
158175
<TabItem value="typescript" label="typescript">
176+
159177
```typescript
160178
client.files.download({ fileId: retrieved_job.output_file});
161179
```
180+
162181
</TabItem>
163182
<TabItem value="curl" label="curl">
183+
164184
```bash
165185
curl 'https://api.mistral.ai/v1/files/<uuid>/content' \
166186
--header "Authorization: Bearer $MISTRAL_API_KEY" \
167187
```
188+
168189
</TabItem>
169190
</Tabs>
170191

@@ -176,16 +197,19 @@ You can view a list of your batch jobs and filter them by various criteria, incl
176197
`CANCELLED`
177198
- Metadata: custom metadata key and value for the batch
178199

179-
<Tabs>
200+
<Tabs groupId="code">
180201
<TabItem value="python" label="python" default>
202+
181203
```python
182204
list_job = client.batch.jobs.list(
183205
status="RUNNING",
184206
metadata={"job_type": "testing"}
185207
)
186208
```
209+
187210
</TabItem>
188211
<TabItem value="typescript" label="typescript">
212+
189213
```typescript
190214
const listJob = await client.batch.jobs.list({
191215
status: "RUNNING",
@@ -194,38 +218,47 @@ const listJob = await client.batch.jobs.list({
194218
}
195219
});
196220
```
221+
197222
</TabItem>
198223
<TabItem value="curl" label="curl">
224+
199225
```bash
200226
curl 'https://api.mistral.ai/v1/batch/jobs?status=RUNNING&job_type=testing'\
201227
--header 'x-api-key: $MISTRAL_API_KEY' \
202228
--header 'Content-Type: application/json'
203229
```
230+
204231
</TabItem>
205232
</Tabs>
206233

207234

208235
## Request the cancellation of a batch job
209236

210-
<Tabs>
237+
<Tabs groupId="code">
211238
<TabItem value="python" label="python" default>
239+
212240
```python
213241
canceled_job = client.batch.jobs.cancel(job_id=created_job.id)
214242
```
243+
215244
</TabItem>
216245
<TabItem value="typescript" label="typescript">
246+
217247
```typescript
218248
const canceledJob = await mistral.fineTuning.jobs.cancel({
219249
jobId: createdJob.id,
220250
});
221251
```
252+
222253
</TabItem>
223254
<TabItem value="curl" label="curl">
255+
224256
```bash
225257
curl -X POST https://api.mistral.ai/v1/batch/jobs/<jobid>/cancel \
226258
--header "Authorization: Bearer $MISTRAL_API_KEY" \
227259
--header 'Content-Type: application/json'
228260
```
261+
229262
</TabItem>
230263
</Tabs>
231264

docs/capabilities/code-generation.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This guide will walk you through how to use Codestral fill-in-the-middle endpoin
3838
With this feature, users can define the starting point of the code using a `prompt`, and the ending point of the code using an optional `suffix` and an optional `stop`. The Codestral model will then generate the code that fits in between, making it ideal for tasks that require a specific piece of code to be generated. Below are three examples:
3939

4040
#### Example 1: Fill in the middle
41-
<Tabs>
41+
<Tabs groupId="code">
4242
<TabItem value="python" label="python" default>
4343
```python
4444
import os
@@ -89,7 +89,7 @@ curl --location 'https://api.mistral.ai/v1/fim/completions' \
8989
</Tabs>
9090

9191
#### Example 2: Completion
92-
<Tabs>
92+
<Tabs groupId="code">
9393
<TabItem value="python" label="python" default>
9494
```python
9595
import os
@@ -136,7 +136,7 @@ curl --location 'https://api.mistral.ai/v1/fim/completions' \
136136
We recommend adding stop tokens for IDE autocomplete integrations to prevent the model from being too verbose.
137137
:::
138138

139-
<Tabs>
139+
<Tabs groupId="code">
140140
<TabItem value="python" label="python" default>
141141
```python
142142
import os
@@ -189,7 +189,7 @@ The only difference is the endpoint used:
189189
- Instruct endpoint: https://api.mistral.ai/v1/chat/completions
190190

191191

192-
<Tabs>
192+
<Tabs groupId="code">
193193
<TabItem value="python" label="python" default>
194194
```python
195195
import os
@@ -226,7 +226,7 @@ curl --location "https://api.mistral.ai/v1/chat/completions" \
226226

227227
## Codestral Mamba
228228
We have also released Codestral Mamba 7B, a Mamba2 language model specialized in code generation with the instruct endpoint.
229-
<Tabs>
229+
<Tabs groupId="code">
230230
<TabItem value="python" label="python" default>
231231
```python
232232
import os

docs/capabilities/completion.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The chat completion API accepts a list of chat messages as input and
1818
generates a response. This response is in the form of a new chat message with
1919
the role "assistant" as output.
2020

21-
<Tabs>
21+
<Tabs groupId="code">
2222
<TabItem value="python" label="python" default>
2323

2424
### No streaming

docs/capabilities/document.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Document OCR (Optical Character Recognition) processor, powered by our lates
2222
The OCR processor returns both the extracted text content and metadata about the document structure, making it easy to work with the recognized content programmatically.
2323

2424
### OCR with PDF
25-
<Tabs>
25+
<Tabs groupId="code">
2626
<TabItem value="python" label="python">
2727

2828
```python
@@ -56,7 +56,7 @@ const ocrResponse = await client.ocr.process({
5656
type: "document_url",
5757
documentUrl: "https://arxiv.org/pdf/2201.04234"
5858
},
59-
include_image_base64: true
59+
includeImageBase64: true
6060
});
6161
```
6262
</TabItem>
@@ -470,7 +470,7 @@ curl https://api.mistral.ai/v1/ocr \
470470
You can also upload a PDF file and get the OCR results from the uploaded PDF.
471471

472472
#### Upload a file
473-
<Tabs>
473+
<Tabs groupId="code">
474474
<TabItem value="python" label="python" default>
475475

476476
```python
@@ -525,7 +525,7 @@ curl https://api.mistral.ai/v1/files \
525525
</Tabs>
526526

527527
#### Retrieve File
528-
<Tabs>
528+
<Tabs groupId="code">
529529
<TabItem value="python" label="python">
530530

531531
```python
@@ -559,7 +559,7 @@ id='00edaf84-95b0-45db-8f83-f71138491f23' object='file' size_bytes=3749788 creat
559559
```
560560

561561
#### Get signed URL
562-
<Tabs>
562+
<Tabs groupId="code">
563563
<TabItem value="python" label="python">
564564

565565
```python
@@ -570,7 +570,7 @@ signed_url = client.files.get_signed_url(file_id=uploaded_pdf.id)
570570
<TabItem value="typescript" label="typescript">
571571

572572
```typescript
573-
const signedUrl = await mistral.files.getSignedUrl({
573+
const signedUrl = await client.files.getSignedUrl({
574574
fileId: uploaded_pdf.id,
575575
});
576576
```
@@ -590,7 +590,7 @@ curl -X GET "https://api.mistral.ai/v1/files/$id/url?expiry=24" \
590590

591591
#### Get OCR results
592592

593-
<Tabs>
593+
<Tabs groupId="code">
594594
<TabItem value="python" label="python">
595595

596596
```python
@@ -644,7 +644,7 @@ curl https://api.mistral.ai/v1/ocr \
644644
</Tabs>
645645

646646
### OCR with image
647-
<Tabs>
647+
<Tabs groupId="code">
648648
<TabItem value="python" label="python">
649649

650650
```python
@@ -760,7 +760,7 @@ The Document understanding capability combines OCR with large language model cap
760760

761761
The examples below show how to interact with a PDF document using natural language:
762762

763-
<Tabs>
763+
<Tabs groupId="code">
764764
<TabItem value="python" label="python" default>
765765

766766
```python
@@ -874,3 +874,7 @@ For more information and guides on how to make use of OCR and leverage document
874874
- [Tool Use and Document Understanding](https://colab.research.google.com/github/mistralai/cookbook/blob/main/mistral/ocr/document_understanding.ipynb)
875875
- [Batch OCR](https://colab.research.google.com/github/mistralai/cookbook/blob/main/mistral/ocr/batch_ocr.ipynb)
876876
- [Structured OCR](https://colab.research.google.com/github/mistralai/cookbook/blob/main/mistral/ocr/structured_ocr.ipynb)
877+
878+
## FAQ
879+
### Are there any limits regarding the OCR API?
880+
Yes, there are certain limitations for the OCR API. Uploaded document files must not exceed 50 MB in size and should be no longer than 1,000 pages.

docs/capabilities/finetuning.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Once you have the data file with the right format,
171171
you can upload the data file to the Mistral Client,
172172
making them available for use in fine-tuning jobs.
173173

174-
<Tabs>
174+
<Tabs groupId="code">
175175
<TabItem value="python" label="python" default>
176176

177177
```python
@@ -246,7 +246,7 @@ The next step is to create a fine-tuning job.
246246
- `auto_start=True`: Your job will be launched immediately after validation.
247247
- `auto_start=False` (default): You can manually start the training after validation by sending a POST request to `/fine_tuning/jobs/<uuid>/start`.
248248

249-
<Tabs>
249+
<Tabs groupId="code">
250250
<TabItem value="python" label="python" default>
251251

252252
```python
@@ -318,7 +318,7 @@ You can also list jobs, retrieve a job, or cancel a job.
318318
You can filter and view a list of jobs using various parameters such as
319319
`page`, `page_size`, `model`, `created_after`, `created_by_me`, `status`, `wandb_project`, `wandb_name`, and `suffix`. Check out our [API specs](https://docs.mistral.ai/api/#tag/fine-tuning) for details.
320320

321-
<Tabs>
321+
<Tabs groupId="code">
322322
<TabItem value="python" label="python" default>
323323

324324
```python
@@ -378,7 +378,7 @@ curl -X POST https://api.mistral.ai/v1/fine_tuning/jobs/<jobid>/cancel \
378378
## Use a fine-tuned model
379379
When a fine-tuned job is finished, you will be able to see the fine-tuned model name via `retrieved_jobs.fine_tuned_model`. Then you can use our `chat` endpoint to chat with the fine-tuned model:
380380

381-
<Tabs>
381+
<Tabs groupId="code">
382382
<TabItem value="python" label="python" default>
383383

384384
```python
@@ -418,7 +418,7 @@ curl "https://api.mistral.ai/v1/chat/completions" \
418418

419419
## Delete a fine-tuned model
420420

421-
<Tabs>
421+
<Tabs groupId="code">
422422
<TabItem value="python" label="python" default>
423423

424424
```python

0 commit comments

Comments
 (0)