Skip to content

Commit

Permalink
Merge pull request #355 from gitautoai/wes
Browse files Browse the repository at this point in the history
Rename explore_repo_or_commit_changes() to chat_with_agent()
  • Loading branch information
hiroshinishio authored Oct 27, 2024
2 parents a1f1aaa + 690049c commit 29cf17e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions services/check_run_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions services/gitauto_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion services/openai/commit_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 29cf17e

Please sign in to comment.