From 690049ceece8c8199b54546321bac1a856610027 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio Date: Sun, 27 Oct 2024 15:41:06 -0700 Subject: [PATCH] Rename explore_repo_or_commit_changes() to chat_with_agent() --- services/check_run_handler.py | 6 +++--- services/gitauto_handler.py | 6 +++--- services/openai/commit_changes.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/check_run_handler.py b/services/check_run_handler.py index 1b20399b..490e7f9c 100644 --- a/services/check_run_handler.py +++ b/services/check_run_handler.py @@ -24,7 +24,7 @@ Repository, ) from services.github.pulls_manager import get_pull_request, get_pull_request_files -from services.openai.commit_changes import explore_repo_or_commit_changes +from services.openai.commit_changes import chat_with_agent from services.openai.chat import chat_with_ai from services.openai.instructions.identify_cause import IDENTIFY_CAUSE from services.stripe.subscriptions import get_stripe_product_id @@ -182,7 +182,7 @@ def handle_check_run(payload: CheckRunCompletedPayload) -> None: while True: # Explore repo messages, previous_calls, _token_input, _token_output, is_explored = ( - explore_repo_or_commit_changes( + chat_with_agent( messages=messages, base_args=base_args, mode="get", # explore can not be used here because "search_remote_file_contents" can search files only in the default branch NOT in the branch that is merged into the default branch @@ -192,7 +192,7 @@ def handle_check_run(payload: CheckRunCompletedPayload) -> None: # Commit changes based on the exploration information messages, previous_calls, _token_input, _token_output, is_committed = ( - explore_repo_or_commit_changes( + chat_with_agent( messages=messages, base_args=base_args, mode="commit", diff --git a/services/gitauto_handler.py b/services/gitauto_handler.py index 4a511229..f0150a2b 100644 --- a/services/gitauto_handler.py +++ b/services/gitauto_handler.py @@ -34,7 +34,7 @@ IssueInfo, RepositoryInfo, ) -from services.openai.commit_changes import explore_repo_or_commit_changes +from services.openai.commit_changes import chat_with_agent from services.openai.instructions.write_pr_body import WRITE_PR_BODY from services.openai.truncate import truncate_message from services.openai.chat import chat_with_ai @@ -191,7 +191,7 @@ async def handle_gitauto(payload: GitHubLabeledPayload, trigger_type: str) -> No while True: # Explore repo messages, previous_calls, token_input, token_output, is_explored = ( - explore_repo_or_commit_changes( + chat_with_agent( messages=messages, base_args=base_args, mode="explore", @@ -201,7 +201,7 @@ async def handle_gitauto(payload: GitHubLabeledPayload, trigger_type: str) -> No # Commit changes based on the exploration information messages, previous_calls, token_input, token_output, is_committed = ( - explore_repo_or_commit_changes( + chat_with_agent( messages=messages, base_args=base_args, mode="commit", diff --git a/services/openai/commit_changes.py b/services/openai/commit_changes.py index f47aecfc..de2041fe 100644 --- a/services/openai/commit_changes.py +++ b/services/openai/commit_changes.py @@ -31,7 +31,7 @@ @handle_exceptions(raise_on_error=True) -def explore_repo_or_commit_changes( +def chat_with_agent( messages: Iterable[ChatCompletionMessageParam], base_args: BaseArgs, mode: Literal["commit", "explore", "get"],