Skip to content

Commit 7a992fc

Browse files
1AhmedYasserbaha-aValterArojaX10btRayDNoper
authored
Merging V2.0.1 to dev (#933)
* Remove unnecessary overflow (#864) * Work on the external bot previous message input Added hbs file to format the input from sql to get the previous messages to correct format for the llm. * Update ci-build-image.yml * Update .env.test * Refactor message-to-bot internal endpoint (#868) * Refactor message-to-bot to templates * Fix empty message array on bot_message_to_db * Revert changes back and Merge buttons with bot messages * Remove log steps and imporve services calling * Update URLs for common services * Fix empty message after redirecting user to backoffice --------- Co-authored-by: RayDNoper <alar.floren@bpw-consulting.com> * Remove helpers.js from dmapper * Added filter company related persons handlebars * Reverted changes in message to bot * Added filter steps * Added handlebars template for formatting and modified message to bot * Add business register handlebars and modified message to bot * Update message-to-bot.yml * Update package.json * Update .env.test * Update external-bot.yml * Trigger Services based on detected intents (#884) * Added Trigger Service Template * Modified trigger service to trigger services based on input * Added Markdown Support * Update .env.test * Added SSE Notification Templates and modified affected endpoints * Fixed message preview * Fixed Message Preview * Mirror search functionality to Training Module * Update .env.test * Removed Result check and add error step * Update notifications.json * Update notifications.json * Added Service Check * Added Services Yamls * Seperated Common Services for companies * Separated common service detection * Fix chat history scroll (#900) * Trigger Applicable Chatbot Features Based On End-Client's Input (#898) (#904) * Added SSE Notification Templates and modified affected endpoints * Fixed message preview * Fixed Message Preview Co-authored-by: Ahmed yasser <26207361+1AhmedYasser@users.noreply.github.com> * Update .env.test * Update table pagination (#911) * Update table pagination * Handle missing pagination * Fix chat history search (#908) * Fix chat history search * Update alias * Update .env.test * Feature 897 Working time problem (#907) (#913) * Updated SetttingsWorkingTime to process min/max possible timeframes, Updated FormDatePicker to set min/max possible values to times, with default if none provided. * Removed unused variables. * Added time difference 15 minutes, and check that by hand gap cannot be less. Co-authored-by: Vassili Moskaljov <112167412+ExiRain@users.noreply.github.com> * Update .env.test * Added CALENDAR services support * Fix parsing percentages in chat (#912) * Update .env.test --------- Co-authored-by: Bahaa Alsharif <bhlshrf@gmail.com> Co-authored-by: ValterAro <122787093+ValterAro@users.noreply.github.com> Co-authored-by: ValterAro <valteraro@hotmail.com> Co-authored-by: jaX10bt <132996313+jaX10bt@users.noreply.github.com> Co-authored-by: RayDNoper <alar.floren@bpw-consulting.com> Co-authored-by: Varmo <101868197+varmoh@users.noreply.github.com> Co-authored-by: Mihhail Kohhantsuk <mihhail@devtailor.com> Co-authored-by: Mihhail Kohhantsuk <32133759+Minwasko@users.noreply.github.com> Co-authored-by: Rainer Türner <90505798+turnerrainer@users.noreply.github.com> Co-authored-by: Vassili Moskaljov <112167412+ExiRain@users.noreply.github.com>
1 parent a62027b commit 7a992fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1639
-1596
lines changed

.env.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
RELEASE=PRE-ALPHA-test
22
VERSION=2
33
BUILD=3
4-
FIX=19
4+
FIX=27

.github/workflows/ci-build-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and publish GUI with nginx
33
on:
44
push:
55
branches:
6-
- dev
6+
- v2.0.1
77
paths:
88
- '.env.test'
99

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{{#each messages}}
3+
{
4+
"text": "{{{ignoreBlacklist text ../ignoreTexts}}}"{{#if (isFirstIndex @index)}},
5+
"buttons": [{{#each ../companies}}{"title": "{{{name}}}","payload": "{{{../../prefix}}} {{{registry_code}}}"}{{#unless @last}},{{/unless}}{{/each}}]
6+
{{/if}}
7+
}
8+
{{#unless @last}},{{/unless}}
9+
{{/each}}
10+
]

DSL/DMapper/hbs/bot_responses_to_messages.handlebars

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{{#each data.botMessages}}
33
{
44
"chatId": "{{../data.chatId}}",
5-
"content": "{{{text}}}",
6-
"buttons": "[{{#each ../data.buttons}}{\"title\": \"{{{title}}}\",\"payload\": \"{{{payload}}}\"}{{#unless @last}},{{/unless}}{{/each}}]",
5+
"content": "{{{choose text result}}}",
6+
"buttons": "[{{#each buttons}}{\"title\": \"{{{title}}}\",\"payload\": \"{{{payload}}}\"}{{#unless @last}},{{/unless}}{{/each}}]",
77
"authorTimestamp": "{{../data.authorTimestamp}}",
88
"authorId": "{{../data.authorId}}",
99
"authorFirstName": "{{../data.authorFirstName}}",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{{#each data.botMessages}}
3+
{
4+
"chatId": "{{../data.chatId}}",
5+
"content": "{{formatDataByBusinessRegister ../data}}",
6+
"buttons": "[{{#each buttons}}{\"title\": \"{{{title}}}\",\"payload\": \"{{{payload}}}\"}{{#unless @last}},{{/unless}}{{/each}}]",
7+
"authorTimestamp": "{{../data.authorTimestamp}}",
8+
"authorId": "{{../data.authorId}}",
9+
"authorFirstName": "{{../data.authorFirstName}}",
10+
"authorLastName": "{{../data.authorLastName}}",
11+
"created": "{{../data.created}}"
12+
}{{#unless @last}},{{/unless}}
13+
{{/each}}
14+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{{#each data.botMessages}}
3+
{
4+
"chatId": "{{../data.chatId}}",
5+
"content": "{{formatDataByRole ../data}}",
6+
"buttons": "[{{#each buttons}}{\"title\": \"{{{title}}}\",\"payload\": \"{{{payload}}}\"}{{#unless @last}},{{/unless}}{{/each}}]",
7+
"authorTimestamp": "{{../data.authorTimestamp}}",
8+
"authorId": "{{../data.authorId}}",
9+
"authorFirstName": "{{../data.authorFirstName}}",
10+
"authorLastName": "{{../data.authorLastName}}",
11+
"created": "{{../data.created}}"
12+
}{{#unless @last}},{{/unless}}
13+
{{/each}}
14+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{{#each data.botMessages}}
3+
{
4+
"chatId": "{{../data.chatId}}",
5+
"content": "{{formatDataByContactType ../data}}",
6+
"buttons": "[{{#each buttons}}{\"title\": \"{{{title}}}\",\"payload\": \"{{{payload}}}\"}{{#unless @last}},{{/unless}}{{/each}}]",
7+
"authorTimestamp": "{{../data.authorTimestamp}}",
8+
"authorId": "{{../data.authorId}}",
9+
"authorFirstName": "{{../data.authorFirstName}}",
10+
"authorLastName": "{{../data.authorLastName}}",
11+
"created": "{{../data.created}}"
12+
}{{#unless @last}},{{/unless}}
13+
{{/each}}
14+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#each names}}{{#if @index}}|||{{/if}}{{#if this}}{{this}}-{{lookup ../messages @index}}{{else}}User-{{lookup ../messages @index}}{{/if}}{{/each}}

DSL/DMapper/lib/helpers.js

-37
This file was deleted.

DSL/OpenSearch/mock/notifications.json

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
{"channelId": "b794c417-7f90-4e4e-b7e5-16f41614c4fe","payload": {"content":"Another notification for user 1"},"timestamp": "1801371325697", "sentTo": []}
77
{"index":{"_id":"4"}}
88
{"channelId": "11111111-7f90-4e4e-b7e5op-111111111111","payload": {"content":"Again, another notification for user 1"},"timestamp": "1801371325797", "sentTo": []}
9+
{"index":{"_id":"5"}}
10+
{"channelId": "model-list","payload": {"status":"Status Changed", "state": ""},"timestamp": "1801371325497", "sentTo": []}
11+

DSL/Resql/get-cs-all-ended-chats.sql

+19
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,25 @@ JOIN FirstContentMessage ON c.base_id = FirstContentMessage.chat_base_id
145145
LEFT JOIN ContactsMessage ON ContactsMessage.chat_base_id = c.base_id
146146
CROSS JOIN TitleVisibility
147147
CROSS JOIN NPS
148+
WHERE (
149+
:search IS NULL OR
150+
:search = '' OR
151+
LOWER(c.customer_support_display_name) LIKE LOWER('%' || :search || '%') OR
152+
LOWER(c.end_user_first_name) LIKE LOWER('%' || :search || '%') OR
153+
LOWER(ContactsMessage.content) LIKE LOWER('%' || :search || '%') OR
154+
LOWER(s.comment) LIKE LOWER('%' || :search || '%') OR
155+
LOWER(c.status) LIKE LOWER('%' || :search || '%') OR
156+
LOWER(m.event) LIKE LOWER('%' || :search || '%') OR
157+
LOWER(c.base_id) LIKE LOWER('%' || :search || '%') OR
158+
TO_CHAR(FirstContentMessage.created, 'DD.MM.YYYY HH24:MI:SS') LIKE '%' || :search || '%' OR
159+
TO_CHAR(c.ended, 'DD.MM.YYYY HH24:MI:SS') LIKE '%' || :search || '%' OR
160+
EXISTS (
161+
SELECT 1
162+
FROM message AS msg
163+
WHERE msg.chat_base_id = c.base_id
164+
AND LOWER(msg.content) LIKE LOWER('%' || :search || '%')
165+
)
166+
)
148167
ORDER BY
149168
CASE WHEN :sorting = 'created asc' THEN FirstContentMessage.created END ASC,
150169
CASE WHEN :sorting = 'created desc' THEN FirstContentMessage.created END DESC,
File renamed without changes.

DSL/Ruuter.private/DSL/POST/agents/chats/ended.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declaration:
22
call: declare
33
version: 0.1
4-
description: "Decription placeholder for 'ENDED'"
4+
description: "Decription placeholder for 'ENDED-CHATS'"
55
method: post
66
accepts: json
77
returns: json
@@ -23,6 +23,9 @@ declaration:
2323
- field: sorting
2424
type: string
2525
description: "Body field 'sorting'"
26+
- field: search
27+
type: string
28+
description: "Body field 'search'"
2629

2730
extractRequestData:
2831
assign:
@@ -39,6 +42,7 @@ getEndedChats:
3942
page: ${incoming.body.page}
4043
page_size: ${incoming.body.page_size}
4144
sorting: ${incoming.body.sorting}
45+
search: ${incoming.body.search}
4246
result: res
4347

4448
returnSuccess:

DSL/Ruuter.private/DSL/POST/agents/chats/messages/event.yml

+16-48
Original file line numberDiff line numberDiff line change
@@ -58,56 +58,24 @@ insertMessage:
5858
forwardedToCsa: ${message.forwardedToCsa ?? ""}
5959
rating: ${message.rating ?? ""}
6060
result: insertMessageResult
61-
next: clearChatList
61+
next: notify_chats
6262

63-
clearChatList:
64-
call: http.post
65-
args:
66-
url: "[#CHATBOT_OPENSEARCH]/notifications/_delete_by_query?conflicts=proceed"
67-
body:
68-
query:
69-
term:
70-
channelId: "chat-list"
71-
result: clear_chat_res
72-
next: postNotificationAboutAddedChat
73-
74-
postNotificationAboutAddedChat:
75-
call: http.post
76-
args:
77-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
78-
body:
79-
channelId: "chat-list"
80-
timestamp: ${new Date().toISOString()}
81-
payload: {
82-
"status": "Chat Status Changed",
83-
"chatId": "${message.chatBaseId}"
84-
}
85-
result: chat_notification_result
86-
next: clearMessages
63+
notify_chats:
64+
template: chats/notify
65+
requestType: templates
66+
body:
67+
chatId: ${message.chatBaseId}
68+
result: chats_notify_res
69+
next: notify_messages
8770

88-
clearMessages:
89-
call: http.post
90-
args:
91-
url: "[#CHATBOT_OPENSEARCH]/notifications/_delete_by_query?conflicts=proceed"
92-
body:
93-
query:
94-
term:
95-
channelId: ${message.chatBaseId}
96-
result: clear_messages_res
97-
next: postNotificationAboutMessageResponse
98-
99-
postNotificationAboutMessageResponse:
100-
call: http.post
101-
args:
102-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
103-
body:
104-
channelId: ${message.chatBaseId}
105-
timestamp: ${new Date().toISOString()}
106-
payload: {
107-
"type": "message",
108-
"messageId": "${messageId}"
109-
}
110-
result: message_notification_result
71+
notify_messages:
72+
template: messages/notify
73+
requestType: templates
74+
body:
75+
chatId: ${message.chatBaseId}
76+
type: "message"
77+
messageId: ${id}
78+
result: messages_notify_res
11179
next: return_result
11280

11381
return_result:

DSL/Ruuter.private/DSL/POST/agents/chats/messages/insert.yml

+17-49
Original file line numberDiff line numberDiff line change
@@ -103,57 +103,25 @@ insertMessage:
103103
forwardedFromCsa: ""
104104
forwardedToCsa: ""
105105
result: insertMessageResult
106-
next: clearChatList
106+
next: notify_chats
107107

108-
clearChatList:
109-
call: http.post
110-
args:
111-
url: "[#CHATBOT_OPENSEARCH]/notifications/_delete_by_query?conflicts=proceed"
112-
body:
113-
query:
114-
term:
115-
channelId: "chat-list"
116-
result: clear_chat_res
117-
next: postNotificationAboutAddedChat
118-
119-
postNotificationAboutAddedChat:
120-
call: http.post
121-
args:
122-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
123-
body:
124-
channelId: "chat-list"
125-
timestamp: ${new Date().toISOString()}
126-
payload: {
127-
"status": "Chat Status Changed",
128-
"chatId": "${chatId}"
129-
}
130-
result: chat_notification_result
131-
next: clearMessages
108+
notify_chats:
109+
template: chats/notify
110+
requestType: templates
111+
body:
112+
chatId: ${chatId}
113+
result: chats_notify_res
114+
next: notify_messages
132115

133-
clearMessages:
134-
call: http.post
135-
args:
136-
url: "[#CHATBOT_OPENSEARCH]/notifications/_delete_by_query?conflicts=proceed"
137-
body:
138-
query:
139-
term:
140-
channelId: ${chatId}
141-
result: clear_messages_res
142-
next: postNotificationAboutMessageResponse
143-
144-
postNotificationAboutMessageResponse:
145-
call: http.post
146-
args:
147-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
148-
body:
149-
channelId: ${chatId}
150-
timestamp: ${new Date().toISOString()}
151-
payload: {
152-
"type": "message",
153-
"messageId": "${uuid}"
154-
}
155-
result: message_notification_result
156-
next: return_result
116+
notify_messages:
117+
template: messages/notify
118+
requestType: templates
119+
body:
120+
chatId: ${chatId}
121+
type: "message"
122+
messageId: ${uuid}
123+
result: messages_notify_res
124+
next: return_result
157125

158126
return_result:
159127
return: "Message Sent Successfully"

DSL/Ruuter.private/DSL/POST/chats/claim.yml

+15-36
Original file line numberDiff line numberDiff line change
@@ -111,31 +111,14 @@ insertMessage:
111111
forwardedFromCsa: ""
112112
forwardedToCsa: ""
113113
result: insertMessageResult
114-
next: clearChatList
114+
next: notify_chats
115115

116-
clearChatList:
117-
call: http.post
118-
args:
119-
url: "[#CHATBOT_OPENSEARCH]/notifications/_delete_by_query?conflicts=proceed"
120-
body:
121-
query:
122-
term:
123-
channelId: "chat-list"
124-
result: clear_chat_res
125-
next: postNotificationAboutAddedChat
126-
127-
postNotificationAboutAddedChat:
128-
call: http.post
129-
args:
130-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
131-
body:
132-
channelId: "chat-list"
133-
timestamp: ${new Date().toISOString()}
134-
payload: {
135-
"status": "Chat Status Changed",
136-
"chatId": "${activeChat.id}"
137-
}
138-
result: chat_notification_result
116+
notify_chats:
117+
template: chats/notify
118+
requestType: templates
119+
body:
120+
chatId: ${activeChat.id}
121+
result: chats_notify_res
139122
next: getClaimedChat
140123

141124
getClaimedChat:
@@ -146,18 +129,14 @@ getClaimedChat:
146129
id: ${id}
147130
result: claimedChatRes
148131

149-
postNotificationAboutMessageResponse:
150-
call: http.post
151-
args:
152-
url: "[#CHATBOT_OPENSEARCH]/notifications/_doc"
153-
body:
154-
channelId: ${activeChat.id}
155-
timestamp: ${new Date().toISOString()}
156-
payload: {
157-
"type": "message",
158-
"messageId": "${messageUuid}"
159-
}
160-
result: message_notification_result
132+
notify_messages:
133+
template: messages/notify
134+
requestType: templates
135+
body:
136+
chatId: ${activeChat.id}
137+
type: "message"
138+
messageId: ${messageUuid}
139+
result: messages_notify_res
161140

162141
remove_chat_id_from_queue_notification_node_if_existed:
163142
call: http.post

0 commit comments

Comments
 (0)