Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename explore_repo_or_commit_changes() to chat_with_agent() #355

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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