feat: refactor helpers (nlu)

This commit is contained in:
Mohamed Marrouchi
2024-10-21 15:09:59 +01:00
parent b2c32fe27d
commit b7eef89981
53 changed files with 901 additions and 731 deletions

View File

@@ -10,12 +10,33 @@ import { SettingCreateDto } from '../dto/setting.dto';
import { SettingType } from '../schemas/types';
export const DEFAULT_SETTINGS = [
{
group: 'chatbot_settings',
label: 'default_nlu_helper',
value: 'core-nlu',
type: SettingType.select,
config: {
multiple: false,
allowCreate: false,
entity: 'Helper',
idKey: 'name',
labelKey: 'name',
},
weight: 1,
},
{
group: 'chatbot_settings',
label: 'global_fallback',
value: true,
type: SettingType.checkbox,
weight: 1,
weight: 3,
},
{
group: 'chatbot_settings',
label: 'global_fallback',
value: true,
type: SettingType.checkbox,
weight: 4,
},
{
group: 'chatbot_settings',
@@ -26,11 +47,11 @@ export const DEFAULT_SETTINGS = [
config: {
multiple: false,
allowCreate: false,
source: '/Block/',
valueKey: 'id',
entity: 'Block',
idKey: 'id',
labelKey: 'name',
},
weight: 2,
weight: 5,
},
{
group: 'chatbot_settings',
@@ -40,41 +61,7 @@ export const DEFAULT_SETTINGS = [
"I'm really sorry but i don't quite understand what you are saying :(",
] as string[],
type: SettingType.multiple_text,
weight: 3,
},
{
group: 'nlp_settings',
label: 'provider',
value: 'default',
options: ['default'],
type: SettingType.select,
weight: 1,
},
{
group: 'nlp_settings',
label: 'endpoint',
value: 'http://nlu-api:5000/',
type: SettingType.text,
weight: 2,
},
{
group: 'nlp_settings',
label: 'token',
value: 'token123',
type: SettingType.text,
weight: 3,
},
{
group: 'nlp_settings',
label: 'threshold',
value: 0.1,
type: SettingType.number,
config: {
min: 0,
max: 1,
step: 0.01,
},
weight: 4,
weight: 6,
},
{
group: 'contact',