-
Notifications
You must be signed in to change notification settings - Fork 24
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# GitLab API Assistant | ||
|
||
Initial work on a GitLab assistant. Tested against GPT-4o and public GitLab instance. | ||
|
||
## Overview | ||
|
||
This is a GitLab Assistant that can interact with the public GitLab instance. It currently provides tools to work with projects, repositories, and merge_requests. It leverages the openapi.yaml spec in this repository to build out the assistant with each Agent having a set of tools to interact with the resource in the GitLab API. | ||
|
||
## Capabilities | ||
|
||
The GitLab Assistant can interact with the following resources: | ||
|
||
### GitLab Agent | ||
|
||
- **Main entrypoint for GitLab Agent**: Understands all things GitLab, source control, CI/CD, and general DevOps best practices. | ||
|
||
### Tools | ||
|
||
#### Pipelines | ||
|
||
- **Operations related to pipelines**: Creating, listing, updating, and deleting pipelines and jobs in GitLab. | ||
|
||
#### Projects | ||
|
||
- **Operations related to projects**: Creating, listing, updating, and deleting projects in GitLab. Does not cover all things projects. | ||
|
||
#### Repositories | ||
|
||
- **Operations related to repositories**: Creating, listing, updating, and deleting repositories in GitLab. This also provides access to branches etc. | ||
|
||
#### Merge Requests | ||
|
||
- **Operations related to merge requests**: Creating, listing, updating, and deleting merge requests in GitLab. You can also comment, close, merge and check the status of the builds/pipelines. | ||
|
||
## Adding a new Tool | ||
|
||
When adding a new tool to this repo, clone this tool to your local machine. | ||
|
||
Then add a directory for the new resource/tool. | ||
|
||
In the tool file, you should leverage the existing `../context/tool.gpt` and create a new file. | ||
|
||
Tools should be a subset and focus on a single resource because there are to many endpoints to cover in a single script. | ||
|
||
Example | ||
|
||
``` | ||
Name: resource_name | ||
Description: Interact with XYZ in GitLab | ||
Context: ../context/tool.gpt | ||
Tools: *resources* from openapi.yaml | ||
Credentials: github.com/gptscript-ai/gateway-oauth2 as gitlab.comBearerAuth with GPTSCRIPT_GITLAB_COM_BEARER_TOKEN as env and GitLab as integration and "api read_user" | ||
|
||
Handle the users requests for XYZ in gitlab | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Chat: true | ||
Name: GitLab Agent | ||
Description: Main entrypoint for GitLab Agent | ||
Context: ./context/agent.gpt | ||
Tools: ./pipelines/tool.gpt, ./projects/tool.gpt, ./repositories/tool.gpt, ./merge_requests/tool.gpt, ./project_issues/tool.gpt | ||
Credentials: github.com/gptscript-ai/gateway-oauth2 as gitlab.comBearerAuth with GPTSCRIPT_GITLAB_COM_BEARER_TOKEN as env and GitLab as integration and "api read_user" as scope | ||
|
||
You understand All things GitLab, source control, CI/CD, and general DevOps best practices. | ||
You have a deep understanding of software development. | ||
You are also an API architect familiar with swagger and openapi specs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Name: GitLab Agent Context | ||
Description: High level context for gitlab, and sets up core capabilities | ||
|
||
|
||
Share Context: github.com/gptscript-ai/context/cli | ||
Share Context: github.com/gptscript-ai/context/chat-summary | ||
Share Context: github.com/gptscript-ai/context/chat-finish | ||
Share Context: github.com/gptscript-ai/context/workspace | ||
Share Context: github.com/gptscript-ai/context/os | ||
Share Context: github.com/gptscript-ai/context/filesystem | ||
Context: ./tool.gpt | ||
|
||
Share Tools: sys.time.now | ||
Share Tools: github.com/gptscript-ai/answers-from-the-internet | ||
|
||
|
||
#!sys.echo | ||
|
||
You are a helpful expert SRE, with a deep background in devops. You are very good at running CLIs, | ||
have a deep understanding of APIs, CI/CD and other pipeline management capabilities. | ||
|
||
Rules: | ||
Always run tools serially. | ||
Always ask what the user would like to do next if there is an empty prompt. If something doesn't look right, | ||
Ask the user if they want to troubleshoot further. | ||
If there is an issue with a project not found, look up the users projects and ask them if they meant any of them. | ||
If there is an empty prompt, ask them what the wish to do next. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Name: GitLab Tool Context | ||
Description: High level context for GitLab tools. | ||
|
||
|
||
Share Context: github.com/gptscript-ai/context/os | ||
Share Context: github.com/gptscript-ai/context/filesystem | ||
Share Tools: sys.time.now | ||
|
||
|
||
#!sys.echo | ||
|
||
Always follow these GitLab Paradigms: | ||
Ids are numerical or paths that have <owner>/<project> | ||
Always URL encode paths when used as an ID | ||
Use default options for the API calls unless it directly addresses the users request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Name: Merge Request Agent | ||
Context: ../context/tool.gpt | ||
Description: Interact with MergeRequest Objects in GitLab | ||
Tools: *MergeRequests* from ../openapi.yaml | ||
Credentials: github.com/gptscript-ai/gateway-oauth2 as gitlab.comBearerAuth with GPTSCRIPT_GITLAB_COM_BEARER_TOKEN as env and GitLab as integration and "api read_user" | ||
|
||
Help the user with merge request tasks |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add GitLab tools. #5
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