LangChain Tutorial (JS) #3: Output Parsers

preview_player
Показать описание
#openai #langchain #langchainjs

We can convert the AI-responses into complex structures, like CSV, JSON, Arrays and much more using LangChain Output Parsers.

☕ Buy me a coffee:

📑 Useful Links:

💬 Chat with Like-Minded Individuals on Discord:

🧠 I can build your chatbots for you!

🕒 TIMESTAMPS:
00:00 - Introduction to Output Parsers
00:52 - Project Setup
01:14 - Output Parser Types
02:00 - String Output Parser
02:38 - Quick note on LCEL
03:11 - List Output Parser
03:21 - Refactor Code
06:45 - Structured Output Parser
11:25 - Zod Stuctured Output Parser
Рекомендации по теме
Комментарии
Автор

Excellent tut. Other youtubers made this topic so complicated but you explained it so well!! You are underrated

ramafa
Автор

Great! I'll be keeping an eye on your channel! There is very little "LangChain" content in JS, thank you very much

eivanmtzleal
Автор

This series took me pretty far! Invaluable!

cyborgmetropolis
Автор

this is really amazing content, the way of explanation is quite clear, thanks a lot

RABWA
Автор

Very useful, It even helped me understand some of the python code that's out there using this same feature.

Props to you! Subscribed and liked your series

jandramila
Автор

you just earned a sub my friend, great series!!

salmantanvir
Автор

please explain long chat history with redis. thank you

zhitoobit
Автор

Hey great video. How can I get amount of tokens used when using parsers?

michal-xp
Автор

Hey StrcutredOutputParser giving parse erros sometimes as LLM not following the format instructions everytime.

abirdutta
Автор

Is it possible to stream api using an output parser? Struggling to make that work

yoelfdz
Автор

Hey can you explain where to add the output parser if I wanna use loadQAStuffChain from lanchain js?

abirdutta
Автор

For the zod out try this -

const callZodOutputParser = async () => {
const prompt =
`Extract information from the phrase and the answer,
Formatting Instructions: {format_instructions}
Phrase: {phrase}`
);

const outputParser =
z.object({
recipe: z.string().describe("name of recipe"),
ingredients: z.array(z.string()).describe("ingredients"),
})
);
const chain =
return await chain.invoke({
phrase: "Can you tell me the ingredients to a Spaghetti Bolognese",
format_instructions: outputParser.getFormatInstructions(),
});
};

tebogo