Skip to main content

Log multimodal traces

LangSmith supports logging and rendering images as part of traces. This is currently supported for multimodal LLM runs.

In order to log images, use wrap_openai/ wrapOpenAI in Python or TypeScript respectively and pass an image URL or base64 encoded image as part of the input.

from openai import OpenAI
from langsmith.wrappers import wrap_openai

client = wrap_openai(OpenAI())

response =
"role": "user",
"content": [
{"type": "text", "text": "What’s in this image?"},
"type": "image_url",
"image_url": {
"url": "",

The image will be rendered as part of the trace in the LangSmith UI.

Was this page helpful?

You can leave detailed feedback on GitHub.