@memori.ai/memori-react 8.37.0 → 8.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/components/ChatBubble/ChatBubble.js +9 -1
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +12 -3
- package/dist/components/ChatInputs/ChatInputs.js +30 -30
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js +9 -2
- package/dist/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/dist/locales/de.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +2 -10
- package/dist/locales/it.json +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/ChatBubble/ChatBubble.js +9 -1
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +12 -3
- package/esm/components/ChatInputs/ChatInputs.js +30 -30
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js +9 -2
- package/esm/components/WhyThisAnswer/WhyThisAnswer.js.map +1 -1
- package/esm/locales/de.json +1 -0
- package/esm/locales/en.json +1 -0
- package/esm/locales/es.json +1 -0
- package/esm/locales/fr.json +2 -10
- package/esm/locales/it.json +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +1 -1
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +90 -0
- package/src/components/ChatBubble/ChatBubble.tsx +13 -1
- package/src/components/ChatInputs/ChatInputs.css +12 -3
- package/src/components/ChatInputs/ChatInputs.tsx +22 -18
- package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +18 -3
- package/src/locales/de.json +2 -1
- package/src/locales/en.json +1 -0
- package/src/locales/es.json +1 -0
- package/src/locales/fr.json +2 -10
- package/src/locales/it.json +1 -1
- package/src/version.ts +1 -1
|
@@ -27,6 +27,18 @@ export interface Props {
|
|
|
27
27
|
const addQuestionMark = (question: string) =>
|
|
28
28
|
question.endsWith('?') ? question : `${question}?`;
|
|
29
29
|
|
|
30
|
+
const removeDocumentTags = (text: string) =>
|
|
31
|
+
text
|
|
32
|
+
// Remove document wrapper tags while keeping their inner content.
|
|
33
|
+
.replace(/<\/?documents?\b[^>]*>/gi, '')
|
|
34
|
+
// Remove self-closing document tags entirely.
|
|
35
|
+
.replace(/<documents?\b[^>]*\/>/gi, '')
|
|
36
|
+
// Remove attachment wrapper tags while keeping their inner content.
|
|
37
|
+
.replace(/<\/?attachments?\b[^>]*>/gi, '')
|
|
38
|
+
// Remove self-closing attachment tags entirely.
|
|
39
|
+
.replace(/<attachments?\b[^>]*\/>/gi, '')
|
|
40
|
+
.trim();
|
|
41
|
+
|
|
30
42
|
const WhyThisAnswer = ({
|
|
31
43
|
message,
|
|
32
44
|
sessionID,
|
|
@@ -39,6 +51,9 @@ const WhyThisAnswer = ({
|
|
|
39
51
|
const { t } = useTranslation();
|
|
40
52
|
|
|
41
53
|
const searchMemory = client?.search.searchMemory;
|
|
54
|
+
const sanitizedQuestionAnswered = removeDocumentTags(
|
|
55
|
+
message.questionAnswered || ''
|
|
56
|
+
);
|
|
42
57
|
|
|
43
58
|
const [matches, setMatches] = useState<SearchMatches[]>(initialMatches);
|
|
44
59
|
const [loading, setLoading] = useState(_TEST_loading);
|
|
@@ -55,7 +70,7 @@ const WhyThisAnswer = ({
|
|
|
55
70
|
const { matches, ...response } = await searchMemory(sessionID, {
|
|
56
71
|
searchType: 'Semantic',
|
|
57
72
|
numberOfResults: 3,
|
|
58
|
-
text:
|
|
73
|
+
text: sanitizedQuestionAnswered,
|
|
59
74
|
date: message.date,
|
|
60
75
|
placeName: message.placeName,
|
|
61
76
|
placeLatitude: message.placeLatitude,
|
|
@@ -94,10 +109,10 @@ const WhyThisAnswer = ({
|
|
|
94
109
|
>
|
|
95
110
|
<p>{t('whyThisAnswerHelper')}</p>
|
|
96
111
|
|
|
97
|
-
{
|
|
112
|
+
{sanitizedQuestionAnswered && (
|
|
98
113
|
<p className="memori--whythisanswer-question-answered">
|
|
99
114
|
<strong>{t('question') || 'Question'}:</strong>{' '}
|
|
100
|
-
{
|
|
115
|
+
{sanitizedQuestionAnswered}
|
|
101
116
|
</p>
|
|
102
117
|
)}
|
|
103
118
|
|
package/src/locales/de.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"pageInstructExplanation": "Um mir neue Dinge beizubringen, klicken Sie auf die Schaltfläche \"ANLEITEN\", um zu beginnen",
|
|
143
143
|
"pageTryMeExplanation": "Um mit mir zu sprechen, klicken Sie auf die Schaltfläche START, um zu beginnen",
|
|
144
144
|
"pagePrivacyExplanation": "Die Konversationen sind sichtbar von dem Autor des Agenten",
|
|
145
|
+
"aiDisclaimer": "Der Agent kann Fehler machen. Bitte überprüfen Sie die Antworten.",
|
|
145
146
|
"downloadChat": "Chat herunterladen",
|
|
146
147
|
"pagePrivacyExplanationList": {
|
|
147
148
|
"allConversations": "Alle Konversationen mit diesem Agenten sind sichtbar von dem Autor des Agenten",
|
|
@@ -194,7 +195,7 @@
|
|
|
194
195
|
},
|
|
195
196
|
"artifact": {
|
|
196
197
|
"close": "Schließen",
|
|
197
|
-
"size": "Größe",
|
|
198
|
+
"size": "Größe",
|
|
198
199
|
"generated": "Generiert",
|
|
199
200
|
"download": "Herunterladen",
|
|
200
201
|
"print": "Drucken",
|
package/src/locales/en.json
CHANGED
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
"pageInstructExplanation": "To teach me new things click on the INSTRUCT ME button to get started",
|
|
145
145
|
"pageTryMeExplanation": "To talk to me click on the START button to get started",
|
|
146
146
|
"pagePrivacyExplanation": "The conversations are visible by the author of the agent",
|
|
147
|
+
"aiDisclaimer": "The agent may make mistakes. Please verify the answers.",
|
|
147
148
|
"downloadChat": "Download chat",
|
|
148
149
|
"pagePrivacyExplanationList": {
|
|
149
150
|
"allConversations": "All conversations with this agent are visible to the author of the agent",
|
package/src/locales/es.json
CHANGED
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
"authorUsesInfo": "El autor utiliza estas informaciones para mejorar las funciones del agente y para ofrecerte un mejor servicio. Continuando la conversación, acepta estas condiciones."
|
|
152
152
|
},
|
|
153
153
|
"instructButton": "INSTRUÍME",
|
|
154
|
+
"aiDisclaimer": "El agente puede cometer errores. Por favor, verifica las respuestas.",
|
|
154
155
|
"downloadChat": "Descargar chat",
|
|
155
156
|
"tryMeButton": "COMENZAR",
|
|
156
157
|
"resumeButton": "CONTINUAR",
|
package/src/locales/fr.json
CHANGED
|
@@ -135,16 +135,7 @@
|
|
|
135
135
|
"error": "Échec de l'exportation du chat en PDF. Veuillez réessayer."
|
|
136
136
|
},
|
|
137
137
|
"write_and_speak": {
|
|
138
|
-
"
|
|
139
|
-
"noChatHistoryAvailable": "Aucun historique des discussions disponible",
|
|
140
|
-
"noResultsFound": "Aucun résultat trouvé pour \"{{searchText}}\"",
|
|
141
|
-
"searchInChatHistory": "Rechercher dans l'historique des chats...",
|
|
142
|
-
"latestFirst": "Plus récents d'abord",
|
|
143
|
-
"oldestFirst": "Plus anciens d'abord",
|
|
144
|
-
"exportChat": "Exporter le Chat",
|
|
145
|
-
"conversationStartedLabel": "Conversation démarrée"
|
|
146
|
-
},
|
|
147
|
-
"write_and_speak": {
|
|
138
|
+
"conversationStartedLabel": "Conversation démarrée",
|
|
148
139
|
"micButtonPopover": "Cliquez sur le bouton pour parler",
|
|
149
140
|
"micButtonPopoverListening": "Cliquez sur le bouton pour arrêter de parler",
|
|
150
141
|
"pageInstructExplanation": "Pour m'apprendre de nouvelles choses, cliquez sur le bouton INSTRUCTEZ-MOI pour commencer",
|
|
@@ -159,6 +150,7 @@
|
|
|
159
150
|
"contentAndIpAddress": "L'auteur peut voir le contenu et votre adresse IP",
|
|
160
151
|
"authorUsesInfo": "L'auteur utilise ces informations pour améliorer les fonctionnalités de l'agent et pour vous fournir un meilleur service. En continuant la conversation, vous acceptez ces conditions."
|
|
161
152
|
},
|
|
153
|
+
"aiDisclaimer": "L'agent peut commettre des erreurs. Veuillez vérifier les réponses.",
|
|
162
154
|
"downloadChat": "Télécharger le chat",
|
|
163
155
|
"instructButton": "INSTRUCTEZ-MOI",
|
|
164
156
|
"tryMeButton": "COMMENCER",
|
package/src/locales/it.json
CHANGED
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
"pageInstructExplanation": "Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare",
|
|
145
145
|
"pageTryMeExplanation": "Per parlare con me clicca sul pulsante INIZIAMO per cominciare",
|
|
146
146
|
"pagePrivacyExplanation": "Le conversazioni sono visibili all'autore dell'agente",
|
|
147
|
+
"aiDisclaimer": "L'agente può commettere errori. Assicurati di verificare le risposte.",
|
|
147
148
|
"downloadChat": "Scarica chat",
|
|
148
149
|
"pagePrivacyExplanationList": {
|
|
149
150
|
"allConversations": "Tutte le conversazioni con questo agente sono visibili all'autore dell'agente",
|
|
@@ -259,7 +260,6 @@
|
|
|
259
260
|
"pdfExportNotSupported": "L'esportazione PDF non è supportata in questo browser",
|
|
260
261
|
"popupBlocked": "Popup bloccato! Abilita i popup per stampare.",
|
|
261
262
|
"safariPdfInstructions": "Esportazione PDF aperta in una nuova finestra. Usa Cmd+P (Mac) o Ctrl+P (Windows) per stampare e salvare come PDF."
|
|
262
|
-
|
|
263
263
|
},
|
|
264
264
|
"media": {
|
|
265
265
|
"title": "Titolo",
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated. Do not edit manually.
|
|
2
|
-
export const version = '8.
|
|
2
|
+
export const version = '8.38.1';
|