# Execute the multi-step pipeline
generate_opik_story()
```

The trace can now be viewed in the UI with hierarchical spans showing the relationship between different steps:

<Frame>
  <img src="https://files.buildwithfern.com/https://opik.docs.buildwithfern.com/docs/opik/2026-01-30T17:33:07.444Z/img/cookbook/gemini_trace_decorator_cookbook.png" />
</Frame>

## Multimodal Content Attachments

The `track_genai` wrapper automatically logs multimodal content parts (images, audio, video) as attachments in your traces. When you send images or other media to Gemini models, they are captured and viewable directly in the Opik UI alongside your trace data.

This makes it easy to:

* Review the exact media content sent to the model
* Debug multimodal prompts
* Audit model inputs for compliance

## Video Generation (Veo)

The `track_genai` wrapper also supports Google's Veo video generation API. When you generate videos, Opik automatically tracks the video creation process and logs the generated video as an attachment when you save it.

```python
import os
import time
import opik
from opik import track, opik_context
from opik.integrations.genai import track_genai
import google.genai as genai
from google.genai.types import HttpOptions, GenerateVideosConfig

os.environ["OPIK_PROJECT_NAME"] = "genai-video-demo"