Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/observability/how_to_guides/log_multimodal_traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import {

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

:::tip
If you're using LangChain, refer to the [multimodal traces section in the LangChain guide](./trace_with_langchain#log-multimodal-traces) for examples using `ChatPromptTemplate`.
:::

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.

<CodeTabs
Expand All @@ -25,7 +29,7 @@ response = client.chat.completions.create(
{
"role": "user",
"content": [
{"type": "text", "text": "Whats in this image?"},
{"type": "text", "text": "What's in this image?"},
{
"type": "image_url",
"image_url": {
Expand All @@ -47,7 +51,7 @@ const response = await wrappedClient.chat.completions.create({
{
role: "user",
content: [
{ type: "text", text: "Whats in this image?" },
{ type: "text", text: "What's in this image?" },
{
type: "image_url",
image_url: {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading