'use client'; import { useRouter } from 'next/navigation'; import { useRef, useState } from 'react'; import Composer, { ComposerRef } from '@/components/chat/Composer'; import { dbPostCreateChat } from '@/lib/db/functions'; import { nanoid } from '@/lib/utils'; import Chip from '@/components/ui/Chip'; import { IconArrowUpRight } from '@/components/ui/Icons'; const EXAMPLES = [ { title: 'Counting flowers in image', mediaUrl: 'https://vision-agent-dev.s3.us-east-2.amazonaws.com/examples/flower.png', prompt: 'Detect flowers in this image, draw boxes and output the image, also return total number of flowers', }, { title: 'Detecting sharks in video', mediaUrl: 'https://vision-agent-dev.s3.us-east-2.amazonaws.com/examples/shark3_short.mp4', prompt: 'Can you detect any surfboards or sharks in the video, draw a green line between the shark and the nearest surfboard and add the distance between them in meters assuming 30 pixels is 1 meter. Make the line red if the shark is within 10 meters of a surfboard. Sample the video at 1 frames per second and save the output video as output.mp4.', }, ]; export default function Page() { const router = useRouter(); const composerRef = useRef(null); return (

Vision Agent BETA

Generate code to solve your vision problem with simple prompts.

{ const newId = nanoid(); const resp = await dbPostCreateChat({ id: newId, title: `conversation-${newId}`, mediaUrl, message: { prompt: input, mediaUrl, }, }); if (resp) { router.push(`/chat/${newId}`); } }} />
{EXAMPLES.map((example, index) => { return ( { composerRef.current?.setInput(example.prompt); composerRef.current?.setMediaUrl(example.mediaUrl); }} >

{example.title}

); })}
); }