mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
feat: added general session button in typebot, dify and openai in manager
This commit is contained in:
parent
9329330297
commit
56a165db54
@ -1,8 +1,15 @@
|
|||||||
# 2.0.9-rc (release candidate)
|
# 2.0.9-rc (release candidate)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Added general session button in typebot, dify and openai in manager
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Import contacts with image in chatwoot
|
* Import contacts with image in chatwoot
|
||||||
|
* Fix conversationId when is dify agent
|
||||||
|
* Fixed loading of selects in the manager
|
||||||
|
* Add restart button to sessions screen
|
||||||
|
|
||||||
# 2.0.8-rc (2024-08-08 20:23)
|
# 2.0.8-rc (2024-08-08 20:23)
|
||||||
|
|
||||||
|
351
manager/dist/assets/index-C__fF5dP.js
vendored
351
manager/dist/assets/index-C__fF5dP.js
vendored
File diff suppressed because one or more lines are too long
356
manager/dist/assets/index-oK8_wIXQ.js
vendored
Normal file
356
manager/dist/assets/index-oK8_wIXQ.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
manager/dist/index.html
vendored
2
manager/dist/index.html
vendored
@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Evolution Manager</title>
|
<title>Evolution Manager</title>
|
||||||
<script type="module" crossorigin src="/assets/index-C__fF5dP.js"></script>
|
<script type="module" crossorigin src="/assets/index-oK8_wIXQ.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DZ0gaAHg.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-DZ0gaAHg.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"@sentry/node": "^7.59.2",
|
"@sentry/node": "^7.59.2",
|
||||||
"amqplib": "^0.10.3",
|
"amqplib": "^0.10.3",
|
||||||
"axios": "^1.6.5",
|
"axios": "^1.6.5",
|
||||||
"baileys": "6.7.5",
|
"baileys": "github:WhiskeySockets/Baileys",
|
||||||
"class-validator": "^0.14.1",
|
"class-validator": "^0.14.1",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
@ -551,11 +551,7 @@ export class DifyService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!dify) {
|
if (dify && dify.instanceId !== instanceId) {
|
||||||
throw new Error('Dify not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dify.instanceId !== instanceId) {
|
|
||||||
throw new Error('Dify not found');
|
throw new Error('Dify not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -564,6 +560,9 @@ export class DifyService {
|
|||||||
where: {
|
where: {
|
||||||
difyId: difyId,
|
difyId: difyId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
Dify: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,8 +572,20 @@ export class DifyService {
|
|||||||
remoteJid: remoteJid,
|
remoteJid: remoteJid,
|
||||||
difyId: difyId,
|
difyId: difyId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
Dify: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.prismaRepository.difySession.findMany({
|
||||||
|
where: {
|
||||||
|
instanceId: instanceId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Dify: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(error);
|
this.logger.error(error);
|
||||||
throw new Error('Error fetching sessions');
|
throw new Error('Error fetching sessions');
|
||||||
@ -1199,7 +1210,7 @@ export class DifyService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let completeMessage = '';
|
let completeMessage = '';
|
||||||
let conversationId
|
let conversationId;
|
||||||
|
|
||||||
const stream = response.data;
|
const stream = response.data;
|
||||||
const reader = new Readable().wrap(stream);
|
const reader = new Readable().wrap(stream);
|
||||||
@ -1211,7 +1222,7 @@ export class DifyService {
|
|||||||
const event = JSON.parse(data);
|
const event = JSON.parse(data);
|
||||||
if (event.event === 'agent_message') {
|
if (event.event === 'agent_message') {
|
||||||
completeMessage += event.answer;
|
completeMessage += event.answer;
|
||||||
conversationId = conversationId ?? event?.conversation_id
|
conversationId = conversationId ?? event?.conversation_id;
|
||||||
|
|
||||||
console.log('completeMessage:', completeMessage);
|
console.log('completeMessage:', completeMessage);
|
||||||
}
|
}
|
||||||
@ -1241,8 +1252,8 @@ export class DifyService {
|
|||||||
data: {
|
data: {
|
||||||
status: 'opened',
|
status: 'opened',
|
||||||
awaitUser: true,
|
awaitUser: true,
|
||||||
sessionId: conversationId
|
sessionId: conversationId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
sendTelemetry('/message/sendText');
|
sendTelemetry('/message/sendText');
|
||||||
@ -1556,7 +1567,7 @@ export class DifyService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let completeMessage = '';
|
let completeMessage = '';
|
||||||
let conversationId
|
let conversationId;
|
||||||
|
|
||||||
const stream = response.data;
|
const stream = response.data;
|
||||||
const reader = new Readable().wrap(stream);
|
const reader = new Readable().wrap(stream);
|
||||||
@ -1572,7 +1583,7 @@ export class DifyService {
|
|||||||
const event = JSON.parse(jsonString);
|
const event = JSON.parse(jsonString);
|
||||||
if (event.event === 'agent_message') {
|
if (event.event === 'agent_message') {
|
||||||
completeMessage += event.answer;
|
completeMessage += event.answer;
|
||||||
conversationId = conversationId ?? event?.conversation_id
|
conversationId = conversationId ?? event?.conversation_id;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error parsing stream data:', error);
|
console.error('Error parsing stream data:', error);
|
||||||
@ -1600,8 +1611,8 @@ export class DifyService {
|
|||||||
data: {
|
data: {
|
||||||
status: 'opened',
|
status: 'opened',
|
||||||
awaitUser: true,
|
awaitUser: true,
|
||||||
sessionId: conversationId
|
sessionId: conversationId,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
sendTelemetry('/message/sendText');
|
sendTelemetry('/message/sendText');
|
||||||
|
@ -750,11 +750,7 @@ export class OpenaiService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!openaiBot) {
|
if (openaiBot && openaiBot.instanceId !== instanceId) {
|
||||||
throw new Error('Openai Bot not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (openaiBot.instanceId !== instanceId) {
|
|
||||||
throw new Error('Openai Bot not found');
|
throw new Error('Openai Bot not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,6 +759,9 @@ export class OpenaiService {
|
|||||||
where: {
|
where: {
|
||||||
openaiBotId: openaiBotId,
|
openaiBotId: openaiBotId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
OpenaiBot: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,8 +771,20 @@ export class OpenaiService {
|
|||||||
remoteJid: remoteJid,
|
remoteJid: remoteJid,
|
||||||
openaiBotId: openaiBotId,
|
openaiBotId: openaiBotId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
OpenaiBot: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.prismaRepository.openaiSession.findMany({
|
||||||
|
where: {
|
||||||
|
instanceId: instanceId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
OpenaiBot: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(error);
|
this.logger.error(error);
|
||||||
throw new Error('Error fetching sessions');
|
throw new Error('Error fetching sessions');
|
||||||
|
@ -548,11 +548,7 @@ export class TypebotService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!typebot) {
|
if (typebot && typebot.instanceId !== instanceId) {
|
||||||
throw new Error('Typebot not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typebot.instanceId !== instanceId) {
|
|
||||||
throw new Error('Typebot not found');
|
throw new Error('Typebot not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,6 +557,9 @@ export class TypebotService {
|
|||||||
where: {
|
where: {
|
||||||
typebotId: typebotId,
|
typebotId: typebotId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
Typebot: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,8 +569,20 @@ export class TypebotService {
|
|||||||
remoteJid: remoteJid,
|
remoteJid: remoteJid,
|
||||||
instanceId: instanceId,
|
instanceId: instanceId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
Typebot: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await this.prismaRepository.typebotSession.findMany({
|
||||||
|
where: {
|
||||||
|
instanceId: instanceId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Typebot: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(error);
|
this.logger.error(error);
|
||||||
throw new Error('Error fetching sessions');
|
throw new Error('Error fetching sessions');
|
||||||
|
Loading…
Reference in New Issue
Block a user