-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testRun.js
43 lines (39 loc) · 1 KB
/
testRun.js
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
39
40
41
42
43
import { proposeLabels } from "./ai.js";
import dotenv from "dotenv";
dotenv.config();
export async function run() {
const issues = [
{
title: "This is a test issue",
body: "This is a test issue body"
},
{
title: "This is new coolest feature request",
body: "This is the most incredible feature request you've never seen"
},
{
title: "This product has a bug",
body: "this product does not work what I expected."
}
];
const availableLabels = {
data: [
{
name: "bug",
description: "This label is for bugs"
},
{
name: "enhancement",
description: "This label is for enhancements"
},
{
name: "question",
description: "This label is for questions"
}
]
};
const apiKey = process.env.OPENAI_API_KEY;
const labels = await Promise.all(issues.map((issue) => (proposeLabels(issue, availableLabels.data, { apiKey, logger: console }))))
console.log(labels);
}
await run();