From 8d23727e3961856eed9dc91d1d2ec5c1b28cab5e Mon Sep 17 00:00:00 2001 From: ChungHyun Lee Date: Tue, 23 Dec 2025 16:41:23 +0900 Subject: [PATCH] docs: add mime_type to JavaScript PDF file content examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add explicit mime_type: "application/pdf" to JavaScript PDF document input examples (URL and base64) in the messages documentation. This clarifies that mime_type is required when using type: "file" content blocks with url or base64 sources, since providers don't infer MIME type from these sources. Note: file ID examples don't need mime_type since providers already know the MIME type from when the file was uploaded. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/oss/langchain/messages.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/oss/langchain/messages.mdx b/src/oss/langchain/messages.mdx index d6269faad5..2da3a021bd 100644 --- a/src/oss/langchain/messages.mdx +++ b/src/oss/langchain/messages.mdx @@ -1024,7 +1024,7 @@ for your chosen model for specifics. const message = new HumanMessage({ content: [ { type: "text", text: "Describe the content of this document." }, - { type: "file", source_type: "url", url: "https://example.com/path/to/document.pdf" }, + { type: "file", source_type: "url", url: "https://example.com/path/to/document.pdf", mime_type: "application/pdf" }, ], }); @@ -1036,6 +1036,7 @@ for your chosen model for specifics. type: "file", source_type: "base64", data: "AAAAIGZ0eXBtcDQyAAAAAGlzb21tcDQyAAACAGlzb2...", + mime_type: "application/pdf", }, ], });