mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 11:14:59 +00:00
refactor: Split summarize method and add model metadata handling
This commit is contained in:
parent
73bc0f6258
commit
dff544cd5d
6 changed files with 38 additions and 3 deletions
|
@ -5,6 +5,7 @@ import time
|
|||
from aider.dump import dump # noqa: F401
|
||||
from aider.exceptions import LiteLLMExceptions
|
||||
from aider.llm import litellm
|
||||
from aider.utils import format_messages
|
||||
|
||||
# from diskcache import Cache
|
||||
|
||||
|
@ -30,7 +31,9 @@ def sanity_check_messages(messages):
|
|||
continue
|
||||
|
||||
if last_role and role == last_role:
|
||||
return False
|
||||
print(format_messages(messages))
|
||||
# import sys ; sys.exit()
|
||||
raise ValueError("Messages don't properly alternate user/assistant")
|
||||
|
||||
last_role = role
|
||||
last_non_system_role = role
|
||||
|
@ -47,6 +50,8 @@ def send_completion(
|
|||
temperature=0,
|
||||
extra_params=None,
|
||||
):
|
||||
# sanity_check_messages(messages)
|
||||
|
||||
kwargs = dict(
|
||||
model=model_name,
|
||||
messages=messages,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue