feat: adapt pullfrog for gitea + ollama
This commit is contained in:
@@ -10,25 +10,24 @@ export function GetIssueCommentsTool(ctx: ToolContext) {
|
||||
return tool({
|
||||
name: "get_issue_comments",
|
||||
description:
|
||||
"Get all comments for a GitHub issue. Returns all comments including the issue body and all subsequent discussion comments. " +
|
||||
"Get all comments for a Gitea issue or PR. " +
|
||||
"Example: `get_issue_comments({ issue_number: 1234 })`.",
|
||||
parameters: GetIssueComments,
|
||||
execute: execute(async ({ issue_number }) => {
|
||||
// set issue context
|
||||
ctx.toolState.issueNumber = issue_number;
|
||||
|
||||
const comments = await ctx.octokit.paginate(ctx.octokit.rest.issues.listComments, {
|
||||
const comments = await ctx.gitea.paginate(ctx.gitea.rest.issue.issueGetComments, {
|
||||
owner: ctx.repo.owner,
|
||||
repo: ctx.repo.name,
|
||||
issue_number,
|
||||
index: issue_number,
|
||||
});
|
||||
|
||||
return {
|
||||
issue_number,
|
||||
comments: comments.map((comment) => ({
|
||||
id: comment.id,
|
||||
body: comment.body,
|
||||
user: comment.user?.login,
|
||||
comments: comments.map((c) => ({
|
||||
id: c.id,
|
||||
body: c.body,
|
||||
user: c.user?.login,
|
||||
})),
|
||||
count: comments.length,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user