You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcommentHeader=`**Disclaimer:** This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary.`;
109
+
constcommentHeader=`
110
+
**Disclaimer:** This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary.
console.log("response from AI:",answerFromAi.trim().slice(0,300));
124
122
125
-
consthasAnswerFromAi=!answerFromAi.includes("Sorry, I don't know how to help with that.");
126
-
consthasSimilarDiscussions=similarDiscussions.length>0&&similarDiscussions!=="No similar discussions found.";
127
-
128
-
// if you don't have an answer from AI AND you don't have similar discussions, don't bother commenting
129
-
if(!hasSimilarDiscussions&&!hasAnswerFromAi){
130
-
// @ts-expect-error deno
131
-
Deno.exit(0);
132
-
}
133
-
134
-
letfullBody=`${commentHeader}`;
135
-
136
-
// answer and similar discussions
137
-
if(hasAnswerFromAi&&hasSimilarDiscussions){
138
-
constsimilarDiscussionPrefix=
139
-
"\n\nI also did a search, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:\n\n";
"\n\nI did do a search though, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:\n\n";
0 commit comments