'use client'; import { useRouter } from 'next/navigation'; import { useRef } 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 { IconArrowDown, IconArrowUpRight, IconCaretDown, IconSpark, } from '@/components/ui/Icons'; import { EXAMPLES } from '@/lib/constants'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { ThumbsDown, ThumbsUp } from 'lucide-react'; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible'; import { CodeBlock } from '@/components/ui/CodeBlock'; 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}

); })}

Vision Agent prompting tips

Be specific: Give concrete instructions to what you desire as output, avoid vague questions.

Detect people wearing helmet by detecting people, then detecting helmets, a person is wearing a helmet if the helmet is detected near the person.

Detect people wearing helmet

Start simple: Start with simple prompt to understand underlying tool performance first

-

Can you run OCR on this image and plot the detected text?

-

Can you detect the people in this image and visualize the result?

Focus on single problem: Each conversation should focus on solving single problem, start new conversations when switching task

Ask for visualization: You can simply add{' '} Visualize the result{' '} at the end of your prompt to visualize the result

); }