forked from pnp/copilot-pro-dev-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactions.tsp
More file actions
38 lines (34 loc) · 1.19 KB
/
actions.tsp
File metadata and controls
38 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import "@typespec/http";
import "@microsoft/typespec-m365-copilot";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Actions;
@service
@server(GitHubAPI.SERVER_URL)
@actions(GitHubAPI.ACTIONS_METADATA)
namespace GitHubAPI {
/**
* Metadata for the GitHub API actions.
*/
const ACTIONS_METADATA = #{
nameForHuman: "GitHub",
descriptionForHuman: "Search open issues on GitHub.",
descriptionForModel: "Search open issues from GitHub repositories.",
legalInfoUrl: "https://docs.github.com/en/site-policy/github-terms/github-terms-of-service",
privacyPolicyUrl: "https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement"
};
/**
* The base URL for the GitHub API.
*/
const SERVER_URL = "https://api.github.com";
/**
* Search open issues from GitHub repositories.
* @param q The search query.
* @param per_page The number of results per page. Default is 5.
*/
@route("/search/issues")
@card(#{ dataPath: "$.items", title: "$.title", url: "$.html_url", file: "adaptiveCards/searchIssues.json" })
@get op searchIssues(
@query q: string = "repo:\${{GITHUB_REPO}} is:issue is:open",
@query per_page: integer = 5
): string;
}