-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #578 from linear-b/Ask-AI-plugin-integrations
Add AI usage examples
- Loading branch information
Showing
8 changed files
with
169 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,13 @@ | ||
--- | ||
title: Integrate gitStream with AI | ||
description: Use gitStream to integrate with AI services for Review, describe and add tests. | ||
--- | ||
# Integrate gitStream with AI | ||
|
||
--8<-- "docs/automations/integrations/AI/askAI/README.md:examples" | ||
|
||
## Additional Resources | ||
|
||
--8<-- "docs/snippets/general.md" | ||
|
||
--8<-- "docs/snippets/automation-footer.md" |
This file contains 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,88 @@ | ||
--- | ||
title: Integrate gitStream with AI | ||
description: Use gitStream to integrate with AI services for Review, describe and add tests. | ||
category: [quality, genai, copilot, tests, efficiency] | ||
--- | ||
# Integrate gitStream with AI | ||
|
||
<!-- --8<-- [start:examples]--> | ||
## Use askAI plugin to interact with AI chatbots | ||
|
||
!!! warning "Required gitStream Plugins" | ||
This example requires you to install the [`askAI`](/filter-function-plugins/#askai) plugin. | ||
|
||
[Learn more about gitStream plugins](/plugins/). | ||
|
||
|
||
=== "Code Review" | ||
!!! info "Configuration Description" | ||
|
||
Conditions (all must be true): | ||
|
||
* A PR is created or new code has been committed to the PR. | ||
* The PR has a label "AskAI CR" | ||
|
||
Automation Actions: | ||
|
||
* Add a comment with the code review generated by an AI model | ||
|
||
!!! example "Configuration Example" | ||
```yaml+jinja | ||
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_CR.cm" | ||
``` | ||
<div class="result" markdown> | ||
<span> | ||
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-CR.cm){ .md-button } | ||
</span> | ||
</div> | ||
=== "Describe PR" | ||
!!! info "Configuration Description" | ||
|
||
Conditions (all must be true): | ||
|
||
* A PR is created or new code has been committed to the PR. | ||
* The PR has a label "AskAI Describe" | ||
|
||
Automation Actions: | ||
|
||
* Add a comment with the code review generated by an AI model | ||
|
||
!!! example "Configuration Example" | ||
```yaml+jinja | ||
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_describe.cm" | ||
``` | ||
<div class="result" markdown> | ||
<span> | ||
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-Describe.cm){ .md-button } | ||
</span> | ||
</div> | ||
=== "QA tests" | ||
!!! info "Configuration Description" | ||
|
||
Conditions (all must be true): | ||
|
||
* A PR is created or new code has been committed to the PR. | ||
* The PR has a label "AskAI QA" | ||
|
||
Automation Actions: | ||
|
||
* Add a comment with the code review generated by an AI model | ||
|
||
!!! example "Configuration Example" | ||
```yaml+jinja | ||
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_QA.cm" | ||
``` | ||
<div class="result" markdown> | ||
<span> | ||
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-QA.cm){ .md-button } | ||
</span> | ||
</div> | ||
|
||
|
||
|
||
<!-- --8<-- [end:examples]--> | ||
## Additional Resources | ||
|
||
--8<-- "docs/snippets/general.md" | ||
|
||
--8<-- "docs/snippets/automation-footer.md" |
18 changes: 18 additions & 0 deletions
18
docs/downloads/automation-library/integrations/askAI/askAI_CR.cm
This file contains 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,18 @@ | ||
manifest: | ||
version: 1.0 | ||
|
||
triggers: | ||
on: | ||
- commit | ||
- pr_created | ||
|
||
automations: | ||
ask_ai_describe: | ||
if: | ||
- {{ pr.labels | match(term="askai cr") | some }} | ||
run: | ||
- action: add-comment@v1 | ||
args: | ||
comment: | | ||
# ✨ gitStream Review ✨ | ||
{{ source | askAI("Based on the given context, can you write a few bullet points about how I can improve my code? Please relate only to code diff, if it exists.", env.OPEN_AI_TOKEN) | encode }} |
18 changes: 18 additions & 0 deletions
18
docs/downloads/automation-library/integrations/askAI/askAI_QA.cm
This file contains 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,18 @@ | ||
manifest: | ||
version: 1.0 | ||
|
||
triggers: | ||
on: | ||
- commit | ||
- pr_created | ||
|
||
automations: | ||
ask_ai_describe: | ||
if: | ||
- {{ pr.labels | match(term="askai qa") | some }} | ||
run: | ||
- action: add-comment@v1 | ||
args: | ||
comment: | | ||
# ✨ gitStream QA ✨ | ||
{{ source | askAI("Based on the given context, search for new functions without tests and suggest the tests to add. If all functions are covered completely, return 'no tests to suggest.'", env.OPEN_AI_TOKEN) | encode }} |
18 changes: 18 additions & 0 deletions
18
docs/downloads/automation-library/integrations/askAI/askAI_describe.cm
This file contains 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,18 @@ | ||
manifest: | ||
version: 1.0 | ||
|
||
triggers: | ||
on: | ||
- commit | ||
- pr_created | ||
|
||
automations: | ||
ask_ai_describe: | ||
if: | ||
- {{ pr.labels | match(term="askai describe") | some }} | ||
run: | ||
- action: add-comment@v1 | ||
args: | ||
comment: | | ||
# ✨ gitStream Describe PR ✨ | ||
{{ source | askAI("based on the given context, describe in plain english the changes introduced in this PR.", env.OPEN_AI_TOKEN) | encode }} |
This file contains 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
This file contains 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