NEW LangChain Expression Language!!

  Рет қаралды 17,181

Sam Witteveen

Sam Witteveen

Күн бұрын

Colab: drp.li/e9trR
Blog: blog.langchain.dev/langchain-...
My Links:
Twitter - / sam_witteveen
Linkedin - / samwitteveen
Github:
github.com/samwit/langchain-t... (updated)
github.com/samwit/llm-tutorials
Timestamps
00:00 Intro
01:03 LangChain Expression Language Blog
01:40 LangChain App Learn the Language through Chat
03:15 Code Time
05:34 Bindings
06:31 Adding OpenAI Functions
07:47 Function Output Parsers
08:39 Retriever
13:05 Tools
14:00 Arbitrary Functions

Пікірлер: 58
@georgesanchez8051
@georgesanchez8051 10 ай бұрын
You, Greg Kamradt, and James Briggs (and echohive, whom I think is extremely underrated) are such invaluable resources for this community. The best part about getting new ground-breaking features (besides having new things to try) is the anticipation for your next video where you break it all down
@guanjwcn
@guanjwcn 10 ай бұрын
I totally agree. But I didn’t see Greg publish any in recent weeks.
@micbab-vg2mu
@micbab-vg2mu 10 ай бұрын
We follow the same KZbinrs :)
@andrewlaery
@andrewlaery 10 ай бұрын
100% agree (Sam, James add so much value in this space) Greg is a new one for me… Thx! Also really enjoy Part Time Larry (some great use cases) and Patrick Loeber (good at explaining basics), and Sentdex (generally)
@ChrisadaSookdhis
@ChrisadaSookdhis 10 ай бұрын
This is quite a change! I particularly like how retrieval can be written now with the passthrough. I’ll have to rework my code, but seems worth it for the ability to do more complex stuffs and keep code understandable. Thank you for another great video!
@marcova10
@marcova10 10 ай бұрын
it is scary to upgrade the library and see all the code crashing, the amount of reworks can be massive
@christopheprotat
@christopheprotat 10 ай бұрын
You make my day. This update comes at the perfect time. Thanks for the cookbook. You create my homework for this evening. I will test it on hf models
@alexanderroodt5052
@alexanderroodt5052 10 ай бұрын
Using similar techniques I am converting raw scraped data in to usable form at about 5000-10000 words per hour. Its so awesome!
@micbab-vg2mu
@micbab-vg2mu 10 ай бұрын
The update looks promising - thank you for the video.
@guanjwcn
@guanjwcn 10 ай бұрын
Maybe I got too much used to the old way of langchain. I feel it’s quite some big change in this update. For example, putting prompt as an input parameter is easier to understand as opposed to the pipe command in my view.
@parasetamol6261
@parasetamol6261 10 ай бұрын
Thank you. for everthing.
@jeffersonhope2668
@jeffersonhope2668 10 ай бұрын
Many thanks for this excellent update.
@AdrienSales
@AdrienSales 10 ай бұрын
Piping is so elegant !
@uniqued4ve
@uniqued4ve 10 ай бұрын
very good examples.
@at_sofdog
@at_sofdog 10 ай бұрын
Legend. Thank youu
@zaursamedov8906
@zaursamedov8906 10 ай бұрын
Again great tutorial. Can u do it one on aws falcon lite please?
@Diego_UG
@Diego_UG 10 ай бұрын
I am interested in the part to see how now it will be asked to respond to a json, and that it delivers the expected result, I am using create_tagging_chain_pydantic, so what would its new use be like?
@paulocoronado2376
@paulocoronado2376 10 ай бұрын
Awesome, Sam! This is very interesting, however I didn't find a way of setting an agent with multiple tools (usually with a description) and let the agent decide which one to use. 🤔
@samwitteveenai
@samwitteveenai 10 ай бұрын
I think they are still thinking how to handle Agents with the LCEL, currently its not supported, but I expect it will be soon
@robcz3926
@robcz3926 10 ай бұрын
pls can you make a video about deploying an open source LLM as an API service.not necessarily building one but at least a walk-through of what one has to consider in terms of computing power for serving the model and handling multiple concurrent requests etc...much appreciated
@simasjanusas1766
@simasjanusas1766 10 ай бұрын
You could potentially use a lambda function (cloud function - gcp), which would combine request input with the LLM stored on some cloud storage, to run inference against the input. Storage is cheap, compute would be only on demand, and cost lower. Unless I am missing something?
@clray123
@clray123 10 ай бұрын
@@simasjanusas1766 Yes, you are missing the model loading time (need to keep model warm in GPU memory) and the need to batch together inputs if you want acceptable performance and hardware cost at scale. See vLLM, Ray.
@clray123
@clray123 10 ай бұрын
This whole langchain fiasco reminds me of Object Relaltional Mapping (ORM) layers. Abstracting away the thing which is not really helpful to be abstracted, caused all sorts of problems in the process (you HAVE to look under the hood to understand what is going on, so hiding stuff under fancy shmancy APIs and auto-generating pieces that you would rather avoid auto-generated are not helpful). Piling up higher is not going to solve this, the solution is to get rid of the useless proxies and KISS.
@Ascended23
@Ascended23 10 ай бұрын
So far I agree with you (as someone who never liked having SQL queries abstracted away from me.) I use libraries when it's doing a thing that would be extremely difficult or impossible to figure out how to manage on my own. That's why I'll use something like Vue or React, so far I'm not seeing the need here.
@HostileRespite
@HostileRespite 10 ай бұрын
We should form a group, get tatoos and call ourselves the Lang Chain Gang.
@JonRyan-yv3oc
@JonRyan-yv3oc 10 ай бұрын
would it be possible do you think to make a custom agent like react using lcel? would love to see that
@yayingzhang1506
@yayingzhang1506 6 ай бұрын
Thanks for the explanation! I get that they are trying to make it simpler, but I still feel it's confusing. Still don't feel I can program freely any way I want....
@haristan1960
@haristan1960 10 ай бұрын
nice walkthrough!. can you compare it with Microsoft guidance ?
@samwitteveenai
@samwitteveenai 10 ай бұрын
guidance is quite different. I should make a video about though thanks for reminding me
@____2080_____
@____2080_____ 10 ай бұрын
Although I am extremely happy with the evolution of the package and program, me with my product management background and innovation cap on, Saul Lang Chang to be very interesting in a sense that it totally disrupts the paradigm of programming. I’m beginning to suspect that the criticisms that I’ve seen across the way literally comes from developers, fearing that disruption and not being able to adapt, and to take LangChain’s lead than any real concern over not understanding it.
@zalorthethird
@zalorthethird 6 ай бұрын
What I don't understand is at around 11:11, how does the retriever know what question to query the vector database for? I don't understand the, {"context": retriever, "question": RunnablePassthrough()} syntax. I kind of get the RunnablePassthrough. It's just what you are passing in when you invoke the chain and that is passed along to each step in the chain, right? I don't understand how the retriever knows what the question is.
@olb47
@olb47 10 ай бұрын
Is this the newer way of making chains and 'old' way of chaining will be deprecated?
@samwitteveenai
@samwitteveenai 10 ай бұрын
not yet but possibly in the future, I think they will wait to see how popular it is
@qingtian1691
@qingtian1691 10 ай бұрын
I did this change, and it did not work, could you explain why? # chain = { # "context": itemgetter("question") | retriever, # "question": itemgetter("question"), # "language": itemgetter("language") # } | prompt | model | StrOutputParser() chain = { "context": retriever, "question": itemgetter("question"), "language": itemgetter("language") } | prompt | model | StrOutputParser()
@piotrecode
@piotrecode 10 ай бұрын
Do you know how to send soruce of file with that? i also need 'refine' option here. Cannot find it in docs chain = { "context": itemgetter("question") | retriever, "question": itemgetter("question"), "language": itemgetter("language") } | prompt | llm
@samwitteveenai
@samwitteveenai 10 ай бұрын
What do you mean by "send the source of the file" ?
@piotrecode
@piotrecode 10 ай бұрын
Please give me link to this blog post :)
@samwitteveenai
@samwitteveenai 10 ай бұрын
Hve added it the description as well thanks for reminding me. blog.langchain.dev/langchain-expression-language/
@regularSenseAppeal
@regularSenseAppeal 7 ай бұрын
I don't understand 6:23 at all. Your prompt at this point is "tell me 3 interesting facts about {subject}" then you go straight to : functions_chain = prompt | model.bind(function_call={"name": "joke"}, functions=functions) I can't see how that prompt about 'tell me 3 interesting facts...' is in any way related to the joke function? Could anybody elaborate please?
@stanTrX
@stanTrX 22 күн бұрын
My brain burned
@heythere6390
@heythere6390 10 ай бұрын
it's still convoluted as hell. like they just want to throw names and terminology at you all the time.
@hansofmadata3565
@hansofmadata3565 10 ай бұрын
It’s been a frustrating year trying to build production apps in this space, but that’s what we get for trying to be early 🤷‍♂️
@clray123
@clray123 10 ай бұрын
They are making a complicated DSL for a simple task (parsing and passing around pieces of text).
@NoidoDev
@NoidoDev 9 ай бұрын
@@clray123 Pretty sure this is being done with the future in mind, the idea is to build on it.
@knoopx
@knoopx 10 ай бұрын
meh, not sure i like it, i guess i will have to try first but personally i think a proper templating language would make much more sense.
@samwitteveenai
@samwitteveenai 10 ай бұрын
got me curious. I have been working on a project like this, what would you like to see in a "proper" templating language?
@knoopx
@knoopx 10 ай бұрын
data binding and flow control mostly, essentially a textual way to define a full chain without having to manually glue the inputs/outputs of each individual step through python. microsoft/guidance follows that approach. for a pure python DSL i would prefer something along the lines of prefecthq/marvin.
@Jonathan-rm6kt
@Jonathan-rm6kt 6 ай бұрын
Hey Sam I appreciate your videos, but I have to say that Langchain throwing in this new syntaxt has not helped at all for me. Most of the documentation and guides has not been updated to show how it's used (anything beyond toy examples), and I've found that the syntax provides for even *less* introspection. For example, when askign the docs how to inspect {context} from the retriever, it suggests to create a function and pipe it in as a RunnableLambda. I actualy like the old syntax better, because at least I could logically inspect the inputs and outputs. Now everything is hidden even more! Wish me luck...
@samwitteveenai
@samwitteveenai 6 ай бұрын
I have been playing with this a lot more myself, so I probably will make some more explainers. Hopefully that will be useful.
@Jonathan-rm6kt
@Jonathan-rm6kt 6 ай бұрын
@@samwitteveenai That would be amazing. If you want, I can share the research/questions I've done so far, maybe that can help you structure the video to answer questions for beginner/ intermediate level people like me. Thanks again for publishing all your great work.
@AngusLou
@AngusLou 10 ай бұрын
I just think Langchain is getting more complicated.
@alx8439
@alx8439 10 ай бұрын
I think the value of LangChain is overrated. To me it's nothing more than just a wrapper around your own prompts to any LLM. There's nothing in there you cannot do yourself with few lines of python code
@jimjones26
@jimjones26 10 ай бұрын
Go ahead and show us how it's done!
@knoopx
@knoopx 10 ай бұрын
@@jimjones26 from transformers import pipeline generator = pipeline('text-generation', model='gpt2') results = generator("langchain is", max_length=10) print(results[0]["generated_text"])
@NoidoDev
@NoidoDev 9 ай бұрын
It's a step towards agents which seek the knowledge they'll need and responses on their own.
@adityagaurav2816
@adityagaurav2816 10 ай бұрын
I think they Made it more shitty with this update ...
@samwitteveenai
@samwitteveenai 10 ай бұрын
curious why? you don't like the declarative way? I don't think it is perfect, but I do think it is a step forward in making it easier for new people etc.
Building a RCI Chain for Agents with LangChain Expression Language
17:51
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 4,4 МЛН
LangGraph Crash Course with code examples
39:01
Sam Witteveen
Рет қаралды 61 М.
LangServe and LangChain Templates Webinar
40:41
LangChain
Рет қаралды 5 М.
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 114 М.
LangGraph 101: it's better than LangChain
32:26
James Briggs
Рет қаралды 49 М.
LangChain Crash Course for Beginners
1:05:30
freeCodeCamp.org
Рет қаралды 147 М.
Comparing LLMs with LangChain
17:43
Sam Witteveen
Рет қаралды 16 М.
Introduction to LangGraph: A Quick Dive into Core Concepts
21:54
Coding Crashcourses
Рет қаралды 4,7 М.
LangChain Expression Language (LCEL) Explained!
25:38
James Briggs
Рет қаралды 15 М.
LangChain Basics Tutorial #2 Tools and Chains
17:42
Sam Witteveen
Рет қаралды 35 М.
Bluetooth Desert Eagle
0:27
ts blur
Рет қаралды 8 МЛН
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 485 М.