Find answers from the community

Updated 3 months ago

how to use "chat_engine" with "

how to use "chat_engine" with "NodeWithScore"?
i can place a list of NodeWithScore when calling "response_synthesizer.synthesize", but what about use with "chat engines"?.....any pointer would be greatly appreciated πŸ™πŸ˜
Plain Text
        from llama_index.core.schema import NodeWithScore
        from llama_index.core import get_response_synthesizer

        response_synthesizer = get_response_synthesizer(
            response_mode="tree_summarize")

        user_question = kwargs["query"]
        
        # get response based on nodes as context
        response = response_synthesizer.synthesize(
            f"{user_question}, use only text in context, context is a person's life description",
            nodes=kwargs["input_documents"]
        )

but how to use those same nodes kwargs["input_documents"] with an instance of "chat engine"...that's where i'm stuckπŸ€”?
L
v
4 comments
Chat engines only take strings as input
its meant to chat
ah go it, thanks
it turns out the solution was a custom Retriever, where i can specifiy scored nodes
Add a reply
Sign up and join the conversation on Discord