How to print the sources of vector search just like langchain? #212
Answered
by
SeeknnDestroy
abrahimzaman360
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
SeeknnDestroy
Jan 15, 2024
Replies: 3 comments
-
How to print the sources of vector search just like langchain? |
Beta Was this translation helpful? Give feedback.
0 replies
-
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.
0 replies
Answer selected by
fcakyon
-
Thanks 👍🏼 for helping out |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.