buerokratt / Training-Module

MIT License
2 stars 20 forks source link

Bug with adding a example under an intent #560

Open Kristjan259 opened 3 months ago

Kristjan259 commented 3 months ago

Examples under intents go missing when adding another example.

Screencapture to illustrate the issue: Screencast from 14.06.2024 11:01:31.webm

Expected result - When a new example is added then it should always be displayed on the table with other examples.

Kristjan259 commented 3 months ago

BUG: When we have an intent where there are few examples:

Image

And add a longer one and press lisa then all of the examples seem to disappear:

Image

Expected result - When a new example is added then it should always be displayed on the table with other examples.

ffrose commented 3 months ago

[BUG]

Example box is now a one liner so it is not possible to new lines, but when an intent example is pasted from clipboard and contains either a \t (tab/indent) or a \n (newline/line break) character, it breaks the rasa syntax and all previous examples disappear.

ffrose commented 3 months ago

[BUG]

when adding new intent examples it should prevent users from inserting following specific symbols: \ " # [ { a

ffrose commented 2 months ago

[BUG]

when adding new intent examples it should prevent users from inserting following specific symbols: \ " # [ { a

Problem still remains.

varmoh commented 2 months ago

@ffrose @jaX10bt Please add the updated bug information related to the GUI issues, as discussed in a call

jaX10bt commented 2 months ago

[BUG]

/training/training/intents not displaying correct intents, intent examples count and intent examples.

jaX10bt commented 1 month ago

Screenshots of logs when adding an intent example that contains double quotes (")

Router log: signal-2024-08-16-102605_002

Training module pipeline log: signal-2024-08-16-102610_002

Data mapper log: signal-2024-08-16-102615_002

joonasroosalung commented 1 month ago

The issue is with datamapper in get_intent_file.handlebars (Training-Module), escapes single quotes with {{{ }}}, but not double quotes. Hopefully won't be an issue if adding entities in examples?

dmapper         | Request: {method: POST, url: /file-manager/merge, params: {}, query: {}, body: {"array1":["jutu \"märgid\""],"array2":[]}
dmapper         | Response: {statusCode: 200, responseData: {"error":false,"message":"Merged Successfully","array":["jutu \"märgid\""]}}
ruuter          | 2024-08-21 09:37:01.704Z  INFO [,] --- [io-8080-exec-10] e.b.ruuter.domain.steps.http.HttpStep    : [        http.post] http://dmapper:3000/file-manager/merge {array1=${newExamples}, array2=${examplesToWriteIntoYml}} {
ruuter          |   "error" : false,
ruuter          |   "message" : "Merged Successfully",
ruuter          |   "array" : [ "jutu \"märgid\"" ]
ruuter          | } 200 8 Executed: mergeExamples
dmapper         | Request: {method: POST, url: /hbs/training/get_intent_file, params: {}, query: {}, body: {"intent":"123123_89","examples":["jutu \"märgid\""]}
dmapper         | err: SyntaxError: Expected ',' or '}' after property value in JSON at position 58
dmapper         |     at JSON.parse (<anonymous>)
dmapper         |     at file:///workspace/app/server.js:133:23
dmapper         |     at ExpressHandlebars.<anonymous> (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:301:25)
dmapper         |     at step (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:49:23)
dmapper         |     at Object.next (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:30:53)
dmapper         |     at fulfilled (/workspace/app/node_modules/express-handlebars/dist/express-handlebars.js:21:58)
dmapper         | Response: {statusCode: 200, responseData: {"error":"There was an error executing /workspace/app/views/training/get_intent_file.handlebars"}}
turnerrainer commented 1 month ago

Thanks for input, @jaX10bt and @joonasroosalung , @RayDNoper will take over.