Skip to main content
Weave supports logging and displaying video, images, and audio.

Video

Weave automatically logs videos using moviepy. This allows you to pass video inputs and outputs to traced functions, and Weave will automatically handle uploading and storing video data.
Video support is currently only available in Python.
For usage information, see Video Support.

Images

Logging type: PIL.Image.Image.
Base64-encoded image strings (e.g., data:image/jpeg;base64,...) are technically supported but discouraged. They can cause performance issues and should only be used if absolutely necessary (e.g., for integration with specific APIs).
The following example shows how to log an image generated via the OpenAI DALL-E API:
This image is logged to Weave and automatically displayed in the UI. Screenshot of pumpkin cat trace view

Resize large images before logging

It can be helpful to resize images before logging to reduce UI rendering cost and storage impact. You can use postprocess_output in your @weave.op to resize an image.

Audio

Logging type: wave.Wave_read. The following example shows how to log an audio file using OpenAI’s speech generation API.
This audio is logged to Weave and automatically displayed in the UI, along with an audio player. In the audio player, you can view and download the raw audio waveform. Screenshot of audio trace view
Try our cookbook for Audio Logging or
Open In Colab
Open in Colab
. The cookbook also includes an advanced example of a Real Time Audio API based assistant integrated with Weave.