Rename Langchain.rb to LangChain.rb#1027
Conversation
e6c1f0b to
3f3d45e
Compare
In the LLM field, the name LangChain is widely recognized, and the project was likely originally intended to be called LangChain.rb as a product: patterns-ai-core@ab9d988 It appears that the current use of the name `Langchain` is due to implementation constraints. This PR updates the behavior so that Zeitwerk also recognizes the `LangChain` module name for the `langchain.rb` file. Both the existing `Langchain` and the new `LangChain` module names will work. However, the `Langchain` constant is now marked as deprecated, and a warning will be shown when it is used: ```console $ bundle exec ruby -Ilib -rrails -rlangchainrb -e 'Langchain::Errors' -e:1: warning: `LangChain` is deprecated. Use `LangChain` instead. ``` This change makes it possible to use the name `LangChain`, which is the standard name in the AI ecosystem. Because `LangChain` is a proper noun, renaming to this widely recognized and commonly used name follows the principle of least surprise for users.
3f3d45e to
2c7b881
Compare
|
Out of curiosity, what's the relationship between this gem/repo and the original langchain project? Because that project is now driven by a for-profit startup, and this seems more like a true open-source project that isn't bound to a specified company. But also, if this is independent, maybe there is also some risk of confusion? Even more unrelated, is there any discussion of collaboration between this project and RubyLLM? One thing that seems like a good candidate for collaboration between these two projects are the model-provider wrappers and/or model registry. So basically providing a unified API that hides the small differences between different providers. Maybe there are other 'building block' parts too, that would make sense to share? Of course each project would still be independent and have different ideas about public APIs, gem design and purpose/aim of each project. cc @crmne |
That's a good question. I had come to this project assuming it was the (missing) Ruby extension for LangChain and associated products like LangSmith. |
In the LLM field, the name LangChain is widely recognized, and the project was likely originally intended to be called LangChain.rb as a product: ab9d988
It appears that the current use of the name
Langchainis due to implementation constraints. This PR updates the behavior so that Zeitwerk also recognizes theLangChainmodule name for thelangchain.rbfile.Both the existing
Langchainand the newLangChainmodule names will work. However, theLangchainconstant is now marked as deprecated, and a warning will be shown when it is used:This change makes it possible to use the name
LangChain, which is the standard name in the AI ecosystem. BecauseLangChainis a proper noun, renaming to this widely recognized and commonly used name follows the principle of least surprise for users.