Skip to content

Improve LCEL support through new Absctract class #191

@vmesel

Description

@vmesel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions