mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
wip
This commit is contained in:
parent
e24d03060d
commit
582143d563
5 changed files with 193 additions and 2 deletions
|
@ -55,7 +55,12 @@ class Coder:
|
|||
openai_api_base="https://api.openai.com/v1",
|
||||
**kwargs,
|
||||
):
|
||||
from . import EditBlockCoder, WholeFileCoder, WholeFileFunctionCoder
|
||||
from . import (
|
||||
EditBlockCoder,
|
||||
EditBlockFunctionCoder,
|
||||
WholeFileCoder,
|
||||
WholeFileFunctionCoder,
|
||||
)
|
||||
|
||||
openai.api_key = openai_api_key
|
||||
openai.api_base = openai_api_base
|
||||
|
@ -81,6 +86,8 @@ class Coder:
|
|||
return WholeFileCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "whole-func":
|
||||
return WholeFileFunctionCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "diff-func":
|
||||
return EditBlockFunctionCoder(main_model, io, **kwargs)
|
||||
else:
|
||||
raise ValueError(f"Unknown edit format {edit_format}")
|
||||
|
||||
|
@ -559,6 +566,8 @@ class Coder:
|
|||
if functions is not None:
|
||||
kwargs["functions"] = self.functions
|
||||
|
||||
dump(kwargs)
|
||||
|
||||
# Generate SHA1 hash of kwargs and append it to chat_completion_call_hashes
|
||||
hash_object = hashlib.sha1(json.dumps(kwargs, sort_keys=True).encode())
|
||||
self.chat_completion_call_hashes.append(hash_object.hexdigest())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue