From 2ed0c8fb66645337dd31145b3d4311994a95ba3d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Dec 2023 10:58:44 -0800 Subject: [PATCH] fixed test_repo --- aider/repo.py | 7 ------- aider/sendchat.py | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/aider/repo.py b/aider/repo.py index 224a5ab87..6943c5568 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -10,10 +10,6 @@ from aider.sendchat import simple_send_with_retries from .dump import dump # noqa: F401 -class OpenAIClientNotProvided(Exception): - pass - - class GitRepo: repo = None aider_ignore_file = None @@ -106,9 +102,6 @@ class GitRepo: return self.repo.git_dir def get_commit_message(self, diffs, context): - if not self.client: - raise OpenAIClientNotProvided - if len(diffs) >= 4 * 1024 * 4: self.io.tool_error("Diff is too large to generate a commit message.") return diff --git a/aider/sendchat.py b/aider/sendchat.py index 9419de7b9..65b0a46cb 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -29,6 +29,9 @@ CACHE = None ), ) def send_with_retries(client, model_name, messages, functions, stream): + if not client: + raise ValueError("No openai client provided") + kwargs = dict( model=model_name, messages=messages,