Find answers from the community

Updated last year

When use the index as query engine query

When use the index.as_query_engine.query("questions"), How do I trace the node that made llm to make the response? I would like it not only answer the question by also give its source.
W
1 comment
Plain Text
response = index.as_query_engine.query("questions")
response.get_formatted_sources()


Will give you the source text that have been used to generate the response using LLM. You can pass legth parameter in get_formatted_sources else it takes default 100 characters length.
Add a reply
Sign up and join the conversation on Discord