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:
@@ -0,0 +1,58 @@
|
||||
// Slide 07: Datasets -- create_dataset client API
|
||||
// Code slide: programmatic dataset creation + adding examples.
|
||||
|
||||
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 5: ECOSYSTEM',
|
||||
section: 'Datasets',
|
||||
title: 'create_dataset -- набор примеров под eval',
|
||||
sectionNumber: 5,
|
||||
titleSize: 24,
|
||||
});
|
||||
|
||||
ds.helpers.addCodeBlock(slide, pres, theme, {
|
||||
x: 0.5, y: 1.45, w: 9.0, h: 2.85,
|
||||
language: 'python',
|
||||
fontSize: 10,
|
||||
code: [
|
||||
'from langsmith import Client',
|
||||
'',
|
||||
'client = Client()',
|
||||
'',
|
||||
'# 1. Создаем датасет (или достаем существующий по имени)',
|
||||
'dataset = client.create_dataset(',
|
||||
' dataset_name="rag-qa-eval-v1",',
|
||||
' description="RAG golden set",',
|
||||
')',
|
||||
'',
|
||||
'# 2. Добавляем примеры пачкой: inputs + reference outputs',
|
||||
'client.create_examples(',
|
||||
' dataset_id=dataset.id,',
|
||||
' inputs=[{"q": "Что такое LCEL?"}, {"q": "Что такое HITL?"}],',
|
||||
' outputs=[{"a": "LangChain Expression Language"},',
|
||||
' {"a": "Human-in-the-loop через interrupt"}],',
|
||||
')',
|
||||
'',
|
||||
'# 3. Версионирование: новые данные -> новый датасет',
|
||||
'client.clone_dataset(dataset.id, dataset_name="rag-qa-eval-v2")',
|
||||
].join('\n'),
|
||||
});
|
||||
|
||||
ds.helpers.addCallout(slide, pres, theme, {
|
||||
x: 0.5, y: 4.5, w: 9.0, h: 0.55,
|
||||
kind: 'info',
|
||||
text: 'В UI датасеты можно создавать из CSV/JSONL через web -- API нужен для CI и автообновления.',
|
||||
});
|
||||
|
||||
ds.helpers.addSourceLine(slide, pres, theme, {
|
||||
source: 'docs.smith.langchain.com Evaluation > Datasets',
|
||||
});
|
||||
ds.helpers.addPageNumber(slide, pres, theme, 7);
|
||||
}
|
||||
|
||||
module.exports = { createSlide };
|
||||
Reference in New Issue
Block a user