-
Notifications
You must be signed in to change notification settings - Fork 44k
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
Implemented remaining git operations #3815
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
as mentioned in some other issues, coding this up with the hard-coded assumption of using github credentials may have worked initially - but it's obvious that more and more folks are using this with repos beyond just those hosted on github. For the time being, the agent will typically invoke the CLI for me, because the command interface is too limited. |
Added to discussion #3856 |
@@ -33,3 +33,134 @@ def clone_repository(url: str, clone_path: str) -> str: | |||
return f"""Cloned {url} to {clone_path}""" | |||
except Exception as e: | |||
return f"Error: {str(e)}" | |||
|
|||
@command( | |||
"add", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the commands to something that relates to git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
making sure the "git" keyword is in the explanation that feeds into the main Prompt, will also prevent hallucination or non-use, because it doesn't know what "git" is either. What is it ? It's the git cmd executable.
GPT still needs a bit of guidance context on commands that it has access to, even if it's slightly complex, just to make sure
do you have a solution that combines this with scraping, so that we can finalise this with ability to open up a Pull Request ? I have this in my fork but I use my own scraping methods to get buttons after push cmd. Can't complain, it works lol
Please consider updating this PR according to the feedback so that it can be considered for the upcoming release. |
@@ -33,3 +33,134 @@ def clone_repository(url: str, clone_path: str) -> str: | |||
return f"""Cloned {url} to {clone_path}""" | |||
except Exception as e: | |||
return f"Error: {str(e)}" | |||
|
|||
@command( | |||
"add", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What @ntindle said:
rename the commands to something that relates to git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also applies to the rest of the commands
CFG.github_username and CFG.github_api_key, | ||
"Configure github_username and github_api_key.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These config variables are not needed for this command to function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also applies to the rest of the commands
@command( | ||
"pull", | ||
"Pull changes from a remote repository", | ||
'"repo_path": "<repo_path>", "remote_name": "<remote_name>", "branch_name": "<branch_name>"', | ||
CFG.github_username and CFG.github_api_key, | ||
"Configure github_username and github_api_key.", | ||
) | ||
@command( | ||
"pull", | ||
"Pull changes from a remote repository", | ||
'"repo_path": "<repo_path>", "remote_name": "<remote_name>", "branch_name": "<branch_name>"', | ||
CFG.github_username and CFG.github_api_key, | ||
"Configure github_username and github_api_key.", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate?
Closing this for lack of activity. Please let us know if you still want to get this in. :) |
Background
Currently, the remaining git commands are not implemented in git_operations.py, due to which, Auto-GPT tries to write a Python script to run those commands. This is less efficient and could be optimized in a straightforward way by implementing and hardcoding the remaining git commands - this would eventually help in solving #15 . These functions are generated by chatGPT itself.
Changes
Added the following git operations:
add, commit, push, pull, init
Documentation
NA
Test Plan
Not tested
PR Quality Checklist