Implement OpenAI Assistant API
- Updated linkCop - Updated standard interaction handler
This commit is contained in:
@@ -22,7 +22,7 @@ export const gptInteraction = async (nodeIo, message) => {
|
||||
if (msg.author.id === nodeIo.serverClient.user.id) {
|
||||
conversation.push({
|
||||
role: 'assistant',
|
||||
name: msg.author.id,
|
||||
//name: msg.author.id,
|
||||
content: msg.content,
|
||||
});
|
||||
|
||||
@@ -31,13 +31,13 @@ export const gptInteraction = async (nodeIo, message) => {
|
||||
|
||||
conversation.push({
|
||||
role: 'user',
|
||||
name: msg.author.id,
|
||||
//name: msg.author.id,
|
||||
content: msg.content.replace(`<@${nodeIo.serverClient.user.id}>`, ''),
|
||||
});
|
||||
});
|
||||
const response = await gptHandler(conversation);
|
||||
if (response) {
|
||||
const responseMessage = response.choices[0].message.content;
|
||||
const responseMessage = response;
|
||||
const chunkSize = 2500;
|
||||
|
||||
for (let i = 0; i < responseMessage.length; i += chunkSize) {
|
||||
|
||||
Reference in New Issue
Block a user