mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-02-08 23:30:42 +00:00
fix: count history tokens from chunks, remove old UI setting limit (#2196)
This commit is contained in:
@@ -77,11 +77,11 @@ def count_tokens_docs(docs):
|
||||
|
||||
|
||||
def calculate_doc_token_budget(
|
||||
model_id: str = "gpt-4o", history_token_limit: int = 2000
|
||||
model_id: str = "gpt-4o"
|
||||
) -> int:
|
||||
total_context = get_token_limit(model_id)
|
||||
reserved = sum(settings.RESERVED_TOKENS.values())
|
||||
doc_budget = total_context - history_token_limit - reserved
|
||||
doc_budget = total_context - reserved
|
||||
return max(doc_budget, 1000)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user