mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
allow longer conversation histories for models with larger context windows
This commit is contained in:
parent
4192e78bcd
commit
ec95cd2d76
3 changed files with 12 additions and 1 deletions
|
@ -189,7 +189,11 @@ class Coder:
|
|||
for fname in self.get_inchat_relative_files():
|
||||
self.io.tool_output(f"Added {fname} to the chat.")
|
||||
|
||||
self.summarizer = ChatSummary(models.Model.weak_model())
|
||||
self.summarizer = ChatSummary(
|
||||
models.Model.weak_model(),
|
||||
self.main_model.max_chat_history_tokens,
|
||||
)
|
||||
|
||||
self.summarizer_thread = None
|
||||
self.summarized_done_messages = []
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ class Model:
|
|||
edit_format = None
|
||||
max_context_tokens = 0
|
||||
tokenizer = None
|
||||
max_chat_history_tokens = 1024
|
||||
|
||||
always_available = False
|
||||
use_repo_map = False
|
||||
|
|
|
@ -40,12 +40,15 @@ class OpenAIModel(Model):
|
|||
if tokens == 8:
|
||||
self.prompt_price = 0.03
|
||||
self.completion_price = 0.06
|
||||
self.max_chat_history_tokens = 1024
|
||||
elif tokens == 32:
|
||||
self.prompt_price = 0.06
|
||||
self.completion_price = 0.12
|
||||
self.max_chat_history_tokens = 3 * 1024
|
||||
elif tokens == 128:
|
||||
self.prompt_price = 0.01
|
||||
self.completion_price = 0.03
|
||||
self.max_chat_history_tokens = 4 * 1024
|
||||
|
||||
return
|
||||
|
||||
|
@ -56,12 +59,15 @@ class OpenAIModel(Model):
|
|||
if self.name == "gpt-3.5-turbo-1106":
|
||||
self.prompt_price = 0.001
|
||||
self.completion_price = 0.002
|
||||
self.max_chat_history_tokens = 3 * 1024
|
||||
elif tokens == 4:
|
||||
self.prompt_price = 0.0015
|
||||
self.completion_price = 0.002
|
||||
self.max_chat_history_tokens = 1024
|
||||
elif tokens == 16:
|
||||
self.prompt_price = 0.003
|
||||
self.completion_price = 0.004
|
||||
self.max_chat_history_tokens = 2 * 1024
|
||||
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue