code7-leia 0.2.20 → 0.2.22

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.
@@ -477,7 +477,7 @@ var enTranslation = {
477
477
  deleteFileTitle: 'Delete a file',
478
478
  deleteFile: 'Important! By deleting this file, you will lose all its information and will not be able to recover it.',
479
479
  trainingTitle: 'Presset Training',
480
- trainingDescription: 'Select one or more pressets to be trained. Note: If none are selected, Lira will train all pressets.'
480
+ trainingDescription: 'Select one or more pressets to be trained. Note: If none are selected, Le-IA will train all pressets.'
481
481
  }
482
482
  },
483
483
  buttons: {
@@ -492,6 +492,7 @@ var enTranslation = {
492
492
  testArea: {
493
493
  description: 'Type a sentence to test artificial intelligence',
494
494
  typeSentence: 'Type a sentence',
495
+ typePrompt: 'Insert a custom prompt here',
495
496
  selectPersona: 'Select a Persona',
496
497
  selectPresset: 'Select a presset',
497
498
  emptyState: {
@@ -523,17 +524,17 @@ var enTranslation = {
523
524
  Test: {
524
525
  fail: {
525
526
  title: 'Failure',
526
- description: 'Error testing Lira'
527
+ description: 'Error testing Le-IA'
527
528
  }
528
529
  },
529
530
  Train: {
530
531
  fail: {
531
532
  title: 'Failure',
532
- description: 'Error training Lira'
533
+ description: 'Error training Le-IA'
533
534
  },
534
535
  success: {
535
536
  title: 'Success',
536
- description: 'Lira is in the training process!'
537
+ description: 'Le-IA is in the training process!'
537
538
  }
538
539
  }
539
540
  }
@@ -562,7 +563,7 @@ var ptTranslation = {
562
563
  deleteFileTitle: 'Excluir um arquivo',
563
564
  deleteFile: 'Importante! Ao excluir este arquivo, você perderá todas as suas informações e não poderá recuperá-las.',
564
565
  trainingTitle: 'Treinamento de predefinição',
565
- trainingDescription: 'Selecione um ou mais predefinições para serem treinadas. Obs: Caso não selecionada nenhuma a Lira irá treinar todas as predefinições'
566
+ trainingDescription: 'Selecione um ou mais predefinições para serem treinadas. Obs: Caso não selecionada nenhuma a Le-IA irá treinar todas as predefinições'
566
567
  }
567
568
  },
568
569
  buttons: {
@@ -577,6 +578,7 @@ var ptTranslation = {
577
578
  testArea: {
578
579
  description: 'Digite uma frase para testar a inteligência artificial.',
579
580
  typeSentence: 'Digite uma frase',
581
+ typePrompt: 'Insira aqui um prompt personalizado',
580
582
  selectPersona: 'Selecione uma Persona',
581
583
  selectPresset: 'Selecione uma predefinição',
582
584
  emptyState: {
@@ -608,17 +610,17 @@ var ptTranslation = {
608
610
  Test: {
609
611
  fail: {
610
612
  title: 'Falha',
611
- description: 'Erro ao testar Lira'
613
+ description: 'Erro ao testar Le-IA'
612
614
  }
613
615
  },
614
616
  Train: {
615
617
  fail: {
616
618
  title: 'Falha',
617
- description: 'Erro ao treinar a Lira'
619
+ description: 'Erro ao treinar a Le-IA'
618
620
  },
619
621
  success: {
620
622
  title: 'Sucesso',
621
- description: 'A Lira está em processo de treinamento!'
623
+ description: 'A Le-IA está em processo de treinamento!'
622
624
  }
623
625
  }
624
626
  }
@@ -647,7 +649,7 @@ var esTranslation = {
647
649
  deleteFileTitle: 'Eliminar un archivo',
648
650
  deleteFile: '¡Importante! Al eliminar este archivo, perderá toda su información y no podrá recuperarla.',
649
651
  trainingTitle: 'Entrenamiento de preconfiguración',
650
- trainingDescription: 'Seleccione una o más preconfiguracións para ser entrenadas. Nota: Si no se selecciona ninguna, Lira entrenará todas las preconfiguracións.'
652
+ trainingDescription: 'Seleccione una o más preconfiguracións para ser entrenadas. Nota: Si no se selecciona ninguna, Le-IA entrenará todas las preconfiguracións.'
651
653
  }
652
654
  },
653
655
  buttons: {
@@ -662,6 +664,7 @@ var esTranslation = {
662
664
  testArea: {
663
665
  description: 'Escribe una frase para probar la inteligencia artificial.',
664
666
  typeSentence: 'Escribe una oración',
667
+ typePrompt: 'Inserte un prompt personalizado aquí',
665
668
  selectPersona: 'Seleccionar una Persona',
666
669
  selectPresset: 'Seleccionar una preconfiguración',
667
670
  emptyState: {
@@ -693,17 +696,17 @@ var esTranslation = {
693
696
  Test: {
694
697
  fail: {
695
698
  title: 'Error',
696
- description: 'Error al probar Lira'
699
+ description: 'Error al probar Le-IA'
697
700
  }
698
701
  },
699
702
  Train: {
700
703
  fail: {
701
704
  title: 'Error',
702
- description: 'Error al entrenar Lira'
705
+ description: 'Error al entrenar Le-IA'
703
706
  },
704
707
  success: {
705
708
  title: 'Éxito',
706
- description: '¡Lira está en proceso de entrenamiento!'
709
+ description: '¡Le-IA está en proceso de entrenamiento!'
707
710
  }
708
711
  }
709
712
  }
@@ -1346,12 +1349,13 @@ var Types = {
1346
1349
  NETWORK_OFFLINE: 'NETWORK_OFFLINE'
1347
1350
  };
1348
1351
 
1349
- var getFilesAction = function getFilesAction(id, token) {
1352
+ var getFilesAction = function getFilesAction(id, token, env) {
1350
1353
  return {
1351
1354
  type: Types.GET_FILES_REQUEST,
1352
1355
  payload: {
1353
1356
  id: id,
1354
- token: token
1357
+ token: token,
1358
+ env: env
1355
1359
  }
1356
1360
  };
1357
1361
  };
@@ -1364,14 +1368,15 @@ var getFilesActionSuccess = function getFilesActionSuccess(_ref) {
1364
1368
  }
1365
1369
  };
1366
1370
  };
1367
- var deleteFilesAction = function deleteFilesAction(name, id, language, token) {
1371
+ var deleteFilesAction = function deleteFilesAction(name, id, language, token, env) {
1368
1372
  return {
1369
1373
  type: Types.DELETE_FILES_REQUEST,
1370
1374
  payload: {
1371
1375
  name: name,
1372
1376
  id: id,
1373
1377
  language: language,
1374
- token: token
1378
+ token: token,
1379
+ env: env
1375
1380
  }
1376
1381
  };
1377
1382
  };
@@ -1384,7 +1389,7 @@ var deleteFilesActionSuccess = function deleteFilesActionSuccess(_ref2) {
1384
1389
  }
1385
1390
  };
1386
1391
  };
1387
- var uploadFilesAction = function uploadFilesAction(file, id, pressets, language, token) {
1392
+ var uploadFilesAction = function uploadFilesAction(file, id, pressets, language, token, env) {
1388
1393
  return {
1389
1394
  type: Types.UPLOAD_FILES_REQUEST,
1390
1395
  payload: {
@@ -1392,7 +1397,8 @@ var uploadFilesAction = function uploadFilesAction(file, id, pressets, language,
1392
1397
  id: id,
1393
1398
  pressets: pressets,
1394
1399
  language: language,
1395
- token: token
1400
+ token: token,
1401
+ env: env
1396
1402
  }
1397
1403
  };
1398
1404
  };
@@ -1405,26 +1411,29 @@ var uploadFilesActionSuccess = function uploadFilesActionSuccess(_ref3) {
1405
1411
  }
1406
1412
  };
1407
1413
  };
1408
- var trainingAction = function trainingAction(id, pressets, language, token) {
1414
+ var trainingAction = function trainingAction(id, pressets, language, token, env) {
1409
1415
  return {
1410
1416
  type: Types.TRAINING_REQUEST,
1411
1417
  payload: {
1412
1418
  id: id,
1413
1419
  pressets: pressets,
1414
1420
  language: language,
1415
- token: token
1421
+ token: token,
1422
+ env: env
1416
1423
  }
1417
1424
  };
1418
1425
  };
1419
- var testAction = function testAction(question, profile, presset, files_directory, token) {
1426
+ var testAction = function testAction(question, prompt, profile, presset, files_directory, token, env) {
1420
1427
  return {
1421
1428
  type: Types.TEST_REQUEST,
1422
1429
  payload: {
1423
1430
  question: question,
1431
+ prompt: prompt,
1424
1432
  profile: profile,
1425
1433
  presset: presset,
1426
1434
  files_directory: files_directory,
1427
- token: token
1435
+ token: token,
1436
+ env: env
1428
1437
  }
1429
1438
  };
1430
1439
  };
@@ -1453,7 +1462,8 @@ var FileArea = function FileArea() {
1453
1462
  id = _useSharedProps.id,
1454
1463
  language = _useSharedProps.language,
1455
1464
  propTags = _useSharedProps.propTags,
1456
- token = _useSharedProps.token;
1465
+ token = _useSharedProps.token,
1466
+ env = _useSharedProps.env;
1457
1467
  var _useState = React.useState([]),
1458
1468
  files = _useState[0],
1459
1469
  setFiles = _useState[1];
@@ -1491,7 +1501,7 @@ var FileArea = function FileArea() {
1491
1501
  });
1492
1502
  var tags = propTags ? propTags.tags : [];
1493
1503
  React.useEffect(function () {
1494
- dispatch(getFilesAction(id, token));
1504
+ dispatch(getFilesAction(id, token, env));
1495
1505
  }, [id]);
1496
1506
  React.useEffect(function () {
1497
1507
  if (tags.length > 0) {
@@ -1556,17 +1566,17 @@ var FileArea = function FileArea() {
1556
1566
  setModalTraining(!modalTraining);
1557
1567
  };
1558
1568
  var deleteFile = function deleteFile() {
1559
- dispatch(deleteFilesAction(fileDelete, id, language, token));
1569
+ dispatch(deleteFilesAction(fileDelete, id, language, token, env));
1560
1570
  setModalDelete(false);
1561
1571
  };
1562
1572
  var handleUploadFile = function handleUploadFile() {
1563
- dispatch(uploadFilesAction(uploadFile, id, presset, language, token));
1573
+ dispatch(uploadFilesAction(uploadFile, id, presset, language, token, env));
1564
1574
  setModal(false);
1565
1575
  setUploadFile(undefined);
1566
1576
  setPresset([]);
1567
1577
  };
1568
1578
  var handleTrain = function handleTrain() {
1569
- dispatch(trainingAction(id, presset, language, token));
1579
+ dispatch(trainingAction(id, presset, language, token, env));
1570
1580
  setModalTraining(false);
1571
1581
  setPresset([]);
1572
1582
  };
@@ -1749,6 +1759,7 @@ var FileArea = function FileArea() {
1749
1759
  id: id,
1750
1760
  language: language,
1751
1761
  token: token,
1762
+ env: env,
1752
1763
  propTags: {
1753
1764
  tags: []
1754
1765
  },
@@ -1828,13 +1839,83 @@ var InputTest = function InputTest(_ref) {
1828
1839
  }));
1829
1840
  };
1830
1841
 
1842
+ var _templateObject$c, _templateObject2$8, _templateObject3$6, _templateObject4$3, _templateObject5$3, _templateObject6$2;
1843
+ var Container$6 = /*#__PURE__*/styled__default.div(_templateObject$c || (_templateObject$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-flow: column;\n margin-bottom: ", ";\n"])), function (_ref) {
1844
+ var marginBottom = _ref.marginBottom;
1845
+ return marginBottom;
1846
+ });
1847
+ var InputWrapper = /*#__PURE__*/styled__default.div(_templateObject2$8 || (_templateObject2$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n position: relative;\n\n .icon {\n position: absolute;\n color: #5a5d68;\n\n &.start-icon {\n left: 12px;\n }\n &.end-icon {\n right: 12px;\n }\n }\n\n & .pass-view {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n padding: 14px;\n font-size: 1rem;\n color: #5a5d68;\n }\n"])));
1848
+ var LabelWrapper = /*#__PURE__*/styled__default.label(_templateObject3$6 || (_templateObject3$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 8px;\n\n .label {\n display: block;\n color: #5a5d68;\n\n font-style: normal;\n font-weight: 600;\n font-size: 0.875rem;\n line-height: 114%;\n letter-spacing: -0.02em;\n }\n\n .description {\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n color: #5a5d68;\n display: block;\n }\n"])));
1849
+ var CustomTextArea = /*#__PURE__*/styled__default.textarea(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Monospace', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 0.875rem;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n letter-spacing: -0.02em;\n resize: vertical;\n padding: 8px 12px;\n\n border-radius: 4px;\n border: 1px solid #979aa5;\n color: #5a5d68 !important;\n width: 100%;\n\n background: #ffffff;\n transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out,\n border 0.2s ease-in-out;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 3px #6690ff;\n }\n\n &:hover {\n border: 1px solid #102693;\n }\n &:active {\n border: 1px solid #102693;\n }\n &:disabled {\n border: 1px solid #dadce3;\n background: #f3f5f9;\n color: #dadce3;\n }\n\n &.small {\n min-height: 32px;\n }\n\n &.medium {\n min-height: 40px;\n }\n\n &.large {\n min-height: 48px;\n font-size: 1rem;\n }\n\n &.success {\n background: #e3f8cc;\n border: 1px solid #19660a;\n color: #19660a;\n }\n\n &.danger {\n background: #fae0d2;\n border: 1px solid #871821;\n color: #871821;\n }\n\n &.error {\n background: #fae0d2;\n border: 1px solid #871821;\n color: #871821;\n }\n\n &.has-start-icon {\n padding-left: 40px;\n }\n &.has-end-icon {\n padding-right: 40px;\n }\n"])));
1850
+ var Helper = /*#__PURE__*/styled__default.div(_templateObject5$3 || (_templateObject5$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &.helper {\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n color: #5a5d68;\n display: block;\n margin-top: 4px;\n\n &.success {\n color: #19660a;\n }\n\n &.danger {\n color: #871821;\n }\n }\n"])));
1851
+ var Error$1 = /*#__PURE__*/styled__default.div(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: 500;\n font-size: 0.625rem;\n line-height: 120%;\n display: block;\n margin-top: 4px;\n color: #871821;\n"])));
1852
+
1853
+ var _excluded$6 = ["id", "label", "description", "helper", "error", "placeholder", "className", "size", "color", "disabled", "startIcon", "endIcon", "marginBottom", "rows"];
1854
+ var TextArea = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1855
+ var id = _ref.id,
1856
+ label = _ref.label,
1857
+ description = _ref.description,
1858
+ helper = _ref.helper,
1859
+ error = _ref.error,
1860
+ placeholder = _ref.placeholder,
1861
+ className = _ref.className,
1862
+ _ref$size = _ref.size,
1863
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
1864
+ _ref$color = _ref.color,
1865
+ color = _ref$color === void 0 ? '' : _ref$color,
1866
+ _ref$disabled = _ref.disabled,
1867
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1868
+ startIcon = _ref.startIcon,
1869
+ endIcon = _ref.endIcon,
1870
+ _ref$marginBottom = _ref.marginBottom,
1871
+ marginBottom = _ref$marginBottom === void 0 ? '3px' : _ref$marginBottom,
1872
+ _ref$rows = _ref.rows,
1873
+ rows = _ref$rows === void 0 ? 4 : _ref$rows,
1874
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
1875
+ var selfId = id || "input__" + Math.random().toString(36).substr(2, 9);
1876
+ return React__default.createElement(Container$6, {
1877
+ className: className,
1878
+ marginBottom: marginBottom
1879
+ }, label && React__default.createElement(LabelWrapper, {
1880
+ htmlFor: selfId
1881
+ }, React__default.createElement("span", {
1882
+ className: "label"
1883
+ }, label), description && React__default.createElement("span", {
1884
+ className: "description"
1885
+ }, description)), React__default.createElement(InputWrapper, {
1886
+ className: cc({
1887
+ hasLabel: Boolean(label)
1888
+ })
1889
+ }, React__default.createElement(CustomTextArea, Object.assign({
1890
+ className: cc(['input', size, color, {
1891
+ error: Boolean(error),
1892
+ 'has-start-icon': Boolean(startIcon),
1893
+ 'has-end-icon': Boolean(endIcon)
1894
+ }]),
1895
+ id: selfId,
1896
+ placeholder: placeholder,
1897
+ disabled: disabled,
1898
+ rows: rows,
1899
+ ref: ref
1900
+ }, props)), startIcon && React__default.createElement("span", {
1901
+ className: cc(['icon', 'start-icon'])
1902
+ }, startIcon), endIcon && React__default.createElement("span", {
1903
+ className: cc(['icon', 'end-icon'])
1904
+ }, endIcon)), helper && React__default.createElement(Helper, {
1905
+ className: cc(['helper', color])
1906
+ }, helper), error && React__default.createElement(Error$1, {
1907
+ className: cc(['error'])
1908
+ }, error));
1909
+ });
1910
+
1831
1911
  var TestArea = function TestArea() {
1832
1912
  var _useSharedProps = useSharedProps(),
1833
1913
  id = _useSharedProps.id,
1834
1914
  language = _useSharedProps.language,
1835
1915
  personas = _useSharedProps.personas,
1836
1916
  propTags = _useSharedProps.propTags,
1837
- token = _useSharedProps.token;
1917
+ token = _useSharedProps.token,
1918
+ env = _useSharedProps.env;
1838
1919
  var t = getLanguage(language);
1839
1920
  var results = reactRedux.useSelector(function (state) {
1840
1921
  return state.message;
@@ -1846,11 +1927,14 @@ var TestArea = function TestArea() {
1846
1927
  search = _useState[0],
1847
1928
  setSearch = _useState[1];
1848
1929
  var _useState2 = React.useState(''),
1849
- profile = _useState2[0],
1850
- setProfile = _useState2[1];
1930
+ prompt = _useState2[0],
1931
+ setPrompt = _useState2[1];
1851
1932
  var _useState3 = React.useState(''),
1852
- presset = _useState3[0],
1853
- setPresset = _useState3[1];
1933
+ profile = _useState3[0],
1934
+ setProfile = _useState3[1];
1935
+ var _useState4 = React.useState(''),
1936
+ presset = _useState4[0],
1937
+ setPresset = _useState4[1];
1854
1938
  var dispatch = reactRedux.useDispatch();
1855
1939
  var tags = propTags ? propTags.tags : [];
1856
1940
  var optionsPersona = personas && personas.map(function (persona) {
@@ -1874,8 +1958,11 @@ var TestArea = function TestArea() {
1874
1958
  var handleSearch = function handleSearch(value) {
1875
1959
  setSearch(value);
1876
1960
  };
1961
+ var handlePrompt = function handlePrompt(value) {
1962
+ setPrompt(value);
1963
+ };
1877
1964
  var handleTest = function handleTest() {
1878
- dispatch(testAction(search, profile, presset, id, token));
1965
+ dispatch(testAction(search, prompt, profile, presset, id, token, env));
1879
1966
  };
1880
1967
  var returnTest = function returnTest() {
1881
1968
  return React__default.createElement(Container$3, {
@@ -1891,6 +1978,14 @@ var TestArea = function TestArea() {
1891
1978
  placeholder: t.testArea.selectPersona,
1892
1979
  options: optionsPersona,
1893
1980
  onSelect: handleSelectPersona
1981
+ }), profile === "Custom" && React__default.createElement(TextArea, {
1982
+ className: "textarea-message",
1983
+ label: "Prompt",
1984
+ placeholder: t.testArea.typePrompt,
1985
+ value: prompt,
1986
+ onChange: function onChange(e) {
1987
+ handlePrompt(e.target.value);
1988
+ }
1894
1989
  }), React__default.createElement(CustomSelect, {
1895
1990
  placeholder: t.testArea.selectPresset,
1896
1991
  options: optionsPresset,
@@ -1912,6 +2007,7 @@ var TestArea = function TestArea() {
1912
2007
  id: id,
1913
2008
  token: token,
1914
2009
  language: language,
2010
+ env: env,
1915
2011
  propTags: {
1916
2012
  tags: []
1917
2013
  },
@@ -1935,6 +2031,7 @@ var Leia = function Leia(props) {
1935
2031
  propTags: {
1936
2032
  tags: []
1937
2033
  },
2034
+ env: '',
1938
2035
  personas: [{
1939
2036
  name: '',
1940
2037
  description: ''
@@ -2009,6 +2106,10 @@ function filesReducer(state, action) {
2009
2106
  });
2010
2107
  }
2011
2108
 
2109
+ var url$1 = 'http://localhost:5000';
2110
+ axios.defaults.baseURL = "" + url$1;
2111
+ var apiHml = /*#__PURE__*/axios.create();
2112
+
2012
2113
  var CustomToastContent = function CustomToastContent(_ref) {
2013
2114
  var title = _ref.title,
2014
2115
  description = _ref.description;
@@ -2062,7 +2163,7 @@ var _marked = /*#__PURE__*/_regeneratorRuntime().mark(getFilesSaga),
2062
2163
  _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(TrainingSaga),
2063
2164
  _marked6 = /*#__PURE__*/_regeneratorRuntime().mark(filesSagas);
2064
2165
  function getFilesSaga(action) {
2065
- var _action$payload, id, token, _yield$call, data;
2166
+ var _action$payload, id, token, env, _yield$call, data;
2066
2167
  return _regeneratorRuntime().wrap(function getFilesSaga$(_context) {
2067
2168
  while (1) switch (_context.prev = _context.next) {
2068
2169
  case 0:
@@ -2070,9 +2171,9 @@ function getFilesSaga(action) {
2070
2171
  _context.next = 3;
2071
2172
  return effects.put(commonLoadingStart());
2072
2173
  case 3:
2073
- _action$payload = action.payload, id = _action$payload.id, token = _action$payload.token;
2174
+ _action$payload = action.payload, id = _action$payload.id, token = _action$payload.token, env = _action$payload.env;
2074
2175
  _context.next = 6;
2075
- return effects.call(api.get, "/training/" + id + "?token=" + token);
2176
+ return effects.call(env.toLowerCase() === 'prod' ? api.get : apiHml.get, "/training/" + id + "?token=" + token);
2076
2177
  case 6:
2077
2178
  _yield$call = _context.sent;
2078
2179
  data = _yield$call.data;
@@ -2100,7 +2201,7 @@ function getFilesSaga(action) {
2100
2201
  }, _marked, null, [[0, 12, 15, 19]]);
2101
2202
  }
2102
2203
  function deleteFilesSaga(action) {
2103
- var t, _action$payload2, id, name, token, _yield$call2, data;
2204
+ var t, _action$payload2, id, name, token, env, _yield$call2, data;
2104
2205
  return _regeneratorRuntime().wrap(function deleteFilesSaga$(_context2) {
2105
2206
  while (1) switch (_context2.prev = _context2.next) {
2106
2207
  case 0:
@@ -2109,12 +2210,12 @@ function deleteFilesSaga(action) {
2109
2210
  _context2.next = 4;
2110
2211
  return effects.put(commonLoadingStart());
2111
2212
  case 4:
2112
- _action$payload2 = action.payload, id = _action$payload2.id, name = _action$payload2.name, token = _action$payload2.token;
2213
+ _action$payload2 = action.payload, id = _action$payload2.id, name = _action$payload2.name, token = _action$payload2.token, env = _action$payload2.env;
2113
2214
  _context2.next = 7;
2114
- return effects.call(api["delete"], "/delete/" + id + "/" + name + "?token=" + token);
2215
+ return effects.call(env.toLowerCase() === 'prod' ? api["delete"] : apiHml["delete"], "/delete/" + id + "/" + name + "?token=" + token);
2115
2216
  case 7:
2116
2217
  _context2.next = 9;
2117
- return effects.call(api.get, "/training/" + id + "?token=" + token);
2218
+ return effects.call(env.toLowerCase() === 'prod' ? api.get : apiHml.get, "/training/" + id + "?token=" + token);
2118
2219
  case 9:
2119
2220
  _yield$call2 = _context2.sent;
2120
2221
  data = _yield$call2.data;
@@ -2147,7 +2248,7 @@ function deleteFilesSaga(action) {
2147
2248
  }, _marked2, null, [[1, 15, 19, 23]]);
2148
2249
  }
2149
2250
  function testSaga(action) {
2150
- var _action$payload3, question, profile, presset, files_directory, token, _yield$call3, data;
2251
+ var _action$payload3, question, prompt, profile, presset, files_directory, token, env, _yield$call3, data;
2151
2252
  return _regeneratorRuntime().wrap(function testSaga$(_context3) {
2152
2253
  while (1) switch (_context3.prev = _context3.next) {
2153
2254
  case 0:
@@ -2155,10 +2256,11 @@ function testSaga(action) {
2155
2256
  _context3.next = 3;
2156
2257
  return effects.put(commonLoadingStart());
2157
2258
  case 3:
2158
- _action$payload3 = action.payload, question = _action$payload3.question, profile = _action$payload3.profile, presset = _action$payload3.presset, files_directory = _action$payload3.files_directory, token = _action$payload3.token;
2259
+ _action$payload3 = action.payload, question = _action$payload3.question, prompt = _action$payload3.prompt, profile = _action$payload3.profile, presset = _action$payload3.presset, files_directory = _action$payload3.files_directory, token = _action$payload3.token, env = _action$payload3.env;
2159
2260
  _context3.next = 6;
2160
- return effects.call(api.post, "/ask", {
2261
+ return effects.call(env.toLowerCase() === 'prod' ? api.post : apiHml.post, "/ask", {
2161
2262
  question: question,
2263
+ description: prompt,
2162
2264
  profile: profile,
2163
2265
  tag: presset,
2164
2266
  files_directory: files_directory,
@@ -2191,7 +2293,7 @@ function testSaga(action) {
2191
2293
  }, _marked3, null, [[0, 12, 15, 19]]);
2192
2294
  }
2193
2295
  function uploadFilesSaga(action) {
2194
- var t, _action$payload4, id, file, pressets, token, blob, formData, sanitizedPath, queryParams, url, _yield$call4, data;
2296
+ var t, _action$payload4, id, file, pressets, token, env, blob, formData, sanitizedPath, queryParams, url, _yield$call4, data;
2195
2297
  return _regeneratorRuntime().wrap(function uploadFilesSaga$(_context4) {
2196
2298
  while (1) switch (_context4.prev = _context4.next) {
2197
2299
  case 0:
@@ -2200,24 +2302,24 @@ function uploadFilesSaga(action) {
2200
2302
  _context4.next = 4;
2201
2303
  return effects.put(commonLoadingStart());
2202
2304
  case 4:
2203
- _action$payload4 = action.payload, id = _action$payload4.id, file = _action$payload4.file, pressets = _action$payload4.pressets, token = _action$payload4.token;
2305
+ _action$payload4 = action.payload, id = _action$payload4.id, file = _action$payload4.file, pressets = _action$payload4.pressets, token = _action$payload4.token, env = _action$payload4.env;
2204
2306
  blob = new Blob([file.content]);
2205
2307
  formData = new FormData();
2206
- sanitizedPath = file.properties.path.replace(/^(\.\/|\/+)|\/+$/g, '');
2308
+ sanitizedPath = file.properties.path.replace(/^\/+|\/+$/g, '');
2207
2309
  formData.append('file', blob, sanitizedPath || 'default_filename');
2208
2310
  queryParams = pressets.length ? new URLSearchParams({
2209
2311
  tags: pressets.join(',')
2210
2312
  }).toString() : '';
2211
2313
  url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
2212
2314
  _context4.next = 13;
2213
- return effects.call(api.post, url, formData, {
2315
+ return effects.call(env.toLowerCase() === 'prod' ? api.post : apiHml.post, url, formData, {
2214
2316
  headers: {
2215
2317
  'Content-Type': 'multipart/form-data'
2216
2318
  }
2217
2319
  });
2218
2320
  case 13:
2219
2321
  _context4.next = 15;
2220
- return effects.call(api.get, "/training/" + id + "?token=" + token);
2322
+ return effects.call(env.toLowerCase() === 'prod' ? api.get : apiHml.get, "/training/" + id + "?token=" + token);
2221
2323
  case 15:
2222
2324
  _yield$call4 = _context4.sent;
2223
2325
  data = _yield$call4.data;
@@ -2249,7 +2351,7 @@ function uploadFilesSaga(action) {
2249
2351
  }, _marked4, null, [[1, 21, 25, 29]]);
2250
2352
  }
2251
2353
  function TrainingSaga(action) {
2252
- var t, _action$payload5, id, pressets, token, tag, queryParams, _yield$call5, data;
2354
+ var t, _action$payload5, id, pressets, token, env, tag, queryParams, _yield$call5, data;
2253
2355
  return _regeneratorRuntime().wrap(function TrainingSaga$(_context5) {
2254
2356
  while (1) switch (_context5.prev = _context5.next) {
2255
2357
  case 0:
@@ -2258,19 +2360,19 @@ function TrainingSaga(action) {
2258
2360
  _context5.next = 4;
2259
2361
  return effects.put(commonLoadingStart());
2260
2362
  case 4:
2261
- _action$payload5 = action.payload, id = _action$payload5.id, pressets = _action$payload5.pressets, token = _action$payload5.token;
2363
+ _action$payload5 = action.payload, id = _action$payload5.id, pressets = _action$payload5.pressets, token = _action$payload5.token, env = _action$payload5.env;
2262
2364
  tag = pressets.join(',');
2263
2365
  queryParams = new URLSearchParams({
2264
2366
  tag: tag
2265
2367
  }).toString();
2266
2368
  _context5.next = 9;
2267
- return effects.call(api.post, pressets.length > 0 ? "/training?" + queryParams : "/training", {
2369
+ return effects.call(env.toLowerCase() === 'prod' ? api.post : apiHml.post, pressets.length > 0 ? "/training?" + queryParams : "/training", {
2268
2370
  files_directory: id,
2269
2371
  token: token
2270
2372
  });
2271
2373
  case 9:
2272
2374
  _context5.next = 11;
2273
- return effects.call(api.get, "/training/" + id + "?token=" + token);
2375
+ return effects.call(env.toLowerCase() === 'prod' ? api.get : apiHml.get, "/training/" + id + "?token=" + token);
2274
2376
  case 11:
2275
2377
  _yield$call5 = _context5.sent;
2276
2378
  data = _yield$call5.data;