Next.js Discord

Discord Forum

vercel ai sdk

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
const { object } = await generateObject({
      model: anthropic('claude-3-haiku-20240307'),
      schema: z.object({
        recipe: z.object({
          name: z.string(),
          ingredients: z.array(
            z.object({
              name: z.string(),
              amount: z.string()
            })
          ),
          steps: z.array(z.string())
        })
      }),
      messages: [
        {
          role: 'user',
          content: [
            {
              type: 'text',
              text: 'list all the stamps in these passport pages?'
            },
            {
              type: 'image',
              image: cleanBase64(text)
            }
          ]
        }
      ]
    })


anyone got a code sample for generating object with a base64image string

mine isn't working well

0 Replies