Find answers from the community

Updated 4 months ago

Hi all - when using the Chat Engine, is

At a glance

The community member asked if it is possible to configure a retriever (e.g. topk = X) and filters when using the Chat Engine, and if it is possible to print the source nodes for each chat question/response. Another community member responded that the similarity_top_k parameter can be passed as a kwarg to index.as_chat_engine(), and that the source nodes can be accessed using response.source_nodes. The community members also discussed how to use filters and the response_stream.print_response_stream() method to print the source nodes.

Hi all - when using the Chat Engine, is it possible to still configure a retriever e.g. topk = X? and, importantly, filters?

& is it possible also do print the source nodes for each chat question/ response?

I used to do this with query engine but now want to do the same with chat engine.

thank you!
W
t
5 comments
Yes just pass it as kwarg in index.as_chat_engine(similarity_top_k=5,....)

Also you get source_node IMO in response of every mode in chat_engine.

Just do print(response.source_nodes)
thanks @WhiteFang_Jr - & for filters? pass in as filters=filters?
& are you sure on print(response.source_nodes)

cos I am using: response_stream.print_response_stream()
needed to use response_stream
Add a reply
Sign up and join the conversation on Discord