Skip to content

docs: add multimodal traces section (ChatPromptTemplate) #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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