When building AI applications, you often need agents that can analyze and understand visual content. Timbal lets you create image analysis agents that can identify objects, describe scenes, and answer questions about visual content using the tools parameter.
Use the agent directly by calling it with a prompt message that includes an image.
fromtimbal.types.fileimportFile
asyncdefmain():
image_url = get_sample_image()
# Create a message with image and text for the agent
prompt =[File.validate(image_url),"Analyze this image and identify the main objects or subjects. If there are animals, provide their common name and scientific name. Also describe the location or setting in one or two short sentences."]