Find answers from the community

Updated 2 months ago

Seeing source nodes

oh I get the ... When I use response.source_nodes I can see the whole text but not with .get_formatted_sources
So baesd on what you said, if I want the whole thing don't use get_formatted_sources? what if I don't wnat it truncated? Is there an option to get the whole source using .get_formatted_sources? or do i always need to use .source_nodes?
L
B
4 comments
Yea you should be able to set the length in get_formatted_sources, but it sounds like that wasn't working for you?

response.get_formatted_sources(length=10000)

I'm kind of surprised that doesn't work for you, I just looked at the source code πŸ˜…

If that doesn't work, then ya you can parse the text using source_nodes instead
ok yeah im going to try again but it didnt work last time. I believe there should be an option that says auto, which allows for it to recognize the legnth of the source and will output exactly based on the number of chars needed. No need to set length.
Let me know if that's helpful, I can try to add it to github and write the code for it @Logan M
Yea you can definitely make a PR. The source code for this is around here

https://github.com/jerryjliu/llama_index/blob/main/gpt_index/response/schema.py#L29
Add a reply
Sign up and join the conversation on Discord