Find answers from the community

Updated 6 months ago

Outpht

At a glance

A community member is looking for a convenient way to override the output formatting of the llama_index library, specifically the formatting of the "Prompt" and "Completion" sections. The comments suggest that there is no convenient way to do this at the moment, but it would be easy to add. Some community members mention that the only way to do it currently is by editing the source code of the installed package. One community member notes that they had originally designed the formatting feature for visual purposes only. Another community member finds a solution by using llama_index.set_global_handler("simple"), which allows them to print the response without the additional formatting.

Useful resources
is there a convenient way to override the output formatting?
https://github.com/run-llama/llama_index/blob/v0.8.38/llama_index/callbacks/simple_llm_handler.py
Since I'm going to be post-processing stuff in python and then doing later things, I'd like to change the ** Prompt ** and ** Completion ** stuff
L
t
12 comments
Not at the moment. Would be easy enough to add though
is there an inconvenient way to do it? πŸ˜›
Haha only by editing source code in the installed package
cuz right now I have to like split on the ** Completion ** string
not the end of the world
I made that feature with the impression that it was for visual purposes only πŸ˜…
well maybe i'm thinking about this wrong
the problem was llama_index.set_global_handler("simple")
print(response) does as expected (only the response)
Add a reply
Sign up and join the conversation on Discord