Agent skill · software engineering · jeremylongshore

langchain-content-blocks

Works correctly with LangChain 1.0's typed content blocks on AIMessage.content\n\

Why this skill is useful

Adds executable scripts and detailed handling for multi-modal content blocks in LangChain that are not covered in public documentation.

What it needs

Requires langchain-anthropic, langchain-openai, python installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

LangChain Content Blocks (Python) Overview On Claude, AIMessage.content is list[dict] even for pure text — so any code from an OpenAI-first tutorial that calls message.content.lower() or message.content.split() crashes with AttributeError: 'list' object has no attribute 'lower' on the first production Claude call (P02). Multi-modal code that works on GPT-4o breaks on Claude because pre-1.0 image-block shapes differed across providers (P64). Multi-turn Claude replay with extended thinking fails with anthropic.BadRequestError: missing signature when prior thinking blocks are stripped. Forced toolchoice prevents stopreason="endturn" and loops forever (P63). This is the deep-dive companion to langchain-model-inference. That skill's references/content-blocks.md covers the str vs list[dict] divergence and a safe text extractor. This skill goes further: tooluse block iteration mechanics — IDs, args as dict vs JSON string, streaming deltas thinking blocks — signature, redaction, multi-turn replay semantics document blocks — Claude citations API, source types, citation extraction Multi-modal composition — universal 1.0 image shape, per-provider adapter behavior Per-provider size limits (Anthropic 5 MB/image up to 20 images, OpenAI 20 MB/image, Gemini 20 MB/request) Pin: langchain-core 1.0.x, langchain-anthropic >= 1.0, langchain-openai >= 1.0, anthropic >= 0.40. Pain-catalog anchors: P02, P58, P63, P64. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/langchain-content-blocks--7dcf61

View the source on GitHub

Browse the @skills marketplace