bug: `query` knows and uses `history` from `chat`
🐛 Describe the bug
If you use the chat method, the history is stored persistently in the Llm app-subclass. If query is used in the same script after chat, it also uses that history, because it assumes that you set this as custom history, which is supported behavior.
I'm really not sure how to fix this, other than splitting history in to history and custom_history.
If we just said that we only want to support history that's added directly as an argument to the query method, we'd probably have to:
- serialize it
- save the serial
- delete the history
- replace it with the history from arguments
- restore the saved serial after the method run
This adds complexity and makes it slower. We also couldn't use the app.llm.set_history method anymore, this method is really good for managing custom history. So splitting into history and custom_history seems like the better option.
Open for suggestions.
I think the offered option makes a lot of sense. However, history (without any adjectives) is a bit ambiguous since contrast has to be made with custom_history to understand what's going on. I'd go for chat_history and query_history instead, which clearly shows the intent of which method it is supposed to be used with.