LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsmiddlewarescrubUnsupportedMultimodalContent
Function●Since v1.14

scrubUnsupportedMultimodalContent

Without this, a request carrying content the model can't accept (e.g. a .zip file sent to a model without file support) fails with a non-retryable 400, and since the content stays in history, every later turn fails the same way. Only the request is changed; messages in state are left untouched, so switching to a model that accepts the content sends it again.

Copy
scrubUnsupportedMultimodalContent(
  messages: readonly BaseMessage<MessageStructure<MessageToolSet>, MessageType>[],
  model: unknown
): BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]

Parameters

NameTypeDescription
messages*readonly BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]
model*unknown
View source on GitHub