LangChain Tutorial (Python) #3: Output Parsers (String, List, JSON)

  Рет қаралды 10,825

Leon van Zyl

Leon van Zyl

Күн бұрын

Пікірлер: 36
@alhabib_o
@alhabib_o Ай бұрын
I just wanted to say thank you for your incredible tutorials. I’m learning a lot and loving every minute of it!
@leonvanzyl
@leonvanzyl Ай бұрын
Thank you very much for the feedback!
@daltheman
@daltheman 8 ай бұрын
As a tech teacher for over 20 years, I have to say that your teaching is excellent. You are beyond just being a programmer. Thank you and keep teaching us!
@leonvanzyl
@leonvanzyl 8 ай бұрын
Wow, that is amazing feedback! Thank you!!
@rrioclkls7721
@rrioclkls7721 10 ай бұрын
your videos have brought me back from the brink of insanity, thank you.
@leonvanzyl
@leonvanzyl 10 ай бұрын
You're welcome 🤗
@lindseyfisher8021
@lindseyfisher8021 8 ай бұрын
These videos are incredibly helpful! I've watched tons of tutorials and yours just make the concepts so clear and easy to follow! Subscribed and look forward to more
@leonvanzyl
@leonvanzyl 8 ай бұрын
Thank you 🙏
@ahassan7270
@ahassan7270 11 ай бұрын
You are wonderful man. You have EXTRAORDINARY way in delivering and explaining information. I really get great benefit from your channel. Thank you so much for your great efforts and sharing such important information.👏👏
@leonvanzyl
@leonvanzyl 11 ай бұрын
This comment truly motivates me. Thank you very much! Please press like on the video to help put this video in front of more people
@ahassan7270
@ahassan7270 11 ай бұрын
Already I did. Once again thank you so much for sharing this information.@@leonvanzyl
@ishandindorkar2846
@ishandindorkar2846 8 ай бұрын
Thank you for creating this video. It helped me a lot.
@leonvanzyl
@leonvanzyl 8 ай бұрын
You're welcome 🤗
@Matt-hp1cl
@Matt-hp1cl 8 ай бұрын
Excellent tutorial, so clearly explained, thank you. I needed the JSON parser.
@leonvanzyl
@leonvanzyl 8 ай бұрын
You're welcome
@yingzhaozhou4319
@yingzhaozhou4319 4 ай бұрын
Incredible and intuitive lecture.
@leonvanzyl
@leonvanzyl 4 ай бұрын
Thank you
@aravindk8188
@aravindk8188 9 ай бұрын
You are simply genius.
@AssassinUK
@AssassinUK Жыл бұрын
This and your previous video have been great! But I started following you based on your Flowise videos and now I use Flowise a lot for production work as well. Are you going to make a Flowise version of your videos based on these videos at all? Don't forget your Flowise followers 😉
@leonvanzyl
@leonvanzyl Жыл бұрын
I have not forgotten about Flowise at all, don't worry. I am literally working on an updating Flowise tutorial series, as we speak. A lot has changed since that original series.
@ДенисСобиров
@ДенисСобиров 6 ай бұрын
Best tutorial!
@leonvanzyl
@leonvanzyl 6 ай бұрын
Thank you 😊
@fatiga2426
@fatiga2426 8 ай бұрын
Hi, great video! I was wondering, would it be fine if we just got the string from the content of the AI Message Object instead of using a parser? I noticed everyone uses parsers for this but I'm not sure why yet. Thanks!
@rogerwmwong
@rogerwmwong 8 ай бұрын
I am trying to follow your tutorial. When I am writing the statement "parser = JsonOutputPaser(pydantic_object=Person)", there is no "pydantic_object" although I can find "pydantic" and "pydantic_core", should I use "pydantic" instead?
@rogerwmwong
@rogerwmwong 8 ай бұрын
I tried "parser = JsonOutputParser(pydantic=Person)" and it works! Thanks!
@leonvanzyl
@leonvanzyl 8 ай бұрын
Thank you for sharing!
@alokbhatt84
@alokbhatt84 8 ай бұрын
I am trying to extract 3rd field as address from my prompt apart from name and age. But I am not getting any output why? Is it because we can only output two fields from the json parser?
@leonvanzyl
@leonvanzyl 8 ай бұрын
There is no limit to the amount of fields. Ensure that your system prompt as well as the output parser have the 3rd field in them.
@alokbhatt84
@alokbhatt84 8 ай бұрын
@@leonvanzyl I am using this function def call_json_output_parser(): prompt = ChatPromptTemplate.from_messages([ ("system", "Extract information from following phrase. Formatting instruction: {format_instruction}"), ("human","{phrase}") ]) class Person(BaseModel): name: str = Field(description = "name of the person") age : int = Field(description = "age of the person") address: str = Field(description = "address of the person") parser = JsonOutputParser(pydantic_object=Person) chain = prompt | llm | parser return chain.invoke({ "phrase":"Max is thirty years old. He lives in 492, Kamal Market, Delhi. He studies in Convent school.", "format_instruction":parser.get_format_instructions() }) After printing this I am not getting any output. consol output is this {'properties': {'name': {'title': 'Name', 'description': 'name of the person', 'type': 'string'}, 'age': {'title': 'Age', 'description': 'age of the person', 'type': 'integer'}, 'address': {'title': 'Address', 'description': 'address of the person', 'type': 'string'}}, 'required': ['name', 'age', 'address']} However If I am commenting address field from the pydantic, I am able to print age and name. Not sure where I am making the mistake
@iammadhankumar
@iammadhankumar 10 ай бұрын
Hi, which model should we use for code migration? For example, migrating a Java servlet controller to a Spring Boot controller.
@leonvanzyl
@leonvanzyl 10 ай бұрын
GPT 4 and Clause Sonnet would be perfect for your use-case.
@overprismatic-rv1ci
@overprismatic-rv1ci 8 ай бұрын
Why your terminal has such cool colors? Mine is all white. Also my code has different colors...
@leonvanzyl
@leonvanzyl 8 ай бұрын
I think it's because I was using the PowerShell terminal 😊
@CreatewwwPl
@CreatewwwPl 9 ай бұрын
Leo, You should import `pydantic.v1` instead of `langchain_core.pydentic_v1`.
@leonvanzyl
@leonvanzyl 9 ай бұрын
Oh my goodness, did they move things around again? Thanks 😊
@CreatewwwPl
@CreatewwwPl 9 ай бұрын
@@leonvanzyl yes
Local GraphRAG with LLaMa 3.1 - LangChain, Ollama & Neo4j
15:01
Coding Crash Courses
Рет қаралды 38 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,3 МЛН
Build AI Agents with PydanticAI & Riza
18:42
Riza, Inc.
Рет қаралды 5 М.
Avoid These BAD Practices in Python OOP
24:42
ArjanCodes
Рет қаралды 84 М.
Using AI Structured Output with NextJS & React
18:12
Jack Herrington
Рет қаралды 9 М.
Modern Python logging
21:32
mCoding
Рет қаралды 215 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 341 М.
SQLModel + FastAPI: Say Goodbye to Repetitive Database Code
19:50
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН