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

Conversation

PeriniM
Copy link

@PeriniM PeriniM commented Apr 21, 2025

This PR adds the Log multimodal traces section in how_to_guides/trace_with_langchain#log-multimodal-traces. This is useful to showcase ChatPromptTemplate's capabilities in appending images and visualize them in langsmith.

image

To-do

  • Test python scripts
  • Test Typescript scripts

@PeriniM PeriniM self-assigned this Apr 21, 2025
Copy link

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langsmith-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 3:47pm

import * as fs from "fs";

function encodeImageToBase64(imagePath: string): string {
const imageBuffer = fs.readFileSync(imagePath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would use async?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok added async loading of the image, lmk

Copy link
Contributor

@dqbd dqbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return messages;
}

async function createMultiImagePrompt(): Promise<ChatPromptTemplate> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this does not need to be async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants