Find answers from the community

Updated 2 months ago

Include sources in the response

Include sources in the response
k
2 comments
Please stand by @cK5150 as I search the knowledge base. We are experiencing especially high traffic right now and might take longer than usual. :wave:
----------------------
To include sources in the response when using GPT index, you can use the get_formatted_sources() method. Here's an example from the Simple Index Demo (https://github.com/jerryjliu/gpt_index/tree/main/examples/vector_indices/SimpleIndexDemo.ipynb):

Plain Text
print(response.get_formatted_sources())


This method will print the sources associated with the response in a formatted manner.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord