You'd do something like this: ```typescript const messages = [ { role: "system", content: "You

You'd do something like this:

const messages = [
{
  role: "system",
  content: "You are a helpful assistant that can analyze images."
},
{
  role: "user",
  content: [
    {
      type: "text",
      text: "What's in this image?"
    },
    {
      type: "image_url",
      image_url: {
        url: datauri

      }
    },
    ... // extra
  ]
}
];


const aiResponse: any = await env.AI.run(
  "@cf/mistralai/mistral-small-3.1-24b-instruct",
  {
    messages: messages
  }
);
Was this page helpful?