mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
reverse history order to use latest history firts
Co-Authored-By: Pavel <32868631+pabik@users.noreply.github.com>
This commit is contained in:
@@ -176,6 +176,7 @@ def api_answer():
|
||||
tokens_current_history = 0
|
||||
tokens_max_history = 1000
|
||||
#count tokens in history
|
||||
history.reverse()
|
||||
for i in history:
|
||||
if "prompt" in i and "response" in i:
|
||||
tokens_batch = llm.get_num_tokens(i["prompt"]) + llm.get_num_tokens(i["response"])
|
||||
|
||||
Reference in New Issue
Block a user