| 7 | |
| 8 | @register_agent(name = "Github Agent", func_name="get_github_agent") |
| 9 | def get_github_agent(model: str): |
| 10 | def instructions(context_variables): |
| 11 | return \ |
| 12 | f"""You are an agent that helps user to manage the GitHub repository named 'autoagent'. |
| 13 | The user will give you the suggestion of the changes to be pushed to the repository. |
| 14 | Follow the following routine with the user: |
| 15 | 1. First, use `push_changes` to push the changes to the repository. (If the user want to push all the changes, use `push_changes` with `file_paths=None` as the argument.) |
| 16 | 2. Then, ask the user whether to submit a pull request to a target branch. (If yes, give the `target_branch`) |
| 17 | 3. If the user wants to submit a pull request, use `submit_pull_request` to submit the pull request, if not, just ignore this step. |
| 18 | """ |
| 19 | return Agent( |
| 20 | name="Github Agent", |
| 21 | model=model, |
| 22 | instructions=instructions, |
| 23 | functions=[push_changes, submit_pull_request], |
| 24 | parallel_tool_calls = False |
| 25 | ) |