-
Notifications
You must be signed in to change notification settings - Fork 108
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
Refactor grep functionality and enhance documentation tools across codebase #757
Changes from 21 commits
9daa2b2
d52641f
e0893e3
11bfc09
e8c217b
cee33a6
28346b7
8d7ad22
8a8b7cc
8228e4a
7a00aa2
a95d3ff
bef76d7
20a33c8
63ed371
7ab8dcf
877ea80
6642f85
ea54423
ab0d5ed
9f925d3
0b2b74d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode/* | ||
**/genaiscript.d.ts | ||
**/yarn.lock | ||
THIRD_PARTY_LICENSES.md |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { LinkCard } from '@astrojs/starlight/components'; | |
|
||
### Builtin Agents | ||
|
||
<LinkCard title="agent docs" description="query the documentation" href="/genaiscript/reference/scripts/system#systemagent_docs" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link provided is incorrect; it should point to 'system.agent_docs' instead of 'system#systemagent_docs'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link provided for "agent docs" is incorrect or outdated.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A new LinkCard was added without a corresponding description in the documentation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link for "agent docs" is missing a title attribute in the frontmatter.
|
||
<LinkCard title="agent fs" description="query files to accomplish tasks" href="/genaiscript/reference/scripts/system#systemagent_fs" /> | ||
<LinkCard title="agent git" description="query a repository using Git to accomplish tasks. Provide all the context information available to execute git queries." href="/genaiscript/reference/scripts/system#systemagent_git" /> | ||
<LinkCard title="agent github" description="query GitHub to accomplish tasks" href="/genaiscript/reference/scripts/system#systemagent_github" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { LinkCard } from '@astrojs/starlight/components'; | |
<LinkCard title="fs_diff_files" description="Computes a diff between two files." href="/genaiscript/reference/scripts/system#systemfs_diff_files" /> | ||
<LinkCard title="fs_find_files" description="Finds file matching a glob pattern. Use pattern to specify a regular expression to search for in the file content." href="/genaiscript/reference/scripts/system#systemfs_find_files" /> | ||
<LinkCard title="fs_read_file" description="Reads a file as text from the file system. Returns undefined if the file does not exist." href="/genaiscript/reference/scripts/system#systemfs_read_file" /> | ||
<LinkCard title="git_branch_default" description="Gets the default branch using git." href="/genaiscript/reference/scripts/system#systemgit" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A new LinkCard was added without a corresponding description in the documentation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link for "git_branch_default" is missing a title attribute in the frontmatter.
|
||
<LinkCard title="git_branch_current" description="Gets the current branch using git." href="/genaiscript/reference/scripts/system#systemgit" /> | ||
<LinkCard title="git_branch_list" description="List all branches using git." href="/genaiscript/reference/scripts/system#systemgit" /> | ||
<LinkCard title="git_diff" description="Computes file diffs using the git diff command. If the diff is too large, it returns the list of modified/added files." href="/genaiscript/reference/scripts/system#systemgit" /> | ||
|
@@ -28,6 +29,7 @@ import { LinkCard } from '@astrojs/starlight/components'; | |
<LinkCard title="github_pulls_get" description="Get a single pull request by number." href="/genaiscript/reference/scripts/system#systemgithub_pulls" /> | ||
<LinkCard title="github_pulls_review_comments_list" description="Get review comments for a pull request." href="/genaiscript/reference/scripts/system#systemgithub_pulls" /> | ||
<LinkCard title="math_eval" description="Evaluates a math expression" href="/genaiscript/reference/scripts/system#systemmath" /> | ||
<LinkCard title="md_find_files" description="Get the file structure of the documentation markdown/MDX files. Retursn filename, title, description for each match. Use pattern to specify a regular expression to search for in the file content." href="/genaiscript/reference/scripts/system#systemmd_find_files" /> | ||
pelikhan marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A new LinkCard was added without a corresponding description in the documentation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link for "md_find_files" is missing a title attribute in the frontmatter.
|
||
<LinkCard title="md_read_frontmatter" description="Reads the frontmatter of a markdown or MDX file." href="/genaiscript/reference/scripts/system#systemmd_frontmatter" /> | ||
<LinkCard title="python_code_interpreter_run" description="Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy, pandas, scipy. There is NO network connectivity. Do not attempt to install other packages or make web requests." href="/genaiscript/reference/scripts/system#systempython_code_interpreter" /> | ||
<LinkCard title="python_code_interpreter_copy_files" description="Copy files from the host file system to the container file system" href="/genaiscript/reference/scripts/system#systempython_code_interpreter" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,16 @@ | |
keywords: create script, VSCode, command palette, CLI, script generation | ||
--- | ||
|
||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
import { Tabs, TabItem } from "@astrojs/starlight/components" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect use of double quotes for import statement, should use single quotes.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mismatched quotes in import statement.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon at the end of the import statement.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import statement for Tabs and TabItem has been changed, which may affect the rendering of components.
|
||
|
||
<Tabs> | ||
<TabItem label="Visual Studio Code, Cursor"> | ||
|
||
Use the `> GenAiScript: Create new script...` command in the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) | ||
Use the `> GenAiScript: Create new script...` command in the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) | ||
(`Ctrl+Shift+P` on Windows/Linux, `⇧⌘P` on Mac) | ||
to create a new script. | ||
|
||
![The command palette and the create script command](../assets/vscode-create-new-script.png) | ||
![A command palette with a search bar showing ">createn" and a suggestion below for "GenAIScript: Create new script..." highlighted in blue.](../assets/vscode-create-new-script.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alt text for the image should be descriptive. The current text is too verbose and not succinct.
|
||
|
||
</TabItem> | ||
<TabItem label="Other Editors"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,12 @@ | |
authors: genaiscript | ||
canonical_url: https://microsoft.github.io/genaiscript/blog/code-review-with-genai | ||
description: Dive into automated code review processes with GenAI, enhancing | ||
developer efficiency and code quality. | ||
|
||
developer efficiency and code quality. | ||
--- | ||
|
||
## Introducing "Code Review with GenAI" 🧐 | ||
|
||
Have you ever wished for an extra set of eyes while coding? Well, GenAI has got your back! Let's delve into the "Reviewer" script, which automates the code review process, making it a breeze for developers. This powerful script for the GenAIScript platform can be found [here on GitHub](https://github.com/microsoft/genaiscript/blob/main/packages/vscode/genaisrc/rv.genai.mts). | ||
Have you ever wished for an extra set of eyes while coding? Well, GenAI has got your back! Let's delve into the "Reviewer" script, which automates the code review process, making it a breeze for developers. This powerful script for the GenAIScript platform can be found [here on GitHub](https://github.com/microsoft/genaiscript/blob/main/packages/vscode/genaisrc/prr.genai.mts). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link to the "Reviewer" script is incorrect or outdated; it should point to "prr.genai.mts" instead of "rv.genai.mts".
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link text "here on GitHub" points to an incorrect URL; it should be updated to match the new script name "prr.genai.mts" instead of "rv.genai.mts".
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link provided for the "Reviewer" script is incorrect; it should point to "prr.genai.mts" instead of "rv.genai.mts".
|
||
|
||
### What is the Script About? | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
```js | ||
script({ | ||
title: "Apply a script to an image", | ||
model: "openai:gpt-4-turbo-v", | ||
model: "openai:gpt-4o", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model name 'openai:gpt-4o' is incorrect; it should be 'openai:gpt-4-turbo-v'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model ID has been updated, ensure that the documentation reflects the correct model ID.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model in the script header has been updated, which may affect the script's behavior with images.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model ID "openai:gpt-4o" should be consistent with the rest of the documentation. It appears to be incorrect or outdated.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model name has been updated and should be reflected in the documentation.
|
||
}) | ||
``` | ||
4. Use [defImages](/genaiscript/reference/scripts/images/) to ingest the image file into the model context: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,9 +69,9 @@ | |
that powers the Visual Studio Code search). | ||
|
||
```js "workspace.grep" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name 'globs' should be 'glob' to match the property name used in the 'workspace.grep' method.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable 'globs' is incorrect; it should be 'glob' as used in the workspace.grep function.
|
||
const { pattern, glob } = env.vars | ||
const { pattern, globs } = env.vars | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable 'glob' has been renamed to 'globs', which may affect the script's functionality.
|
||
const patternRx = new RegExp(pattern, "g") | ||
const { files } = await workspace.grep(patternRx, glob) | ||
const { files } = await workspace.grep(patternRx, { globs }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect API usage, 'workspace.grep' should be called with 'glob' instead of 'globs'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is incorrectly called with an object instead of separate arguments.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is called with an object containing 'globs' instead of a string 'glob' parameter.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is incorrectly called with an object instead of separate arguments.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The usage of the 'workspace.grep' method has changed, which may affect the script's functionality.
|
||
``` | ||
pelikhan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Compute Transforms | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,7 +249,7 @@ | |
Grep or fuzz search [files](/genaiscript/referen/script/files) | ||
|
||
```js wrap | ||
const { files } = await workspace.grep(/[a-z][a-z0-9]+/, "**/*.md") | ||
const { files } = await workspace.grep(/[a-z][a-z0-9]+/, { globs: "*.md" }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect API usage, 'workspace.grep' should be called with 'glob' instead of 'globs'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is incorrectly called with an object instead of separate arguments.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parameter for 'workspace.grep' should be 'glob' instead of 'globs'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is called with an object containing 'globs' instead of a string 'glob' parameter.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace.grep' function is incorrectly called with an object instead of separate arguments.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The usage of the 'workspace.grep' method has changed, which may affect the script's functionality.
|
||
``` | ||
pelikhan marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The structure of the parameter passed to 'workspace.grep' has changed from a string to an object with a 'globs' property. This change needs to be reflected in all relevant code snippets.
|
||
|
||
</Card> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,33 +404,9 @@ | |
|
||
Options: | ||
-o, --out <string> output folder | ||
-h, --help display help for command | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace' command and its subcommands have been removed from the documentation, which suggests they are no longer supported.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The entire section for the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace' command and its subcommands have been removed from the CLI documentation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "workspace" command section is deprecated and should be removed from the documentation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'workspace' command section is deprecated and should be removed from the documentation.
|
||
## `workspace` | ||
|
||
``` | ||
Usage: genaiscript workspace [options] [command] | ||
|
||
Workspace tasks | ||
|
||
Options: | ||
-h, --help display help for command | ||
|
||
Commands: | ||
grep <pattern> [files...] | ||
help [command] display help for command | ||
``` | ||
|
||
### `workspace grep` | ||
|
||
``` | ||
Usage: genaiscript workspace grep [options] <pattern> [files...] | ||
|
||
Options: | ||
-h, --help display help for command | ||
``` | ||
|
||
## `info` | ||
|
||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
order: 10 | ||
--- | ||
|
||
Images can be added to the prompt for models that support this feature (like `gpt-4-turbo-v`). | ||
Images can be added to the prompt for models that support this feature (like `gpt-4o`). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model name 'gpt-4o' is incorrect; it should be 'gpt-4-turbo-v'.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model ID has been updated, ensure that the documentation reflects the correct model ID.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model in the documentation has been updated, which may affect the script's behavior with images.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model ID "openai:gpt-4o" should be consistent with the rest of the documentation. It appears to be incorrect or outdated.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model name has been updated and should be reflected in the documentation.
|
||
Use the `defImages` function to declare the images. Supported images will vary | ||
with models but typically include `PNG`, `JPEG`, `WEBP`, and `GIF`. Both local files and URLs are supported. | ||
|
||
|
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.
Link text should be descriptive and unique for accessibility. "agent docs" is not descriptive enough.