update
This commit is contained in:
11
agent/npc.ts
11
agent/npc.ts
@@ -19,11 +19,17 @@ const main = async () => {
|
||||
const pickRepoInfoEnv = pick(repoInfoEnv, ['repoId', 'repoIdLabel', 'repoName', 'repoNameLabel', 'repoSlug', 'repoSlugLabel']);
|
||||
const issueLabels = issueEnv.issueLabels || [];
|
||||
const isComment = !!commentEnv.commentId;
|
||||
const envList = [
|
||||
...Object.entries(pickRepoInfoEnv).map(([key, value]) => `${key}: ${value}`),
|
||||
...Object.entries(pickIssueEnv).map(([key, value]) => `${key}: ${value}`),
|
||||
...Object.entries(pickCommentEnv).map(([key, value]) => `${key}: ${value}`),
|
||||
]
|
||||
writeToProcess('当前环境变量:');
|
||||
envList.forEach(item => writeToProcess(item));
|
||||
if (!isComment && !issueLabels.includes('Run')) {
|
||||
writeToProcess('当前 Issue 不包含 Run 标签,跳过执行');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const messages = [
|
||||
{
|
||||
role: 'system',
|
||||
@@ -37,7 +43,8 @@ const main = async () => {
|
||||
content: commentEnv.commentBody || pickIssueEnv.issueDescription || '无'
|
||||
}
|
||||
]
|
||||
console.log('messages', messages)
|
||||
writeToProcess('输入消息:');
|
||||
writeToProcess(JSON.stringify(messages, null, 2));
|
||||
const result = await app.run({
|
||||
path: 'cnb',
|
||||
key: 'chat',
|
||||
|
||||
Reference in New Issue
Block a user