[PR #2007] [MERGED] JS: add mime_type to JavaScript PDF file content examples #2051

Closed
opened 2026-02-17 17:23:00 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2007
Author: @chunghyunleeme
Created: 12/23/2025
Status: Merged
Merged: 1/14/2026
Merged by: @hntrl

Base: mainHead: fix/add-mime-type-to-file-content-examples


📝 Commits (5)

  • 8d23727 docs: add mime_type to JavaScript PDF file content examples
  • 096d3de Merge branch 'main' into fix/add-mime-type-to-file-content-examples
  • 171b064 Merge branch 'main' into fix/add-mime-type-to-file-content-examples
  • 349111e Merge branch 'main' into fix/add-mime-type-to-file-content-examples
  • d4e0d9f Merge branch 'main' into fix/add-mime-type-to-file-content-examples

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 src/oss/langchain/messages.mdx (+2 -1)

📄 Description

Summary

  • Add explicit mime_type: "application/pdf" to JavaScript PDF document input examples in the messages documentation

Issue

When using type: "file" content blocks with source_type: "url" for PDF files, providers like Google Vertex AI require an explicit mime_type field. However, the current documentation examples don't include this field, which can lead to errors when users follow the examples.

For example, without mime_type, Vertex AI receives application/octet-stream as the default MIME type, which it doesn't recognize as a valid PDF document.

Changes

Updated JavaScript examples in src/oss/langchain/messages.mdx:

  • Added mime_type: "application/pdf" to URL source example
  • Added mime_type: "application/pdf" to base64 source example

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/2007 **Author:** [@chunghyunleeme](https://github.com/chunghyunleeme) **Created:** 12/23/2025 **Status:** ✅ Merged **Merged:** 1/14/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `fix/add-mime-type-to-file-content-examples` --- ### 📝 Commits (5) - [`8d23727`](https://github.com/langchain-ai/docs/commit/8d23727e3961856eed9dc91d1d2ec5c1b28cab5e) docs: add mime_type to JavaScript PDF file content examples - [`096d3de`](https://github.com/langchain-ai/docs/commit/096d3dec1e4a3ab2b2d095ac15cb80d01b640be3) Merge branch 'main' into fix/add-mime-type-to-file-content-examples - [`171b064`](https://github.com/langchain-ai/docs/commit/171b064941e687d2a56a552bf5fe6682bb70af82) Merge branch 'main' into fix/add-mime-type-to-file-content-examples - [`349111e`](https://github.com/langchain-ai/docs/commit/349111ef41f60444841b0d4647c15eabec518a42) Merge branch 'main' into fix/add-mime-type-to-file-content-examples - [`d4e0d9f`](https://github.com/langchain-ai/docs/commit/d4e0d9fce21641f0afc83acba5694c64b4ab7c73) Merge branch 'main' into fix/add-mime-type-to-file-content-examples ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/messages.mdx` (+2 -1) </details> ### 📄 Description ## Summary - Add explicit `mime_type: "application/pdf"` to JavaScript PDF document input examples in the messages documentation ## Issue When using `type: "file"` content blocks with `source_type: "url"` for PDF files, providers like Google Vertex AI require an explicit `mime_type` field. However, the current documentation examples don't include this field, which can lead to errors when users follow the examples. For example, without `mime_type`, Vertex AI receives `application/octet-stream` as the default MIME type, which it doesn't recognize as a valid PDF document. ## Changes Updated JavaScript examples in `src/oss/langchain/messages.mdx`: - Added `mime_type: "application/pdf"` to URL source example - Added `mime_type: "application/pdf"` to base64 source example --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:23:00 -05:00
yindo closed this issue 2026-02-17 17:23:00 -05:00
yindo changed title from [PR #2007] JS: add `mime_type` to JavaScript PDF file content examples to [PR #2007] [MERGED] JS: add `mime_type` to JavaScript PDF file content examples 2026-06-05 18:16:23 -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#2051