Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LangChainやるならPythonよりTypeScriptの方がいんじゃね?
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Optimisuke
November 22, 2023
Technology
1.3k
1
Share
LangChainやるならPythonよりTypeScriptの方がいんじゃね?
LangChain.jsの紹介です。
Optimisuke
November 22, 2023
More Decks by Optimisuke
See All by Optimisuke
量子コンピュータ勉強会#1
optimisuke
0
38
Node.jsでllama_2_.pdf
optimisuke
0
230
オンオフの切り替え
optimisuke
0
62
Other Decks in Technology
See All in Technology
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
180
Oracle Cloud Infrastructure presents managed, serverless MCP Servers for Oracle AI Database
thatjeffsmith
1
320
20260515 ID管理は会社を守る大切な砦!〜🔰情シス向け〜
oidfj
0
560
AWSアップデートから考える継続的な運用改善
toru_kubota
2
210
Agent の「自由」と「安全」〜未来に向けて今できること〜
katayan
0
360
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
4
180
AI対話分析の夢と、汚いデータの現実 Looker / Dataplex / Dataform で実現する品質ファーストな基盤設計
waiwai2111
0
520
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
410
オライリーイベント登壇資料「鉄リサイクル・産廃業界におけるAI技術実応用のカタチ」
takarasawa_
0
410
ワールドカフェ再び、そしてゴール・ルール・ロール・ツール / World Café Revisited, and the Goals-Rules-Roles-Tools
ks91
PRO
0
170
R&D 祭 2024 UE5で絵コンテ・作画の制作支援ツールをつくる話
olmdrd
PRO
0
140
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
450
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
350
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Prompt Engineering for Job Search
mfonobong
0
300
The Invisible Side of Design
smashingmag
302
52k
Ruling the World: When Life Gets Gamed
codingconduct
0
230
The Curious Case for Waylosing
cassininazir
1
340
Ethics towards AI in product and experience design
skipperchong
2
270
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
LangChain.js使ってみた 🦜🔗
改め
LangChainやるならPythonより TypeScriptの方がいんじゃね? 🦜🔗 >> ※個人の感想です。効果には個人差があります。
LangChain 🦜🔗?
https://www.langchain.com/
LangChain 🦜🔗? https://gihyo.jp/book/2023/978-4-297-13839-4
LangChain.js 🦜🔗? https://github.com/langchain-ai/langchainjs https://js.langchain.com/docs/get_started/introduction
LangChain.js 🦜🔗? https://github.com/langchain-ai/langchainjs https://github.com/langchain-ai/langchain
仮説 🦜🔗 - 使うのってData ScientistsじゃなくてSoftware Engineersじゃね? - なら、PythonよりTypeScriptの方がよくね?
🦜🔗 LangChain + Next.js Starter Template! https://github.com/langchain-ai/langchain-nextjs-template https://langchain-nextjs-template.vercel.app/
🦜🔗 LangChain + Next.js Starter Template! Chat ChatGPT的な動き 🧱
Structured Output jsonで返してくれるように設定(この後、各種APIと連携するため) 🦜 Agents LLMがAPIを呼んでくれる!? 🐶 Retrieval LLMがデータベースの検索もしてくれる!? 🤖 Retrieval Agents LLMがデータベースを検索しつつAPIも呼んでくれる!?
🦜🔗 LangChain + Next.js Starter Template! Chat ChatGPT的な動き 🐶
Retrieval LLMがデータベースの検索もしてくれる!?
Chat
None
🐶 Retrieval プロンプトに検索結果を入れることで、 LLMが学習していない情報を加味して回答を生成できる
🐶 Retrieval プロンプトに検索結果を入れることで、 LLMが学習していない情報を加味して回答を生成できる
None
retrieval Chain answer Chain conversational RetrievalQA Chain chat_history question standalone
Question Chain 🐶 Retrieval 会話履歴から 質問生成 検索 回答生成 アウトプット
Vercel AI SDK https://sdk.vercel.ai/docs
フロントエンド バックエンド
LangChain.jsの中身を少し
Model いい感じに抽象化されていて、モデルを変更しやすい
参考:Ollama🦙 https://ollama.ai/
Runnable https://js.langchain.com/docs/expression_language/interface あれもこれもRunnableもしくはRunnableLike
LangChain.jsの中身おわり
LangChainやるならPythonよりTypeScriptの方がよくね? WebアプリするならTypeScriptでよくね? Data Scientistsじゃなくてよくね→TypeScriptでよくね? Pythonで型ヒント書くなら、TypeScriptでよくね? (ただ、Pythonでサクッと書いてJupyter Notebookで試行錯誤のログを残すのは良いと思う) ※個人の感想です。効果には個人差があります。
LangChain.js使おう! 🦜🔗