-
Couldn't load subscription status.
- Fork 43
📝 docs: improve askAI plugin documentation #630
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
Open
azigler
wants to merge
14
commits into
linear-b:main
Choose a base branch
from
azigler:azigler-improve-askai-docs-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2ae58c1
📝 docs: improve askAI plugin documentation and FAQ clarity
azigler 8123b12
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB c1440a3
📝 docs: improve clarity of AI plugin documentation and fix example sy…
azigler baae64c
📝 docs: improve clarity and consistency in askAI documentation
azigler 0331f23
📝 docs: improve titles and descriptions in AI integration documentation
azigler 05bb5f8
Merge branch 'main' into azigler-improve-askai-docs-1
azigler 8343db2
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB cd859d0
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB 3c760c9
Merge branch 'main' into azigler-improve-askai-docs-1
azigler cb80d1f
Update docs/integrations/askAI.md
azigler 70d17b0
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB 30d4b04
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB d46280f
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB bb66f63
Merge branch 'main' into azigler-improve-askai-docs-1
PavelLinearB 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
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 |
|---|---|---|
| @@ -1,43 +1,39 @@ | ||
| --- | ||
| title: Integrate gitStream with AI | ||
| description: Use gitStream to integrate with AI services for Review, describe and add tests. | ||
| description: Use gitStream to integrate with AI for different use cases. | ||
| category: [quality, genai, copilot, tests, efficiency] | ||
| --- | ||
| # Integrate gitStream with AI | ||
|
|
||
| <!-- --8<-- [start:examples]--> | ||
| !!! warning "Required gitStream Plugins" | ||
| This example requires you to install the [`askAI`](/filter-function-plugins/#askai) plugin. | ||
| This example requires you to install the [`askAI`](/filter-function-plugins/#askai) plugin, which will provide context to the configured model provider and may incur API costs. | ||
azigler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [Learn more about gitStream plugins](/plugins/). | ||
|
|
||
| ## Ask AI to Summarize the Changes in a PR | ||
| ## Ask AI to summarize the changes in a PR | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/summarize-pr/README.md:example" | ||
|
|
||
| ## Ask AI to Suggest Tests | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/add-tests/README.md:example" | ||
|
|
||
| ## Ask AI for a Code Review | ||
| ## Ask AI to review the changes in a PR | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/code-review/README.md:example" | ||
|
|
||
| ## Ask AI for Documentation | ||
| ## Ask AI for improvements to the changes in a PR | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/document/README.md:example" | ||
| --8<-- "docs/automations/integrations/askAI/improve/README.md:example" | ||
|
|
||
| ## Ask AI for Code Improvements | ||
| ## Ask AI for documentation covering the changes in a PR | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/improve/README.md:example" | ||
| --8<-- "docs/automations/integrations/askAI/document/README.md:example" | ||
|
|
||
| <!-- ## Ask AI for anything | ||
| ## Ask AI for tests covering the changes in a PR | ||
|
|
||
| --8<-- "docs/automations/integrations/askAI/code-review/README.md:example" --> | ||
| --8<-- "docs/automations/integrations/askAI/add-tests/README.md:example" | ||
| <!-- --8<-- [end:examples]--> | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| --8<-- "docs/snippets/general.md" | ||
|
|
||
| --8<-- "docs/snippets/automation-footer.md" | ||
| --8<-- "docs/snippets/automation-footer.md" | ||
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
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 |
|---|---|---|
| @@ -1,26 +1,26 @@ | ||
| <a name="module_generateDescription"></a> | ||
|
|
||
| ## askAI | ||
| A gitStream plugin to interact with AI models. Currently works with `ChatGPR-4o-mini` | ||
|
|
||
|  | ||
| !!! warning "Data privacy" | ||
| The [`askAI`](/filter-function-plugins/#askai) plugin will provide context to the configured model provider and may incur API costs. | ||
|
|
||
| [Learn more about gitStream plugins](/plugins/). | ||
|
|
||
| A gitStream plugin to facilitate AI workflows with OpenAI's `gpt-4o-2024-08-06` model. | ||
|
|
||
| **Returns**: <code>Object</code> - Returns the AI-generated response based on the provided context and prompt. | ||
| **License**: MIT | ||
|
|
||
| | Param | Type | Description | | ||
| | ------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | ||
| | context | `Object` | The context that needs to be sent to the AI model for analysis. | | ||
| | role | `string` | Free text. If not empty, Defines the role or persona for the AI to adopt while generating the response. | | ||
| | context | `Object` | The context to be sent to the AI model with the prompt. | | ||
| | role | `string` | The system role or persona for the AI to adopt while generating the response. | | ||
| | prompt | `string` | The specific request or question you want the AI to respond to, after the context has been provided. | | ||
| | token | `Object` | The token to the AI model | | ||
|
|
||
| | token | `string` | Your OpenAI API token. | | ||
|
|
||
| **Example** | ||
| !!! tip "Encoding output" | ||
| The output of AI models may be lengthy, which might cause issues when setting the comment. We recommend using the [`encode`](./filter-functions.md#encode) filter function, as shown in the example, to ensure that the comment is passed fully. | ||
| The [`add-comment`](./automation-actions.md#add-comment) action automatically decodes encoded strings. | ||
|
|
||
|
|
||
| ```yaml | ||
| {{ source | askAI("QA tester", "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) }} | ||
| {{ {{ source | askAI("Experienced developer", "Summarize the changes in this PR in bullet points.", env.OPEN_AI_TOKEN) }} }} | ||
azigler marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.