Skip to content

Commit

Permalink
Merge pull request #138 from mistralai/doc/v0.0.85
Browse files Browse the repository at this point in the history
Update docs to v0.0.85
  • Loading branch information
GaspardBT authored Sep 20, 2024
2 parents db0f537 + 876742b commit b057313
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions docs/capabilities/vision.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,29 @@ print(chat_response.choices[0].message.content)
</TabItem>
<TabItem value="typescript" label="typescript">
```typescript
import { Mistral } from "mistralai";
import { Mistral } from "@mistralai/mistralai";

const apiKey = process.env.MISTRAL_API_KEY;
const apiKey = process.env["MISTRAL_API_KEY"]!;

const mistral = new Mistral({apiKey: apiKey});
const client = new Mistral({ apiKey: apiKey });

const chatResponse = await mistral.chat.complete({
model: "pixtral-12b-2409",
messages: [
const chatResponse = await client.chat.complete({
model: "pixtral-12b",
messages: [
{
role: "user",
content: [
{ type: "text", text: "What's in this image?" },
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
},
{
"type": "image_url",
"image_url": "https://tripfixers.com/wp-content/uploads/2019/11/eiffel-tower-with-snow.jpeg"
}
]
}
]
}
);

console.log('JSON:', chatResponse.choices[0].message.content)
type: "image_url",
imageUrl: "https://tripfixers.com/wp-content/uploads/2019/11/eiffel-tower-with-snow.jpeg",
},
],
},
],
});

console.log("JSON:", chatResponse.choices[0].message.content);
```
</TabItem>
<TabItem value="curl" label="curl">
Expand Down

0 comments on commit b057313

Please sign in to comment.