langchainlisted
Install: claude install-skill claude-dev-suite/claude-dev-suite
# LangChain
## LCEL (LangChain Expression Language — recommended)
```python
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
model = ChatAnthropic(model="claude-sonnet-4-20250514")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant specialized in {topic}."),
("human", "{question}"),
])
# Pipe syntax
chain = prompt | model | StrOutputParser()
result = chain.invoke({"topic": "Python", "question": "Explain decorators"})
# Streaming
async for chunk in chain.astream({"topic": "Python", "question": "Explain decorators"}):
print(chunk, end="")
```
### TypeScript
```typescript
import { ChatAnthropic } from '@langchain/anthropic';
import { ChatPromptTemplate } from '@langchain/core/prompts';
import { StringOutputParser } from '@langchain/core/output_parsers';
const model = new ChatAnthropic({ model: 'claude-sonnet-4-20250514' });
const prompt = ChatPromptTemplate.fromMessages([
['system', 'You are a helpful assistant specialized in {topic}.'],
['human', '{question}'],
]);
const chain = prompt.pipe(model).pipe(new StringOutputParser());
const result = await chain.invoke({ topic: 'TypeScript', question: 'Explain generics' });
```
## RAG Chain
```python
from langchain_community.vectorstores import Chroma
from langchain_anthropic import ChatAnthropic
from langchain_openai import OpenAIEmbeddings
from langchain_core.prompts