Initial commit: LangChain evolution tutorial deck (132 slides)

- Cover, TOC, 5 dividers, 3 recap slides
- 5 sections (chains, langgraph, deepagents, openswe, ecosystem)
- design-system.js with theme tokens + 9 helper functions
- research/: timeline + sources + per-tech notes
- final-compile.js + merge.js for rebuild pipeline
- output/: langchain-evolution.pptx (2.3 MB) + langchain-evolution.pdf (1.1 MB) + 7 sample previews
This commit is contained in:
2026-06-22 11:29:03 +03:00
parent ed5b5c91bf
commit 75601988c2
220 changed files with 13069 additions and 3 deletions
+52
View File
@@ -0,0 +1,52 @@
// Slide 08: ChatPromptTemplate -- from_messages + variables
// Code slide: declarative prompt construction with placeholders.
const ds = require('./design-system');
function createSlide(pres, theme) {
const slide = pres.addSlide();
ds.helpers.slideBase(slide, pres, theme);
ds.helpers.addHeader(slide, pres, theme, {
eyebrow: 'STAGE 1: CHAINS',
section: 'Prompts',
title: 'ChatPromptTemplate -- декларативно',
sectionNumber: 1,
});
ds.helpers.addCodeBlock(slide, pres, theme, {
x: 0.5, y: 1.5, w: 9.0, h: 3.25,
language: 'python',
filePath: 'examples/prompt_basic.py',
code: [
'from langchain_core.prompts import ChatPromptTemplate',
'from langchain.chat_models import init_chat_model',
'',
'prompt = ChatPromptTemplate.from_messages([',
' ("system", "Translate the following text to {language}."),',
' ("human", "{text}"),',
'])',
'',
'model = init_chat_model("openai:gpt-4.1-mini")',
'',
'# .invoke() принимает dict и подставляет переменные',
'messages = prompt.invoke({"language": "French", "text": "Hello world"})',
'print(messages.to_messages())',
'',
'# -> [SystemMessage(...), HumanMessage(...)] -- готов к model.invoke()',
].join('\n'),
});
ds.helpers.addCallout(slide, pres, theme, {
x: 0.5, y: 4.85, w: 9.0, h: 0.3,
kind: 'info',
text: 'Кортежи ("role", "text") -- шорткат. Для сложного контента передавайте Message-объекты.',
});
ds.helpers.addSourceLine(slide, pres, theme, {
source: 'python.langchain.com/docs/concepts/prompt_templates/',
});
ds.helpers.addPageNumber(slide, pres, theme, 8);
}
module.exports = { createSlide };