langchain-hello-world

Featured

Create a minimal working LangChain example with LCEL chains. Use when starting a new LangChain integration, testing your setup, or learning LCEL pipe syntax with prompts and output parsers. Trigger: "langchain hello world", "langchain example", "langchain quick start", "simple langchain code", "first langchain app".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LangChain Hello World ## Overview Minimal working examples demonstrating LCEL (LangChain Expression Language) -- the `.pipe()` chain syntax that is the foundation of all LangChain applications. ## Prerequisites - Completed `langchain-install-auth` setup - Valid LLM provider API key configured ## Example 1: Simplest Chain (TypeScript) ```typescript import { ChatOpenAI } from "@langchain/openai"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { StringOutputParser } from "@langchain/core/output_parsers"; // Three components: prompt -> model -> parser const prompt = ChatPromptTemplate.fromTemplate("Tell me a joke about {topic}"); const model = new ChatOpenAI({ model: "gpt-4o-mini" }); const parser = new StringOutputParser(); // LCEL: chain them with .pipe() const chain = prompt.pipe(model).pipe(parser); const result = await chain.invoke({ topic: "TypeScript" }); console.log(result); // "Why do TypeScript developers wear glasses? Because they can't C#!" ``` ## Example 2: Chat with System Prompt ```typescript import { ChatOpenAI } from "@langchain/openai"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { StringOutputParser } from "@langchain/core/output_parsers"; const prompt = ChatPromptTemplate.fromMessages([ ["system", "You are a {persona}. Keep answers under 50 words."], ["human", "{question}"], ]); const chain = prompt .pipe(new ChatOpenAI({ model: "gpt-4o-mini" })) .pipe(new StringOutputParser()); const answe...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category