Skip to content

Commit

Permalink
Simplify actions and models
Browse files Browse the repository at this point in the history
  • Loading branch information
GioChkhaidze authored Jun 10, 2024
1 parent b340c76 commit ec6b6f2
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,26 @@ jobs:
async function run() {
if (commentBody.startsWith(prefix)) {
let restCommentBody = commentBody.replace(prefix, '').trim();
let action = ''
let model = ''
let actions = ['recommend', 'summarize', 'interact'];
let models = ['triagerx', 'chatgpt', 'gemini'];
let action = null;
let model = null;
if (commentBody.includes('/recommend')){
restCommentBody = restCommentBody.replace('/recommend', '').trim();
action = 'recommend'
} else if (commentBody.includes('/summarize')){
restCommentBody = restCommentBody.replace('/summarize', '').trim();
action = 'summarize'
} else if (commentBody.includes('/interact')){
restCommentBody = restCommentBody.replace('/interact', '').trim();
action = 'interact'
}
actions.forEach(keyword => {
if (!action && restCommentBody.includes(`/${keyword}`)) {
restCommentBody = restCommentBody.replace(`/${keyword}`, '').trim();
action = keyword;
}
});
if (commentBody.includes('-triagerx')){
restCommentBody = restCommentBody.replace('-triagerx', '').trim();
model = 'triagerx'
} else if (commentBody.includes('-chatgpt')){
restCommentBody = restCommentBody.replace('-chatgpt', '').trim();
model = 'chatgpt'
} else if (commentBody.includes('-gemini')){
restCommentBody = restCommentBody.replace('-gemini', '').trim();
model = 'gemini'
}
models.forEach(keyword => {
if (!model && restCommentBody.includes(`-${keyword}`)) {
restCommentBody = restCommentBody.replace(`-${keyword}`, '').trim();
model = keyword;
}
});
if (action == '' || model == '') {
if (action == null || model == null) {
console.log("Action or model is missing.");
return;
}
Expand Down

0 comments on commit ec6b6f2

Please sign in to comment.