The Problem
Your AI generates product descriptions for an e-commerce catalog. Each product has a photo and a text description. You need to verify that descriptions actually match what is in the image — not hallucinate features, colors, or details. You also have a customer service bot that transcribes voicemails. You need to verify transcription accuracy against the original audio.What You Will Learn
- How to pass image URLs to the LLM judge alongside text
- How to auto-generate grading criteria from a short description using
generate_prompt=True - How to compare multiple images (input vs output)
- How to evaluate audio transcriptions
- How the SDK remains backwards-compatible with text-only evaluation
Prerequisites
This cookbook uses Gemini’s native vision and audio capabilities via LiteLLM. The images and audio files used are publicly accessible Google Cloud samples — no additional auth is needed.
Section 1: Image-Text Alignment
Pass animage_url alongside the text output to have the LLM judge evaluate whether the description matches the image.
Accurate Description
Hallucinated Description
Section 2: Auto-Generate Grading Criteria
Instead of writing a detailed rubric, describe what you want to evaluate in plain English and setgenerate_prompt=True. The SDK uses the LLM to generate a proper grading rubric automatically.
Section 3: Comparing Multiple Images
When you need to compare images, useinput_image_url and output_image_url to provide a reference image and a candidate image.
Section 4: Audio Transcription Evaluation
Pass anaudio_url to evaluate transcription accuracy against the original audio.
Section 5: Text-Only Still Works
The multimodal parameters are additive. When you omit image and audio URLs, the judge works exactly as before with text only.Supported Modality Parameters
All parameters accept publicly accessible URLs. The LLM processes them natively — no preprocessing or download step needed.
What to Try Next
You have completed all the cookbooks. Here are some directions to explore:Start from the beginning
Revisit local metrics to build a complete validation pipeline combining everything you have learned.
Built-in Evals Reference
Browse the full catalog of 50+ built-in evaluation metrics.