langchain-model-inference
Installation
SKILL.md
LangChain Model Inference (Python)
Overview
AIMessage.content is a str on simple OpenAI calls and a list[dict] on Claude
the instant any tool_use, thinking, or image block enters the response.
Code that does message.content.lower() crashes with
AttributeError: 'list' object has no attribute 'lower' — the #1 first-production-call
LangChain 1.0 bug on Anthropic. And that is one of four separate "content shape"
pitfalls in this skill:
- P02 —
AIMessage.contentlist-vs-string divergence - P03 —
with_structured_output(method="function_calling")silently dropsOptional[list[X]]fields on ~40% of real schemas - P05 —
temperature=0is not deterministic on Anthropic even though it is on OpenAI - P58 — Claude expects the system message at position 0; middleware that reorders messages makes it silently ignored