If you have a deterministic sequence (e.g. RAG first, then use the results and call a function), then you can create a chain: python.langchain.com/docs/modules/chains/ If you need the AI to reason about which action to take next (e.g. RAG or function calling) then use an Agent, and add "RAG" and "function calling" as tools: python.langchain.com/docs/modules/agents/tools/
Why would langchain just reinvent .() chaining? Abusing the python syntax like this. Just return and take in self to enable it using classes, or use a functional pattern. I’m disgusted, lol.
I guess you're referring to the LCEL for chaining the expressions? I don't like how it works either. It uses fewer lines/words, but it really does feel a lot less intuitive to parse than just standard function chaining.
Your explanation are simple and precise, it's great that that explaining what exactly this code is doing instead of writing the code line by line .
Thank you! Glad you enjoyed it :)
Awesome explanation, thank you very much.
Thanks! I hope it was helpful.
LLM : libmagic library gave me the most pain when i was on a project.
Its like everything was failing and falling apart.
How do RAG and function calling combine?
If you have a deterministic sequence (e.g. RAG first, then use the results and call a function), then you can create a chain: python.langchain.com/docs/modules/chains/
If you need the AI to reason about which action to take next (e.g. RAG or function calling) then use an Agent, and add "RAG" and "function calling" as tools: python.langchain.com/docs/modules/agents/tools/
Why would langchain just reinvent .() chaining? Abusing the python syntax like this. Just return and take in self to enable it using classes, or use a functional pattern.
I’m disgusted, lol.
I guess you're referring to the LCEL for chaining the expressions? I don't like how it works either. It uses fewer lines/words, but it really does feel a lot less intuitive to parse than just standard function chaining.