talkdai / dialog

RAG LLM Ops App for easy deployment and testing
https://dialog.talkd.ai
MIT License
308 stars 38 forks source link

Improve LCEL support through new Absctract class #191

Open vmesel opened 1 month ago

vmesel commented 1 month ago

Our AbstractLLM class is very useful, but also very limited in the scope of the previous Langchain's API version, to continue improving, we need to start adding features to our default AbstractLLM class or creating a new one that provides us the structure for Abstract LCEL.

The first attempt wasn't very well thought out on my part, @lgabs suggested a new structure that would contemplate a comprehensive way of having LCEL objects in the class and allow us to still maintain retro compatibility.

class AbstractLCELClass(AbstractLLM):
    def init(self, *args, **kwargs):
        pass

    def process(self, *args, **kwargs):
        # calls chain through the invoke method from langchain
        pass

    @property
    def chain(self):
        # chain as a property, compiles all of it here

    @property
    def retriver(self):
        # retriever instance
        pass

    @property
    def memory(self):
        # memory instance
        pass

    def invoke(self, *args, **kwargs):
        # calls the class process method that calls the original invoke
        pass
lgabs commented 1 month ago

This is been discussed in this PR in dialog-lib