[GH-ISSUE #516] [langchain]: Consolidate LangChainJS docs requests #78

Open
opened 2026-02-17 17:19:07 -05:00 by yindo · 1 comment
Owner

Originally created by @christian-bromann on GitHub (Sep 12, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/516

Type of issue

request for content

Language

JavaScript

Description

Here is a list of docs requests related to LangChainJS:

Multimodal Message Schema for OpenAI Models - Docs + Error Improvements: include metadata property langchain-ai/langchainjs#8227

Issue with current documentation:

When creating a Multimodal message (PDF/Image) to an OpenAI chat model in the format below, our docs and error throwing is not clear that the metadata property is required. Currently, If the metadata property is not set correctly in a multimodal Base64ContentBlock message, we throw an unintuitive OpenAI error.

Improvement Suggestion

  1. Update the following documentation pages to include the metadata property. Side note, the python version has a more comprehensive schema documented than JS.
    LangGraphJS MultiModal Inputs
    Langgraph PY MultiModal Inputs
  2. Update the error when missing the metadata property in a Base64ContentBlock from @langchain/core/messages to say "missing required metadata property" instead of OpenAI error.

Base64ContentBlock

  // PDF Example Base64ContentBlock Message
  {
    type: "file",
    source_type: "base64",
    mime_type: "application/pdf",
    data,
    metadata: { filename: file.name },
  };
}
// Image Example Base64ContentBlock Message
{
      type: "image",
      source_type: "base64",
      mime_type: file.type,
      data,
      metadata: { name: file.name },
    };
Index requires that your documents table uses a GUID as your primary ID. langchain-ai/langchainjs#7607
Re: https://js.langchain.com/docs/how_to/indexing

According to @langchain/core/dist/indexing/base.js, the index function generates hashes for each of your documents prior to indexing them. Then, it attempts to write them to the database using the ids optional parameter.

        if (docsToIndex.length > 0) {
            await vectorStore.addDocuments(docsToIndex, { ids: uids });
            numAdded += docsToIndex.length - seenDocs.size;
            numUpdated += seenDocs.size;
        }

If you have setup your tables to use an integer or other type of unique id for the table, this function will not work properly if I'm understanding correctly.

Idea or request for content:

Please correct the documentation to either: a) add this as a notice or b) Add an example or configuration on how to use it with a different type of id, as I expect this will be relatively common.

Originally created by @christian-bromann on GitHub (Sep 12, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/516 ### Type of issue request for content ### Language JavaScript ### Description Here is a list of docs requests related to LangChainJS: <details> <summary> Multimodal Message Schema for OpenAI Models - Docs + Error Improvements: include metadata property langchain-ai/langchainjs#8227 </summary> <br> ### Issue with current documentation: When creating a Multimodal message (PDF/Image) to an OpenAI chat model in the format below, our docs and error throwing is not clear that the metadata property is required. Currently, If the metadata property is not set correctly in a multimodal [Base64ContentBlock](https://v03.api.js.langchain.com/interfaces/_langchain_core.messages.Base64ContentBlock.html#metadata) message, we throw an unintuitive OpenAI error. ### Improvement Suggestion 1. Update the following documentation pages to include the metadata property. Side note, the python version has a more comprehensive schema documented than JS. [LangGraphJS MultiModal Inputs](https://js.langchain.com/docs/how_to/multimodal_inputs/) [Langgraph PY MultiModal Inputs](https://python.langchain.com/docs/how_to/multimodal_inputs/) 2. Update the error when missing the metadata property in a [Base64ContentBlock](https://v03.api.js.langchain.com/interfaces/_langchain_core.messages.Base64ContentBlock.html#metadata) from `@langchain/core/messages` to say _**"missing required metadata property"**_ instead of OpenAI error. Base64ContentBlock ```typescript // PDF Example Base64ContentBlock Message { type: "file", source_type: "base64", mime_type: "application/pdf", data, metadata: { filename: file.name }, }; } ``` ```typescript // Image Example Base64ContentBlock Message { type: "image", source_type: "base64", mime_type: file.type, data, metadata: { name: file.name }, }; ``` </details> <details> <summary> Index requires that your documents table uses a GUID as your primary ID. langchain-ai/langchainjs#7607 </summary> <br> Re: https://js.langchain.com/docs/how_to/indexing According to `@langchain/core/dist/indexing/base.js`, the index function generates hashes for each of your documents prior to indexing them. Then, it attempts to write them to the database using the `ids` optional parameter. ``` if (docsToIndex.length > 0) { await vectorStore.addDocuments(docsToIndex, { ids: uids }); numAdded += docsToIndex.length - seenDocs.size; numUpdated += seenDocs.size; } ``` If you have setup your tables to use an integer or other type of unique id for the table, this function will not work properly if I'm understanding correctly. ### Idea or request for content: Please correct the documentation to either: a) add this as a notice or b) Add an example or configuration on how to use it with a different type of id, as I expect this will be relatively common. </details>
yindo added the langchaininternal labels 2026-02-17 17:19:07 -05:00
Author
Owner

@ddewaele commented on GitHub (Nov 28, 2025):

@christian-bromann :

Love what you guys are doing with LangChain but we just lost an entire day on this because the documentation is lacking for v1 / typescript :(

The PR mentioned here (https://github.com/langchain-ai/langchainjs/pull/8244) did fix the docs for this issue at some point but apparently these updates have been lost with the move to docs.langchain.com ? (I didn't see a mention of it anymore) Is this "older" documentation still available somewhere ?

It is taking a big toll on our developers (we are spending more time debugging LangChain than we are building apps with it).
Would love to help out, but unclear what the doc strategy is with the new v1 release.

@ddewaele commented on GitHub (Nov 28, 2025): @christian-bromann : Love what you guys are doing with LangChain but we just lost an entire day on this because the documentation is lacking for v1 / typescript :( The PR mentioned here (https://github.com/langchain-ai/langchainjs/pull/8244) did fix the docs for this issue at some point but apparently these updates have been lost with the move to docs.langchain.com ? (I didn't see a mention of it anymore) Is this "older" documentation still available somewhere ? It is taking a big toll on our developers (we are spending more time debugging LangChain than we are building apps with it). Would love to help out, but unclear what the doc strategy is with the new v1 release.
yindo changed title from [langchain]: Consolidate LangChainJS docs requests to [GH-ISSUE #516] [langchain]: Consolidate LangChainJS docs requests 2026-06-05 17:24:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#78