How to print the sources of vector search just like langchain? #212
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
How to print the sources of vector search just like langchain? |
Beta Was this translation helpful? Give feedback.
-
Hi @abrahimzaman360, After you get your response from the query engine: response = query_engine.query(question) you can get the source nodes via print(response.get_formatted_sources(length=42000)) will probably return all the source text you have got. |
Beta Was this translation helpful? Give feedback.
-
Thanks 👍🏼 for helping out |
Beta Was this translation helpful? Give feedback.
Hi @abrahimzaman360,
After you get your response from the query engine:
you can get the source nodes via
response.get_formatted_sources
method.will probably return all the source text you have got.
length
parameter is for adjusting the size of the returned source context.