truera/trulens

Custom LangChain Retriever is not logged

Closed this issue · 9 comments

In my Chain,I find that only LangChain Retriever can be logged,Custom Retriever is not logged.

LangChain Retriever

image

Custom Retriever

class ContextExpandRetriver(BaseRetriever):
    def _get_relevant_documents(
        self,
        query: str,
        *,
        run_manager: CallbackManagerForRetrieverRun,
        **kwargs: Any,
    ) -> List[Document]:
        source_documents = []
        # do something to ContextExpandRetriver
        return source_documents

image

Just replace retriever in Example blow will reproduce the problem!
https://www.trulens.org/trulens_eval/langchain_quickstart/#load-documents

Because of the bug,the lens App.select_context returns , is not log to the db, and thus can not be dealed by the Feedback
image

Hey @q2wxec ! Thanks for creating the issue.

I’m not quite following the issue here. Is it that the expected component is not showing in the timeline (not being logged at all), or is it just not being selected by select_context

@q2wxec this may be fixed by #873 - can you install from that branch and give it a try?

@q2wxec this may be fixed by #873 - can you install from that branch and give it a try?

ok,i will take a shoot and reply

@q2wxec this may be fixed by #873 - can you install from that branch and give it a try?

I think this problem has been solved.However some problem occour while open the dashbord.

This problem solved by looking into the json

1707534707713

dashbord problem

image

Awesome news. Re: the dashboard error, this is fixed in main (and 0.22.1) but wasn’t in this branch yet. Just pulled it in to the branch

Awesome news. Re: the dashboard error, this is fixed in main (and 0.22.1) but wasn’t in this branch yet. Just pulled it in to the branch

thx for your effort

You’re welcome! Assuming it’s working now?

You’re welcome! Assuming it’s working now?

yes

Will close this once it's merged