Skip to content
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

use llmified keys for github #751

Closed
wants to merge 4 commits into from
Closed

use llmified keys for github #751

wants to merge 4 commits into from

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Oct 3, 2024


  • A new naming convention has been established, assigning unique identifiers prefixed by llm_. This change affects various GitHub tools:
    • github_actions_workflows_list
    • github_actions_runs_list
    • github_actions_jobs_list
    • github_actions_workflows_list
    • github_issues_list
    • github_issues_get
    • github_issues_comments_list
    • github_pulls_list
    • github_pulls_get
    • github_pulls_review_comments_list
  • This likely provides a more consistent way to refer to these resources across different contexts, improving code maintainability and readability.
  • The data fields in responses of the aforementioned tools are also renamed to follow the new llm_ prefixed ID pattern.
  • Over in the packages/core/src/github.ts file, code is adjusted to handle these new llm_ IDs.
  • Additionally, new constants are exported in the packages/core/src/constants.ts file, probably used for the prefix mentioned earlier for better coding practices.
  • A new file packages/core/src/llmid.ts is introduced to handle functions related to the ID conversion, like llmifyId, unllmifyIntId, and unllmifyId.
  • In the public API, additional llm_id fields have been added to the interfaces for GitHubWorkflowRun, GitHubWorkflowJob, GitHubIssue, GitHubComment, and GitHubWorkflow.
  • These interface changes indicate the llm_id values are intended to be exposed to and used by end-users or developers.
  • Lastly, unrelated to the llm_ ID changes, there are some minor fixes or adjustments in the packages/sample/genaisrc/poem.genai.mts file.

generated by pr-describe

@pelikhan pelikhan changed the title Llmkeys use llmified keys for github Oct 3, 2024
<LinkCard title="github_actions_jobs_list" description="List all jobs for a run." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
<LinkCard title="github_actions_workflows_list" description="List all workflows. 'llm_id' is the ID used in other tools." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
<LinkCard title="github_actions_runs_list" description="List all runs for a workflow. 'llm_id' is the ID used in other tools. Use 'git_actions_list_workflows' to list workflows." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
<LinkCard title="github_actions_jobs_list" description="List all jobs for a run. 'llm_id' is the ID used in other tools." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
<LinkCard title="github_actions_job_logs_get" description="Download workflow job log. If the log is too large, use 'github_actions_job_logs_diff' to compare logs." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
<LinkCard title="github_actions_job_logs_diff" description="Diffs two workflow job logsr." href="/genaiscript/reference/scripts/system#systemgithub_actions" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the word "logsr", should be "logs".

generated by pr-docs-review-commit typo

- tool `github_actions_jobs_list`: List all jobs for a run.
- tool `github_actions_workflows_list`: List all workflows. 'llm_id' is the ID used in other tools.
- tool `github_actions_runs_list`: List all runs for a workflow. 'llm_id' is the ID used in other tools. Use 'git_actions_list_workflows' to list workflows.
- tool `github_actions_jobs_list`: List all jobs for a run. 'llm_id' is the ID used in other tools.
- tool `github_actions_job_logs_get`: Download workflow job log. If the log is too large, use 'github_actions_job_logs_diff' to compare logs.
- tool `github_actions_job_logs_diff`: Diffs two workflow job logsr.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the word "logsr", should be "logs".

generated by pr-docs-review-commit typo

{},
async (args) => {
const { context } = args
context.log("github action list workflows")
const res = await github.listWorkflows()
return CSV.stringify(
res.map(({ id, name, path }) => ({ id, name, path })),
res.map(({ llm_id, name, path }) => ({ llm_id, name, path })),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_id' should be 'id' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

res.map(({ id, name, conclusion, head_sha }) => ({
id,
res.map(({ llm_id, name, conclusion, head_sha }) => ({
llm_id,
name,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_id' should be 'id' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

llm_id,
name,
status,
})),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_id' should be 'id' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

llm_number,
title,
state,
})),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_number' should be 'number' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

await github.getIssue(issue_number)
return YAML.stringify({
number,
llm_number,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_number' should be 'number' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

res.map(({ id, body, updated_at }) => ({
id,
res.map(({ llm_id, body, updated_at }) => ({
llm_id,
body,
updated_at,
})),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_id' should be 'id' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

number,
llm_number,
title,
state,
})),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_number' should be 'number' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

await github.getPullRequest(pull_number)
return YAML.stringify({
number,
llm_number,
title,
body,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_number' should be 'number' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

state,
html_url,
created_at,
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing type assertion for the return value of the map function. TypeScript might infer the wrong type.

generated by pr-review-commit missing_type_assertion

@@ -1393,7 +1403,7 @@ defTool(
context.log(`github pull comments list ${pull_number}`)
const res = await github.listPullRequestReviewComments(pull_number)
return CSV.stringify(
res.map(({ id, body }) => ({ id, body })),
res.map(({ id, llm_id, body }) => ({ id, llm_id, body })),
{ header: true }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'llm_id' should be 'id' to match the context and the rest of the documentation.

generated by pr-docs-review-commit incorrect_variable

state,
html_url,
created_at,
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing type assertion for the return value of the function. TypeScript might infer the wrong type.

generated by pr-review-commit missing_type_assertion

state,
html_url,
created_at,
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing type assertion for the return value of the map function. TypeScript might infer the wrong type.

generated by pr-review-commit missing_type_assertion

Copy link

github-actions bot commented Oct 3, 2024

The changes in the GIT_DIFF consist of a few key updates:

  1. Addition of new constants, presumably identifiers, in the constants file.
  2. Use of these new constants in the github.ts file where they seem to be used for creating a format for ID references, referred to as "llm_id". This involves updating various functions in the GitHubClient class to use and return these new formatted IDs.
  3. Creation of a new file, llmid.ts, which seems to contain functions necessary for constructing and deconstructing these new ID formats.
  4. Updates to types in the prompt_template.d.ts file to reflect the use of these new 'llm_id's in the GitHub interfaces.

Concerns:

  • The conversion functions in llmid.ts do not guard against invalid inputs, which may result in unexpected output.
  • There is a general assumption that the 'llm_id' conversion and deconversion will always work correctly, but there are no explicit error checks or handling mechanisms to ensure this.
  • In the GitHubClient class, the 'listWorkflowJobs' function now allows the 'runId' parameter to be either a number or a string, but there are no checks to ensure the string is a valid input.

Other than these, the changes look good and it's a smart way to create a unique identifier. LGTM 🚀

generated by pr-review

Copy link

github-actions bot commented Oct 3, 2024

I couldn't locate the specific code responsible for the failure. Please check if the file path and name are correct or provide further details.

generated by gai

Copy link

github-actions bot commented Oct 3, 2024

It seems there is a persistent issue with retrieving the changes. If you have access to the repository, you might want to manually check the recent commits between the failed and last successful runs.

Given the failure was related to a Node.js version issue, consider reviewing any changes related to package dependencies or Node.js version specifications in the workflow configuration.

generated by github-agent

@pelikhan pelikhan closed this Oct 3, 2024
@pelikhan pelikhan deleted the llmkeys branch October 4, 2024 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant