mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
fixed test_repo
This commit is contained in:
parent
a68d3d8a20
commit
2ed0c8fb66
2 changed files with 3 additions and 7 deletions
|
@ -10,10 +10,6 @@ from aider.sendchat import simple_send_with_retries
|
||||||
from .dump import dump # noqa: F401
|
from .dump import dump # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
class OpenAIClientNotProvided(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class GitRepo:
|
class GitRepo:
|
||||||
repo = None
|
repo = None
|
||||||
aider_ignore_file = None
|
aider_ignore_file = None
|
||||||
|
@ -106,9 +102,6 @@ class GitRepo:
|
||||||
return self.repo.git_dir
|
return self.repo.git_dir
|
||||||
|
|
||||||
def get_commit_message(self, diffs, context):
|
def get_commit_message(self, diffs, context):
|
||||||
if not self.client:
|
|
||||||
raise OpenAIClientNotProvided
|
|
||||||
|
|
||||||
if len(diffs) >= 4 * 1024 * 4:
|
if len(diffs) >= 4 * 1024 * 4:
|
||||||
self.io.tool_error("Diff is too large to generate a commit message.")
|
self.io.tool_error("Diff is too large to generate a commit message.")
|
||||||
return
|
return
|
||||||
|
|
|
@ -29,6 +29,9 @@ CACHE = None
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def send_with_retries(client, model_name, messages, functions, stream):
|
def send_with_retries(client, model_name, messages, functions, stream):
|
||||||
|
if not client:
|
||||||
|
raise ValueError("No openai client provided")
|
||||||
|
|
||||||
kwargs = dict(
|
kwargs = dict(
|
||||||
model=model_name,
|
model=model_name,
|
||||||
messages=messages,
|
messages=messages,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue