Skip to content

Commit

Permalink
Remove excess data fetching on /training/common-intents page (#755)
Browse files Browse the repository at this point in the history
* Merge relevant from old branch

* Fix guard

* Fix response logic

* Fix deps

* Remove deupe code

* TODOs

* Revert unrelated changes

* Clean up

* Clean up

* Clean up

* Fix deletion

* Clean up

* Move entities

* Clean up

* Clean up

* Fix adding example

* Fix examples

* Clean up

* Clean up

* Clean up

* Fix rule

* Fix editing example

* gsa

* Clean up

* Clean up

* Clean up

* Fix the issue

* PoC without data mapping

* PoC with poor format

* PoC with better format

* Clean up

* Cle

* PoC component

* Clean up

* Fix name

* Fix query

* Fix fetch

* Revert unrelated changes

* Clean up

* Clean up

* Clean up

* Clean up

* PoC request

* Finish

* PoC common component

* Working PoC

* Extract hook

* Use hok in common

* Clean up

* Clean up

* Clean up

* Remove dupe list code

* Remove unused files
  • Loading branch information
IgorKrupenja authored Dec 13, 2024
1 parent 97bfef9 commit d22ca94
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 687 deletions.
20 changes: 0 additions & 20 deletions DSL/DMapper/hbs/get_intents_full.handlebars

This file was deleted.

15 changes: 0 additions & 15 deletions DSL/DMapper/hbs/get_intents_with_examples.handlebars

This file was deleted.

2 changes: 1 addition & 1 deletion DSL/DMapper/hbs/get_intents_with_examples_count.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{#each buckets}}
{
"id": "{{key}}",
"examples_count": {{examples_counts.value}},
"examplesCount": {{examples_counts.value}},
"inModel": {{isInModel key ../intents}},
"modifiedAt": "{{findModifiedAt key ../intents/intentsModifiedAt}}"
}{{#unless @last}},{{/unless}}
Expand Down
18 changes: 9 additions & 9 deletions DSL/OpenSearch/templates/intents-with-examples-count.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
}
},
"query": {
{{#intent}}
"wildcard": {
"intent": "*{{intent}}*"
"prefix": {
"intent": {
"value": "{{prefix}}"
}
}
{{/intent}}
{{^intent}}
"match_all": {}
{{/intent}}
}
},
"params": {
"intent": ""
"prefix": {
"type": "string",
"description": "Optional prefix to filter intents"
}
}
}
}
}
88 changes: 0 additions & 88 deletions DSL/Ruuter.private/GET/rasa/intents/common.yml

This file was deleted.

96 changes: 0 additions & 96 deletions DSL/Ruuter.private/GET/rasa/intents/full.yml

This file was deleted.

10 changes: 10 additions & 0 deletions DSL/Ruuter.private/GET/rasa/intents/with-examples-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ declaration:
- field: cookie
type: string
description: "Cookie field"
params:
- field: prefix
type: string
description: "Prefix to filter intents"

assignValues:
assign:
prefix: ${incoming.params.prefix}

getIntentsExampleCount:
call: http.post
args:
url: "[#TRAINING_OPENSEARCH]/intents/_search/template"
body:
id: "intents-with-examples-count"
params:
prefix: ${prefix || ''}
result: getIntentsResult

getDomainFile:
Expand Down
Loading

0 comments on commit d22ca94

Please sign in to comment.