langchain-core-workflow-a

Solid

Build LangChain chains and prompts for structured LLM workflows. Use when creating prompt templates, building LCEL chains, or implementing sequential processing pipelines. Trigger with phrases like "langchain chains", "langchain prompts", "LCEL workflow", "langchain pipeline", "prompt template".

AI & Automation 359 stars 65 forks Updated today MIT

Install

View on GitHub

Quality Score: 96/100

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

Skill Content

# LangChain Core Workflow A: Chains & Prompts ## Overview Build production-ready chains using LangChain Expression Language (LCEL) with prompt templates, output parsers, and composition patterns. ## Prerequisites - Completed `langchain-install-auth` setup - Understanding of prompt engineering basics - Familiarity with Python type hints ## Instructions ### Step 1: Create Prompt Templates ```python from langchain_core.prompts import ( ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate, MessagesPlaceholder ) # Simple template simple_prompt = ChatPromptTemplate.from_template( "Translate '{text}' to {language}" ) # Chat-style template chat_prompt = ChatPromptTemplate.from_messages([ SystemMessagePromptTemplate.from_template( "You are a {role}. Respond in {style} style." ), MessagesPlaceholder(variable_name="history", optional=True), HumanMessagePromptTemplate.from_template("{input}") ]) ``` ### Step 2: Build LCEL Chains ```python from langchain_openai import ChatOpenAI from langchain_core.output_parsers import StrOutputParser, JsonOutputParser llm = ChatOpenAI(model="gpt-4o-mini") # Basic chain: prompt -> llm -> parser basic_chain = simple_prompt | llm | StrOutputParser() # Invoke the chain result = basic_chain.invoke({ "text": "Hello, world!", "language": "Spanish" }) print(result) # "Hola, mundo!" ``` ### Step 3: Chain Composition ```python from langchain_core.runnables import RunnablePassth...

Details

Author
majiayu000
Repository
majiayu000/claude-skill-registry
Created
5 months ago
Last Updated
today
Language
HTML
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category