Skip to content

Commit

Permalink
Fixed a tiny bug in the GPT interaction. (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSrijit authored May 3, 2023
1 parent 6f290ba commit 330eb9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/interactions/gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ async function createCompletion(text) {
return response.data.choices[0].text;
}

const interactionGPT = (bot, message) => {
const { channel, text } = message;
const interactionGPT = async (bot, message) => {
const { channel } = message;
let { text } = message;
text = text.replace("Orpheus", "").trim();
let prompt = [
`Create a chatbot conversation between a user and Hack Club's mascot Orpheus. The conversation should feel natural and friendly, with Orpheus showcasing its unique personality and style. The chatbot should be able to respond to a wide range of user messages, both related and unrelated to coding. The chatbot should also be able to recognize when the user needs help with coding and provide relevant assistance. Finally, the chatbot should not reveal itself as an AI model or a chatbot, but rather as Orpheus itself.`,
Expand All @@ -38,7 +39,7 @@ const interactionGPT = (bot, message) => {
User: ${text}\n
Orpheus: `,
].join("\n");
let returntext = createCompletion(prompt);
let returntext = await createCompletion(prompt);
if (channel == "C0266FRGT") {
return; // #announcements
}
Expand Down

0 comments on commit 330eb9f

Please sign in to comment.