graphdb-workbench 3.2.0-TR2 → 3.2.0-TR3

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.
Files changed (220) hide show
  1. package/dist/12358.4be185f89eebea9c35bf.bundle.js +3 -0
  2. package/dist/12358.4be185f89eebea9c35bf.bundle.js.map +1 -0
  3. package/dist/{12396.9a7f2862146b6f9adcb1.bundle.js → 12396.07e90b6c97623a9fd754.bundle.js} +2 -2
  4. package/dist/{12396.9a7f2862146b6f9adcb1.bundle.js.map → 12396.07e90b6c97623a9fd754.bundle.js.map} +1 -1
  5. package/dist/{15535.7b170e17ee0a58970ab6.bundle.js → 15535.12490e9b6d305e7bd827.bundle.js} +2 -2
  6. package/dist/{15535.7b170e17ee0a58970ab6.bundle.js.map → 15535.12490e9b6d305e7bd827.bundle.js.map} +1 -1
  7. package/dist/{16162.67e7c1f5f313481b1e80.bundle.js → 16162.58804ed92b5b3ae97510.bundle.js} +2 -2
  8. package/dist/{16162.67e7c1f5f313481b1e80.bundle.js.map → 16162.58804ed92b5b3ae97510.bundle.js.map} +1 -1
  9. package/dist/19402.7f6ea977348338acc824.bundle.js +2 -0
  10. package/dist/19402.7f6ea977348338acc824.bundle.js.map +1 -0
  11. package/dist/{20287.dd5bc263fe26adf34965.bundle.js → 20287.3ce3542c50f41b8b85a3.bundle.js} +2 -2
  12. package/dist/{20287.dd5bc263fe26adf34965.bundle.js.map → 20287.3ce3542c50f41b8b85a3.bundle.js.map} +1 -1
  13. package/dist/{21136.b7efcb40fb956ff1109c.bundle.js → 21136.c6d780b6f550c0df2d2a.bundle.js} +2 -2
  14. package/dist/{21136.b7efcb40fb956ff1109c.bundle.js.map → 21136.c6d780b6f550c0df2d2a.bundle.js.map} +1 -1
  15. package/dist/21142.b48a4c497617cb2df01f.bundle.js +2 -0
  16. package/dist/21142.b48a4c497617cb2df01f.bundle.js.map +1 -0
  17. package/dist/{21170.7832554eab9eaade6ffb.bundle.js → 21170.6079e1b218a1eea085f5.bundle.js} +2 -2
  18. package/dist/{21170.7832554eab9eaade6ffb.bundle.js.map → 21170.6079e1b218a1eea085f5.bundle.js.map} +1 -1
  19. package/dist/21195.152b932628044855ef83.bundle.js +2 -0
  20. package/dist/21195.152b932628044855ef83.bundle.js.map +1 -0
  21. package/dist/{25747.c01110e23b922cdd3d9e.bundle.js → 25747.117e03f9f9ae52f13606.bundle.js} +2 -2
  22. package/dist/{25747.c01110e23b922cdd3d9e.bundle.js.map → 25747.117e03f9f9ae52f13606.bundle.js.map} +1 -1
  23. package/dist/{27580.5a421770ab66d2dedc37.bundle.js → 27580.dc966117bc0ee9eecd70.bundle.js} +2 -2
  24. package/dist/{27580.5a421770ab66d2dedc37.bundle.js.map → 27580.dc966117bc0ee9eecd70.bundle.js.map} +1 -1
  25. package/dist/29350.d2791feedf54d2e4b7b6.bundle.js +2 -0
  26. package/dist/29350.d2791feedf54d2e4b7b6.bundle.js.map +1 -0
  27. package/dist/{31636.54e2817f8ae3998a34b3.bundle.js → 31636.95fa5e5c2a521d1effd5.bundle.js} +2 -2
  28. package/dist/{31636.54e2817f8ae3998a34b3.bundle.js.map → 31636.95fa5e5c2a521d1effd5.bundle.js.map} +1 -1
  29. package/dist/{32489.f7a2dc39cd61c2cd8874.bundle.js → 32489.c5d26d5023f0e0583408.bundle.js} +2 -2
  30. package/dist/{32489.f7a2dc39cd61c2cd8874.bundle.js.map → 32489.c5d26d5023f0e0583408.bundle.js.map} +1 -1
  31. package/dist/{34495.be67c06c39909114bbe4.bundle.js → 34495.2a7b45477194d52af3e5.bundle.js} +2 -2
  32. package/dist/{34495.be67c06c39909114bbe4.bundle.js.map → 34495.2a7b45477194d52af3e5.bundle.js.map} +1 -1
  33. package/dist/36633.eba4270db7fdcf1aad4c.bundle.js +2 -0
  34. package/dist/36633.eba4270db7fdcf1aad4c.bundle.js.map +1 -0
  35. package/dist/36665.19388ed0db6a1d64ad65.bundle.js +2 -0
  36. package/dist/36665.19388ed0db6a1d64ad65.bundle.js.map +1 -0
  37. package/dist/{38360.efec913bb97c3b8588a4.bundle.js → 38360.23a88f346d3a1d92dbb1.bundle.js} +2 -2
  38. package/dist/{38360.efec913bb97c3b8588a4.bundle.js.map → 38360.23a88f346d3a1d92dbb1.bundle.js.map} +1 -1
  39. package/dist/{38644.800252af49cd67310834.bundle.js → 38644.6682aa9acc813134b85a.bundle.js} +2 -2
  40. package/dist/{38644.800252af49cd67310834.bundle.js.map → 38644.6682aa9acc813134b85a.bundle.js.map} +1 -1
  41. package/dist/{38843.29e34a5e5293cee51566.bundle.js → 38843.7cf0aca4cc512c447e29.bundle.js} +2 -2
  42. package/dist/{38843.29e34a5e5293cee51566.bundle.js.map → 38843.7cf0aca4cc512c447e29.bundle.js.map} +1 -1
  43. package/dist/{39518.0ca97879b92271d7c5e2.bundle.js → 39518.cbb394dbd1fb5c717e82.bundle.js} +2 -2
  44. package/dist/{39518.0ca97879b92271d7c5e2.bundle.js.map → 39518.cbb394dbd1fb5c717e82.bundle.js.map} +1 -1
  45. package/dist/{39539.7cea6717cc3a5ba91617.bundle.js → 39539.63178d205aa9af450438.bundle.js} +2 -2
  46. package/dist/{39539.7cea6717cc3a5ba91617.bundle.js.map → 39539.63178d205aa9af450438.bundle.js.map} +1 -1
  47. package/dist/40516.3cfaf1ff4704c038f944.bundle.js +2 -0
  48. package/dist/40516.3cfaf1ff4704c038f944.bundle.js.map +1 -0
  49. package/dist/{41453.4ae219d972a187c36bfc.bundle.js → 41453.3a71e125d59ca56c3e48.bundle.js} +2 -2
  50. package/dist/{41453.4ae219d972a187c36bfc.bundle.js.map → 41453.3a71e125d59ca56c3e48.bundle.js.map} +1 -1
  51. package/dist/{42129.0314e45b4b818b01b71f.bundle.js → 42129.6bbb7e9d5f3be5d0cb47.bundle.js} +2 -2
  52. package/dist/{42129.0314e45b4b818b01b71f.bundle.js.map → 42129.6bbb7e9d5f3be5d0cb47.bundle.js.map} +1 -1
  53. package/dist/{44444.02026ff20e2a843dc05b.bundle.js → 44444.f65e3b550875b4b6e1a8.bundle.js} +2 -2
  54. package/dist/{44444.02026ff20e2a843dc05b.bundle.js.map → 44444.f65e3b550875b4b6e1a8.bundle.js.map} +1 -1
  55. package/dist/44874.b16be286176dfe4aa766.bundle.js +2 -0
  56. package/dist/44874.b16be286176dfe4aa766.bundle.js.map +1 -0
  57. package/dist/49539.63984d5b37bc8b9a7244.bundle.js +2 -0
  58. package/dist/49539.63984d5b37bc8b9a7244.bundle.js.map +1 -0
  59. package/dist/{51087.b072d1c0e53403535283.bundle.js → 51087.1e118e7fe32a8c09d6cb.bundle.js} +2 -2
  60. package/dist/51087.1e118e7fe32a8c09d6cb.bundle.js.map +1 -0
  61. package/dist/{55862.5e8602827fbf72e60cc2.bundle.js → 55862.81278272f7885ce93baf.bundle.js} +2 -2
  62. package/dist/{55862.5e8602827fbf72e60cc2.bundle.js.map → 55862.81278272f7885ce93baf.bundle.js.map} +1 -1
  63. package/dist/{58306.94b9336f68d11bdd72f0.bundle.js → 58306.061bfe57a80e266022a1.bundle.js} +2 -2
  64. package/dist/{58306.94b9336f68d11bdd72f0.bundle.js.map → 58306.061bfe57a80e266022a1.bundle.js.map} +1 -1
  65. package/dist/60039.5f9e955234f5eaf33372.bundle.js +2 -0
  66. package/dist/60039.5f9e955234f5eaf33372.bundle.js.map +1 -0
  67. package/dist/63415.7a4dfa072b5665c5995b.bundle.js +2 -0
  68. package/dist/63415.7a4dfa072b5665c5995b.bundle.js.map +1 -0
  69. package/dist/64118.edc8ed6671017d09ff4e.bundle.js +2 -0
  70. package/dist/64118.edc8ed6671017d09ff4e.bundle.js.map +1 -0
  71. package/dist/{67888.772326168aed83cbad9c.bundle.js → 67888.6a4fedd47a2764fdb04b.bundle.js} +2 -2
  72. package/dist/{67888.772326168aed83cbad9c.bundle.js.map → 67888.6a4fedd47a2764fdb04b.bundle.js.map} +1 -1
  73. package/dist/71920.c171884910616d02e2c6.bundle.js +2 -0
  74. package/dist/71920.c171884910616d02e2c6.bundle.js.map +1 -0
  75. package/dist/{72379.8a3290df05f18f8c65bd.bundle.js → 72379.d82f665d3a8b231008a3.bundle.js} +2 -2
  76. package/dist/{72379.8a3290df05f18f8c65bd.bundle.js.map → 72379.d82f665d3a8b231008a3.bundle.js.map} +1 -1
  77. package/dist/{73667.52fdbdadddafe9e9559b.bundle.js → 73667.5a32fae13853f9158d8b.bundle.js} +2 -2
  78. package/dist/{73667.52fdbdadddafe9e9559b.bundle.js.map → 73667.5a32fae13853f9158d8b.bundle.js.map} +1 -1
  79. package/dist/{73793.7e812bab1754ddd5efb5.bundle.js → 73793.88917a280c5cbacfd4c5.bundle.js} +2 -2
  80. package/dist/{73793.7e812bab1754ddd5efb5.bundle.js.map → 73793.88917a280c5cbacfd4c5.bundle.js.map} +1 -1
  81. package/dist/73964.7a3038b5726d50c1a051.bundle.js +2 -0
  82. package/dist/73964.7a3038b5726d50c1a051.bundle.js.map +1 -0
  83. package/dist/{75282.2f97d3a7d7f3fdd7aebf.bundle.js → 75282.865c935a564591b19c85.bundle.js} +2 -2
  84. package/dist/{75282.2f97d3a7d7f3fdd7aebf.bundle.js.map → 75282.865c935a564591b19c85.bundle.js.map} +1 -1
  85. package/dist/75849.d9fcfe95fed333bad2d0.bundle.js +2 -0
  86. package/dist/75849.d9fcfe95fed333bad2d0.bundle.js.map +1 -0
  87. package/dist/{78250.73e3013c5b2ebdddbf38.bundle.js → 78250.c266986c29f5c73eb46a.bundle.js} +2 -2
  88. package/dist/{78250.73e3013c5b2ebdddbf38.bundle.js.map → 78250.c266986c29f5c73eb46a.bundle.js.map} +1 -1
  89. package/dist/7928.9ab4b363abb28bfc6bd5.bundle.js +2 -0
  90. package/dist/7928.9ab4b363abb28bfc6bd5.bundle.js.map +1 -0
  91. package/dist/{79329.3d912887ba7e96090fb4.bundle.js → 79329.8d230cc14746653003ee.bundle.js} +2 -2
  92. package/dist/{79329.3d912887ba7e96090fb4.bundle.js.map → 79329.8d230cc14746653003ee.bundle.js.map} +1 -1
  93. package/dist/{82926.93a59d42bf8d49aaac8e.bundle.js → 82926.0cb2c4faf483e67f5e7f.bundle.js} +2 -2
  94. package/dist/{82926.93a59d42bf8d49aaac8e.bundle.js.map → 82926.0cb2c4faf483e67f5e7f.bundle.js.map} +1 -1
  95. package/dist/85609.68438b4955212d5fcb84.bundle.js +2 -0
  96. package/dist/85609.68438b4955212d5fcb84.bundle.js.map +1 -0
  97. package/dist/85788.501c7244b890d519f8cf.bundle.js +2 -0
  98. package/dist/85788.501c7244b890d519f8cf.bundle.js.map +1 -0
  99. package/dist/{89695.4ee87c52d4088115c51e.bundle.js → 89695.b7e90a123bc2875ccae4.bundle.js} +2 -2
  100. package/dist/89695.b7e90a123bc2875ccae4.bundle.js.map +1 -0
  101. package/dist/{9062.3541de664710a36fdac7.bundle.js → 9062.9bb14aa1e3d51036c7fe.bundle.js} +2 -2
  102. package/dist/{9062.3541de664710a36fdac7.bundle.js.map → 9062.9bb14aa1e3d51036c7fe.bundle.js.map} +1 -1
  103. package/dist/96089.4317e132ef8cc0033f83.bundle.js +2 -0
  104. package/dist/96089.4317e132ef8cc0033f83.bundle.js.map +1 -0
  105. package/dist/{99448.384b74c734331e5f8909.bundle.js → 99448.2ecdf14415bcd9299354.bundle.js} +2 -2
  106. package/dist/{99448.384b74c734331e5f8909.bundle.js.map → 99448.2ecdf14415bcd9299354.bundle.js.map} +1 -1
  107. package/dist/css/ttyg/chat-item-details.css +1 -1
  108. package/dist/css/ttyg/chat-panel.css +1 -1
  109. package/dist/i18n/locale-en.json +3 -0
  110. package/dist/i18n/locale-fr.json +3 -0
  111. package/dist/index.html +8 -8
  112. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  113. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  114. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  115. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  116. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  117. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  118. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  119. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  120. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  121. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  122. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  123. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  124. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  125. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  126. package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
  127. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  128. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  129. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  130. package/dist/js/angular/security/templates/user.html +2 -2
  131. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  132. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  133. package/dist/js/angular/ttyg/templates/chat-item-detail.html +5 -5
  134. package/dist/js/angular/ttyg/templates/chat-list.html +2 -2
  135. package/dist/js/angular/ttyg/templates/chat-panel.html +12 -7
  136. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  137. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
  138. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  139. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  140. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  141. package/dist/{legacyWorkbench.2bd696723af2573e8bb7.js → legacyWorkbench.ffd119cc335034d736cc.js} +3 -3
  142. package/dist/{legacyWorkbench.2bd696723af2573e8bb7.js.map → legacyWorkbench.ffd119cc335034d736cc.js.map} +1 -1
  143. package/dist/pages/aclmanagement.html +2 -2
  144. package/dist/pages/autocomplete.html +1 -1
  145. package/dist/pages/choose-repository-type.html +1 -1
  146. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  147. package/dist/pages/create-index.html +1 -1
  148. package/dist/pages/dependencies.html +1 -1
  149. package/dist/pages/domainRangeInfo.html +2 -2
  150. package/dist/pages/edit.html +1 -1
  151. package/dist/pages/explore.html +1 -1
  152. package/dist/pages/export.html +1 -1
  153. package/dist/pages/find.html +1 -1
  154. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  155. package/dist/pages/graphs-visualizations.html +7 -7
  156. package/dist/pages/guides.html +1 -1
  157. package/dist/pages/import.html +2 -2
  158. package/dist/pages/jdbc-create.html +1 -1
  159. package/dist/pages/login.html +1 -1
  160. package/dist/pages/monitor/backup-and-restore.html +1 -1
  161. package/dist/pages/monitor/queries.html +1 -1
  162. package/dist/pages/monitor/resources.html +1 -1
  163. package/dist/pages/namespaces.html +2 -2
  164. package/dist/pages/plugins.html +1 -1
  165. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  166. package/dist/pages/rdfrank.html +2 -2
  167. package/dist/pages/repositories.html +1 -1
  168. package/dist/pages/repository.html +1 -1
  169. package/dist/pages/similarity-indexes.html +1 -1
  170. package/dist/pages/sparql-editor.html +1 -1
  171. package/dist/pages/sparql-template-create.html +1 -1
  172. package/dist/pages/ux-test1.html +2 -2
  173. package/dist/pages/webapi.html +2 -2
  174. package/dist/plugins.js +1 -1
  175. package/dist/res/swagger5/index.html +11 -11
  176. package/package.json +1 -1
  177. package/dist/12358.2061f29dc113149946a3.bundle.js +0 -3
  178. package/dist/12358.2061f29dc113149946a3.bundle.js.map +0 -1
  179. package/dist/19402.07424b4b7c9dd775d860.bundle.js +0 -2
  180. package/dist/19402.07424b4b7c9dd775d860.bundle.js.map +0 -1
  181. package/dist/21142.ec45fad4d52b36961d17.bundle.js +0 -2
  182. package/dist/21142.ec45fad4d52b36961d17.bundle.js.map +0 -1
  183. package/dist/21195.caae6cc33d755ad52df4.bundle.js +0 -2
  184. package/dist/21195.caae6cc33d755ad52df4.bundle.js.map +0 -1
  185. package/dist/29350.9976c09d5cdaa48ecb19.bundle.js +0 -2
  186. package/dist/29350.9976c09d5cdaa48ecb19.bundle.js.map +0 -1
  187. package/dist/36633.bd17a2028ef302870ec4.bundle.js +0 -2
  188. package/dist/36633.bd17a2028ef302870ec4.bundle.js.map +0 -1
  189. package/dist/36665.eda6cfdf545f2608a6c7.bundle.js +0 -2
  190. package/dist/36665.eda6cfdf545f2608a6c7.bundle.js.map +0 -1
  191. package/dist/40516.734b24eead67142c4045.bundle.js +0 -2
  192. package/dist/40516.734b24eead67142c4045.bundle.js.map +0 -1
  193. package/dist/44874.5854c207bbe2c4f2438e.bundle.js +0 -2
  194. package/dist/44874.5854c207bbe2c4f2438e.bundle.js.map +0 -1
  195. package/dist/49539.d253a79e8b9710776e48.bundle.js +0 -2
  196. package/dist/49539.d253a79e8b9710776e48.bundle.js.map +0 -1
  197. package/dist/51087.b072d1c0e53403535283.bundle.js.map +0 -1
  198. package/dist/60039.cb9262af0bc63b635c76.bundle.js +0 -2
  199. package/dist/60039.cb9262af0bc63b635c76.bundle.js.map +0 -1
  200. package/dist/63415.81af22cc29be1144e07f.bundle.js +0 -2
  201. package/dist/63415.81af22cc29be1144e07f.bundle.js.map +0 -1
  202. package/dist/64118.fb6952c8ef6fc9117f35.bundle.js +0 -2
  203. package/dist/64118.fb6952c8ef6fc9117f35.bundle.js.map +0 -1
  204. package/dist/71920.46e7b0ec1d22adcd8e55.bundle.js +0 -2
  205. package/dist/71920.46e7b0ec1d22adcd8e55.bundle.js.map +0 -1
  206. package/dist/73964.fd1ad5e7aa228ad4cbbb.bundle.js +0 -2
  207. package/dist/73964.fd1ad5e7aa228ad4cbbb.bundle.js.map +0 -1
  208. package/dist/75849.bd0bdefa903741034a71.bundle.js +0 -2
  209. package/dist/75849.bd0bdefa903741034a71.bundle.js.map +0 -1
  210. package/dist/7928.7900a3911c83495d74dd.bundle.js +0 -2
  211. package/dist/7928.7900a3911c83495d74dd.bundle.js.map +0 -1
  212. package/dist/85609.680b755726c66ea1de34.bundle.js +0 -2
  213. package/dist/85609.680b755726c66ea1de34.bundle.js.map +0 -1
  214. package/dist/85788.4e0818c48b6f29153db4.bundle.js +0 -2
  215. package/dist/85788.4e0818c48b6f29153db4.bundle.js.map +0 -1
  216. package/dist/89695.4ee87c52d4088115c51e.bundle.js.map +0 -1
  217. package/dist/96089.7e28823f34c450de1f7e.bundle.js +0 -2
  218. package/dist/96089.7e28823f34c450de1f7e.bundle.js.map +0 -1
  219. /package/dist/{12358.2061f29dc113149946a3.bundle.js.LICENSE.txt → 12358.4be185f89eebea9c35bf.bundle.js.LICENSE.txt} +0 -0
  220. /package/dist/{legacyWorkbench.2bd696723af2573e8bb7.js.LICENSE.txt → legacyWorkbench.ffd119cc335034d736cc.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"71920.46e7b0ec1d22adcd8e55.bundle.js","mappings":"kLAQA,SAASA,EAAmBC,GAOxB,IAAIC,EAOAC,EAOAC,EAOAC,EAeAC,EAPAC,EAAgB,CAAC,EASjBC,GAAkB,EAEtB,MAwBMC,EAAYA,KACPC,EAAAA,EAAAA,WAAUR,GAYfS,EAAWA,KACND,EAAAA,EAAAA,WAAUP,GAMfS,EAAeC,IACjBV,GAASO,EAAAA,EAAAA,WAAUG,GACnBC,EAAKC,EAAcC,kBAAmBL,MAqCpCM,EAAkBA,KACbP,EAAAA,EAAAA,WAAUN,GAmGfc,EAAmBA,KACdR,EAAAA,EAAAA,WAAUL,GAcfc,EAA2BA,KACtBT,EAAAA,EAAAA,WAAUH,GAsBfa,EAAsBC,KACfd,EAAcc,GA8CrBC,EAAoBA,IACfd,EAsBLM,EAAOA,CAACS,EAAeC,KACzBvB,EAAoBwB,SAASF,G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EAAUX,EAAcwD,+BAAiCK,GAAqBjD,EAASiD,KAsGtG,CA7YAvC,QACKwC,OAAO,8CAA+C,IACtDC,QAAQ,qBAAsB9E,GAEnCA,EAAmB+E,QAAU,CAAC,sBAAuB,eA2Y9C,MAAMhE,EAAgB,CAIzBiE,YAAa,aAKbC,uBAAwB,cAKxBC,oBAAqB,qBAErBC,YAAa,aACbC,uBAAwB,cACxBC,oBAAqB,qBAKrB3C,YAAa,aAKbM,sBAAuB,oBAKvBG,sBAAuB,sBAMvBmC,cAAe,eAKfC,YAAa,aAKbC,uBAAwB,cASxBC,oBAAqB,qBAErBC,YAAa,aACbC,uBAAwB,oBACxBC,oBAAqB,oBACrB5E,kBAAmB,kBAKnB6E,aAAc,cAKdC,qBAAsB,qBAKtBC,kBAAmB,kBAKnBC,WAAY,YACZC,qBAAsB,kBACtBC,kBAAmB,kBAEnB5C,mBAAoB,mBAMpB6C,oBAAqB,oBAKrBC,WAAY,YAKZC,YAAa,aAKbC,aAAc,cAKdC,cAAe,eAMfC,eAAgB,gBAKhB5C,eAAgB,gBAKhB6C,6BAA8B,2BAK9BC,sBAAuB,qBAKvBC,8BAA+B,4BAK/BC,iBAAkB,kBAKlBrC,+BAAgC,8BAKhCsC,oBAAqB,0BAErB1C,yBAA0B,wB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-context.service.js"],"sourcesContent":["import {cloneDeep} from 'lodash';\n\nangular\n .module('graphdb.framework.ttyg.services.ttygcontext', [])\n .factory('TTYGContextService', TTYGContextService);\n\nTTYGContextService.$inject = ['EventEmitterService', 'TTYGService'];\n\nfunction TTYGContextService(EventEmitterService) {\n\n /**\n * The list of agents.\n * @type {AgentListModel}\n * @private\n */\n let _agents = undefined;\n\n /**\n * The ChatsListModel.\n * @type {ChatsListModel}\n * @private\n */\n let _chats = undefined;\n\n /**\n * The currently selected in the UI chat which is used for conversation.\n * @type {ChatModel|undefined}\n * @private\n */\n let _selectedChat = undefined;\n\n /**\n * The currently selected in the UI agent which is used for conversation.\n * @type {AgentModel|undefined}\n * @private\n */\n let _selectedAgent = undefined;\n\n /**\n * Stores information about loaded explain responses.\n * The key is the answer ID, and the value is an instance of {@see ExplainResponseModel} that holds the explanation message.\n *\n * @type {{[key: string]: ExplainResponseModel}}\n */\n let _explainCache = {};\n\n /**\n * The default agent values.\n * @type {AgentModel|undefined}\n * @private\n */\n let _defaultAgent = undefined;\n\n let _canModifyAgent = false;\n\n const resetContext = () => {\n _agents = undefined;\n _chats = undefined;\n _selectedChat = undefined;\n _selectedAgent = undefined;\n _explainCache = {};\n _defaultAgent = undefined;\n _canModifyAgent = false;\n };\n\n /**\n * @return {Promise<AgentModel>}\n */\n const getDefaultAgent = () => {\n return cloneDeep(_defaultAgent);\n };\n\n const setDefaultAgent = (agent) => {\n _defaultAgent = agent;\n };\n\n /**\n * @return {AgentListModel}\n */\n const getAgents = () => {\n return cloneDeep(_agents);\n };\n\n const getAgent = (agentId) => {\n if (_agents) {\n return cloneDeep(_agents.getAgent(agentId));\n }\n };\n\n /**\n * @return {ChatsListModel}\n */\n const getChats = () => {\n return cloneDeep(_chats);\n };\n\n /**\n * @param {ChatsListModel} chats\n */\n const updateChats = (chats) => {\n _chats = cloneDeep(chats);\n emit(TTYGEventName.CHAT_LIST_UPDATED, getChats());\n };\n\n /**\n * Deletes the chat with the provided <code>chatId</code>.\n * @param {ChatModel} chat\n */\n const deleteChat = (chat) => {\n _chats.deleteChat(chat);\n updateChats(_chats);\n };\n\n const addChat = (newChat) => {\n _chats.appendChat(newChat);\n updateChats(_chats);\n };\n\n const replaceChat = (newChat, oldChat) => {\n _chats.replaceChat(newChat, oldChat);\n updateChats(_chats);\n };\n\n /** Subscribes to the 'chatListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onChatsListChanged = (callback) => {\n if (_chats && angular.isFunction(callback)) {\n callback(getChats());\n }\n return subscribe(TTYGEventName.CHAT_LIST_UPDATED, (chats) => callback(chats));\n };\n\n /**\n * @return {ChatModel}\n */\n const getSelectedChat = () => {\n return cloneDeep(_selectedChat);\n };\n\n /**\n * Updates the selected chat with the provided <code>selectedChat</code> and emits the 'selectChat' event\n * to notify listeners that a new chat has been selected.\n *\n * @param {ChatModel} selectedChat - The chat object to select.\n */\n const selectChat = (selectedChat) => {\n if (!_selectedChat || _selectedChat.id !== selectedChat.id) {\n _selectedChat = cloneDeep(selectedChat);\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n }\n };\n\n const deselectChat = () => {\n _selectedChat = undefined;\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n };\n\n /**\n * Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatChanged = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECT_CHAT, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the selected chat and emits the 'selectChatUpdated' event to notify listeners that a property\n * of the selected chat has changed.\n *\n * If the ID of the passed chat differs from the current selected chat, no action will occur.\n *\n * The selected chat can be updated through {@link TTYGContextService#selectChat}.\n *\n * @param {ChatModel} chat - The chat object that is being updated.\n */\n const updateSelectedChat = (chat) => {\n if (!_selectedChat || !_selectedChat.id || !chat || _selectedChat.id === chat.id) {\n _selectedChat = cloneDeep(chat);\n emit(TTYGEventName.SELECTED_CHAT_UPDATED, getSelectedChat());\n }\n };\n\n /** Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatUpdated = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECTED_CHAT_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /** Subscribes to the 'lastMessageReceived' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onLastMessageReceived = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.LAST_MESSAGE_RECEIVED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @param {AgentListModel} agents\n */\n const updateAgents = (agents) => {\n _agents = cloneDeep(agents);\n emit(TTYGEventName.AGENT_LIST_UPDATED, getAgents());\n };\n\n /**\n * Subscribes to the 'agentListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onAgentsListChanged = (callback) => {\n if (_agents && angular.isFunction(callback)) {\n callback(getAgents());\n }\n return subscribe(TTYGEventName.AGENT_LIST_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @return {AgentModel}\n */\n const getSelectedAgent = () => {\n return cloneDeep(_selectedAgent);\n };\n\n /**\n * Updates the selected agent with the provided <code>selectedAgent</code> and emits the 'agentSelected' event\n * to notify listeners that a new agent has been selected.\n *\n * @param {AgentModel} selectedAgent - The instance of selected agent.\n */\n const selectAgent = (selectedAgent) => {\n _selectedAgent = cloneDeep(selectedAgent);\n emit(TTYGEventName.AGENT_SELECTED, getSelectedAgent());\n };\n\n const _getExplainResponseCache = () => {\n return cloneDeep(_explainCache);\n };\n\n /**\n * Gets the explain response.\n * @param {string} answerId\n * @return {ExplainResponseModel}\n */\n const getExplainResponse = (answerId) => {\n return cloneDeep(_explainCache[answerId]);\n };\n\n /**\n * Adds the <code>explainResponse</code> into the explain response cache.\n *\n * @param {ExplainResponseModel} explainResponse\n */\n const addExplainResponseCache = (explainResponse) => {\n _explainCache[explainResponse.answerId] = cloneDeep(explainResponse);\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n };\n\n const hasExplainResponse = (answerId) => {\n return !!_explainCache[answerId];\n };\n\n const toggleExplainResponse = (answerId) => {\n if (hasExplainResponse(answerId)) {\n _explainCache[answerId].expanded = !_explainCache[answerId].expanded;\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n }\n };\n\n /**\n * Subscribes to the 'explainResponseCacheUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onExplainResponseCacheUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(_getExplainResponseCache());\n }\n return subscribe(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, (explainResponses) => callback(explainResponses));\n };\n\n /**\n * Subscribes to the 'agentSelected' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedAgentChanged = (callback) => {\n if (_selectedAgent && angular.isFunction(callback)) {\n callback(getSelectedAgent());\n }\n return subscribe(TTYGEventName.AGENT_SELECTED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the \"canModifyAgent\" flag and emits the 'canModifyAgentUpdated' event to notify listeners that the canModifyAgent flag is changed.\n *\n * @param {boolean} canModifyAgent\n */\n const setCanModifyAgent = (canModifyAgent) => {\n _canModifyAgent = cloneDeep(canModifyAgent);\n emit(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, getCanModifyAgent());\n };\n\n const getCanModifyAgent = () => {\n return _canModifyAgent;\n };\n\n /**\n * Subscribes to the 'canModifyAgentUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onCanUpdateAgentUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getCanModifyAgent());\n }\n return subscribe(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, (canModifyAgent) => callback(canModifyAgent));\n };\n\n /**\n * Emits an event with a deep-cloned payload using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to emit. It must be a value from {@link TTYGEventName}.\n * @param {*} payload - The data to emit with the event. The payload is deep-cloned before emission.\n */\n const emit = (tTYGEventName, payload) => {\n EventEmitterService.emitSync(tTYGEventName, cloneDeep(payload));\n };\n\n /**\n * Subscribes to an event with the specified callback using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to subscribe to. It must be a value from {@link TTYGEventName}.\n * @param {function} callback - The function to call when the event is emitted.\n * @return {function} - Returns a function that can be called to unsubscribe from the event.\n */\n const subscribe = (tTYGEventName, callback) => {\n return EventEmitterService.subscribeSync(tTYGEventName, (payload) => callback(payload));\n };\n\n return {\n resetContext,\n emit,\n subscribe,\n // chats\n getChats,\n updateChats,\n addChat,\n replaceChat,\n onChatsListChanged,\n getSelectedChat,\n selectChat,\n deselectChat,\n deleteChat,\n onSelectedChatChanged,\n updateSelectedChat,\n onSelectedChatUpdated,\n onLastMessageReceived,\n // agents\n updateAgents,\n onAgentsListChanged,\n getAgents,\n getAgent,\n selectAgent,\n getSelectedAgent,\n onSelectedAgentChanged,\n getDefaultAgent,\n setDefaultAgent,\n setCanModifyAgent,\n getCanModifyAgent,\n onCanUpdateAgentUpdated,\n // chat explain\n hasExplainResponse,\n toggleExplainResponse,\n getExplainResponse,\n addExplainResponseCache,\n onExplainResponseCacheUpdated\n };\n}\n\nexport const TTYGEventName = {\n /**\n * Emitting the \"createChat\" event triggers a backend request to create a new chat.\n */\n CREATE_CHAT: 'createChat',\n\n /**\n * This event is emitted when a chat is successfully created.\n */\n CREATE_CHAT_SUCCESSFUL: 'chatCreated',\n\n /**\n * This event is emitted when the creation of a chat fails.\n */\n CREATE_CHAT_FAILURE: 'chatCreationFailed',\n\n RENAME_CHAT: 'renameChat',\n RENAME_CHAT_SUCCESSFUL: 'chatRenamed',\n RENAME_CHAT_FAILURE: 'chatRenamedFailure',\n\n /**\n * Emitting the \"selectChat\" event when the selected chat has been changed.\n */\n SELECT_CHAT: 'selectChat',\n\n /**\n * Emitting the \"selectChatUpdated\" event when the selected chat has been updated.\n */\n SELECTED_CHAT_UPDATED: 'selectChatUpdated',\n\n /**\n * Emitting the \"lastMessageReceived\" event when the final answer message has been received.\n */\n LAST_MESSAGE_RECEIVED: 'lastMessageReceived',\n\n /**\n * This event will be emitted when the chat delete request is in progress. The payload will contain the chat ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_CHAT: 'deletingChat',\n\n /**\n * This event will be emitted when the delete chat process is triggered but before the chat delete request is sent.\n */\n DELETE_CHAT: 'deleteChat',\n\n /**\n * This event will be emitted when the chat was successfully deleted.\n */\n DELETE_CHAT_SUCCESSFUL: 'chatDeleted',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n\n /**\n * This event is emitted when the deletion of a chat fails.\n */\n DELETE_CHAT_FAILURE: 'chatDeletedFailure',\n\n CHAT_EXPORT: 'chatExport',\n CHAT_EXPORT_SUCCESSFUL: 'chatExportSuccess',\n CHAT_EXPORT_FAILURE: 'chatExportFailure',\n CHAT_LIST_UPDATED: 'chatListUpdated',\n\n /**\n * Emitting the \"askQuestion\" event triggers a request to the backend to retrieve an answer to a question.\n */\n ASK_QUESTION: 'askQuestion',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n ASK_QUESTION_FAILURE: 'askQuestionFailure',\n\n /**\n * Emitting the \"continueChatRun\" event triggers a request to the backend to retrieve more remaining answers from the same chat run.\n */\n CONTINUE_CHAT_RUN: 'continueChatRun',\n\n /**\n * Emitting the \"loadChats\" event will trigger an action to loads all chats from backend server.\n */\n LOAD_CHATS: 'loadChats',\n LOAD_CHAT_SUCCESSFUL: 'loadChatSuccess',\n LOAD_CHAT_FAILURE: 'loadChatFailure',\n\n AGENT_LIST_UPDATED: 'agentListUpdated',\n\n /**\n * This event will be emitted when the create agent process is triggered through the UI but before the agent create\n * request is sent. This is used to open the agent settings dialog.\n */\n OPEN_AGENT_SETTINGS: 'openAgentSettings',\n\n /**\n * This event will be emitted when an agent needs to be edited.\n */\n EDIT_AGENT: 'editAgent',\n\n /**\n * This event will be emitted when an agent needs to be cloned.\n */\n CLONE_AGENT: 'cloneAgent',\n\n /**\n * This event will be emitted when the delete agent process is triggered but before the agent delete request is sent.\n */\n DELETE_AGENT: 'deleteAgent',\n\n /**\n * This event will be emitted when the agent was successfully deleted.\n */\n AGENT_DELETED: 'agentDeleted',\n\n /**\n * This event will be emitted when the agent delete request is in progress. The payload will contain the agent ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_AGENT: 'deletingAgent',\n\n /**\n * This event will be emitted when an agent is selected by the user through the UI.\n */\n AGENT_SELECTED: 'agentSelected',\n\n /**\n * This event will trigger the opening of the similarity view.\n */\n GO_TO_CREATE_SIMILARITY_VIEW: \"goToCreateSimilarityView\",\n\n /**\n * This event will trigger the opening of the connectors view.\n */\n GO_TO_CONNECTORS_VIEW: \"goToConnectorsView\",\n\n /**\n * This event will trigger the opening of the \"Autocomplete index\" view.\n */\n GO_TO_AUTOCOMPLETE_INDEX_VIEW: \"goToAutocompleteIndexView\",\n\n /**\n * This event will trigger fetching a new explanation of how the answer was generated.\n */\n EXPLAIN_RESPONSE: \"explainResponse\",\n\n /**\n * This event will be emitted when the cache with explain responses changed.\n */\n EXPLAIN_RESPONSE_CACHE_UPDATED: \"explainResponseCacheUpdated\",\n\n /**\n * This event will trigger the opening of the sparql view.\n */\n GO_TO_SPARQL_EDITOR: \"openQueryInSparqlEditor\",\n\n CAN_MODIFY_AGENT_UPDATED: \"canModifyAgentUpdated\",\n};\n"],"names":["TTYGContextService","EventEmitterService","_agents","_chats","_selectedChat","_selectedAgent","_defaultAgent","_explainCache","_canModifyAgent","getAgents","cloneDeep","getChats","updateChats","chats","emit","TTYGEventName","CHAT_LIST_UPDATED","getSelectedChat","getSelectedAgent","_getExplainResponseCache","hasExplainResponse","answerId","getCanModifyAgent","tTYGEventName","payload","emitSync","subscribe","callback","subscribeSync","resetContext","undefined","addChat","newChat","appendChat","replaceChat","oldChat","onChatsListChanged","angular","isFunction","selectChat","selectedChat","id","SELECT_CHAT","deselectChat","deleteChat","chat","onSelectedChatChanged","updateSelectedChat","SELECTED_CHAT_UPDATED","onSelectedChatUpdated","onLastMessageReceived","LAST_MESSAGE_RECEIVED","updateAgents","agents","AGENT_LIST_UPDATED","onAgentsListChanged","getAgent","agentId","selectAgent","selectedAgent","AGENT_SELECTED","onSelectedAgentChanged","getDefaultAgent","setDefaultAgent","agent","setCanModifyAgent","canModifyAgent","CAN_MODIFY_AGENT_UPDATED","onCanUpdateAgentUpdated","toggleExplainResponse","expanded","EXPLAIN_RESPONSE_CACHE_UPDATED","getExplainResponse","addExplainResponseCache","explainResponse","onExplainResponseCacheUpdated","explainResponses","module","factory","$inject","CREATE_CHAT","CREATE_CHAT_SUCCESSFUL","CREATE_CHAT_FAILURE","RENAME_CHAT","RENAME_CHAT_SUCCESSFUL","RENAME_CHAT_FAILURE","DELETING_CHAT","DELETE_CHAT","DELETE_CHAT_SUCCESSFUL","DELETE_CHAT_FAILURE","CHAT_EXPORT","CHAT_EXPORT_SUCCESSFUL","CHAT_EXPORT_FAILURE","ASK_QUESTION","ASK_QUESTION_FAILURE","CONTINUE_CHAT_RUN","LOAD_CHATS","LOAD_CHAT_SUCCESSFUL","LOAD_CHAT_FAILURE","OPEN_AGENT_SETTINGS","EDIT_AGENT","CLONE_AGENT","DELETE_AGENT","AGENT_DELETED","DELETING_AGENT","GO_TO_CREATE_SIMILARITY_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_AUTOCOMPLETE_INDEX_VIEW","EXPLAIN_RESPONSE","GO_TO_SPARQL_EDITOR"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=73964;export const __webpack_ids__=[36633,73964];export const __webpack_modules__={36633:(e,t,n)=>{n.r(t),n.d(t,{CHAT_MESSAGE_ROLE:()=>s,ChatMessageModel:()=>r});class r{constructor(e){this._id=e.id,this._role=e.role,this._message=e.message,this._timestamp=1e3*e.timestamp,this.tokenUsageInfo=e.tokenUsageInfo}get id(){return this._id}set id(e){this._id=e}get role(){return this._role}set role(e){this._role=e}get message(){return this._message}set message(e){this._message=e}get timestamp(){return this._timestamp}set timestamp(e){this._timestamp=e}}const s={USER:"user",ASSISTANT:"assistant"}},73964:(e,t,n)=>{n.r(t),n.d(t,{TtygRestServiceFakeBackend:()=>o});var r=n(98980),s=n(36633);const a=2e3;class o{constructor(){this.conversations=[...i]}getConversations(){return new Promise(e=>{setTimeout(()=>e({data:(0,r.cloneDeep)(this.conversations)}),2e3)})}getConversation(e){return new Promise(t=>{setTimeout(()=>t({data:(0,r.cloneDeep)(this.conversations.find(t=>t.id===e))}),2e3)})}renameConversation(e,t){const n=this.conversations.find(t=>t.id===e);return n&&(n.name=t.name),Promise.resolve({data:(0,r.cloneDeep)(n)})}exportConversation(e){return console.log("Exporting conversation with id: ",e),Promise.resolve()}askQuestion(e){const t={id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNe",conversationId:e.conversationId,agentId:null,message:`${e.question}`,role:s.CHAT_MESSAGE_ROLE.USER,timestamp:Math.floor(Date.now()/1e3)},n=this.conversations.find(t=>t.id===e.conversationId),r={id:e.conversationId,name:n?n.name:"Han Solo is a character in the Star Wars...",timestamp:Math.floor(Date.now()/1e3),messages:[{id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNe_"+Date.now(),conversationId:e.conversationId,role:s.CHAT_MESSAGE_ROLE.ASSISTANT,agentId:e.agentId,message:'Certainly! Here\'s a random example that incorporates code, JSON, and a SPARQL query:\n\n### Code (Python)\n\n```python\ndef greet(name):\n return f"Hello, {name}!"\n\nprint(greet("World"))\n```\n\n### JSON\n\n```json\n{\n "greeting": "Hello",\n "target": "World",\n "language": "English"\n}\n```\n\n### SPARQL Query\n\n```sparql\nSELECT ?person ?name\nWHERE {\n ?person a ex:Person .\n ?person ex:hasName ?name .\n}\nLIMIT 10\n```\n\nThis example demonstrates a simple Python function for greeting, a JSON object representing a greeting structure, and a SPARQL query to retrieve names of persons from a dataset.',timestamp:Math.floor(Date.now()/1e3),name:null},{id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNeс_"+Date.now(),conversationId:e.conversationId,role:s.CHAT_MESSAGE_ROLE.ASSISTANT,agentId:e.agentId,message:`Reply to '${e.question}' It seems there was an error with the query. Let me rectify this and try again.`,timestamp:Math.floor(Date.now()/1e3),name:null}]};return n&&(n.messages.push(t),n.messages.push(...r.messages)),new Promise(e=>setTimeout(()=>e({data:r}),2e3))}continueChatRun(e){alert("continueChatRun() not implemented")}deleteConversation(e){return this.conversations=this.conversations.filter(t=>t.id!==e),new Promise(e=>setTimeout(()=>e(),2e3))}createConversation(e){const t={id:`thread_${this.conversations.length}`,name:`Thread ${this.conversations.length}`,timestamp:Math.floor(Date.now()/1e3),messages:[]};this.conversations.unshift(t);const n=(0,r.cloneDeep)(e);return n.conversationId=t.id,this.askQuestion(n)}getAgents(){return new Promise(e=>setTimeout(()=>e({data:[...l]}),2e3))}getAgent(e){return Promise.resolve({data:(0,r.cloneDeep)(l.find(t=>t.id===e))})}createAgent(e){return"err"===e.name?new Promise((e,t)=>setTimeout(()=>t({status:500,message:"Internal Server Error"}),a)):(l.push(e),new Promise(t=>setTimeout(()=>t({data:e}),a)))}editAgent(e){return"err"===e.name?new Promise((e,t)=>setTimeout(()=>t({status:500,message:"Internal Server Error"}),2e3)):(l=l.map(t=>t.id===e.id?e:t),new Promise(t=>setTimeout(()=>t({data:e}),a)))}deleteAgent(e){return l=l.filter(t=>t.id!==e),Promise.resolve()}getAgentDefaultValues(){return Promise.resolve({data:u})}explainAgentSettings(){return Promise.resolve({data:{}})}simulateHttpError(){return Promise.reject({status:500,message:"Internal Server Error"})}explainResponse(e){return Promise.resolve({data:{conversationId:e.conversationId,answerId:e.answerId,queryMethods:[{name:"sparql_query",rawQuery:'SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',query:'SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',queryType:"sparql",errorOutput:"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:Character' uses an undefined prefix"},{name:"retrieval_search",rawQuery:'{"queries":[{"query":"pilots that work with Luke Skywalker","filter":{"document_id":"https://swapi.co/resource/human/1"},"top_k":3}]}',query:'{\n "queries" : [ {\n "query" : "pilots that work with Luke Skywalker",\n "filter" : {\n "document_id" : "https://swapi.co/resource/human/1"\n },\n "top_k" : 3\n } ]\n}',queryType:"json",errorOutput:null},{name:"iri_discovery",rawQuery:"Luke Skywalker",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\nPREFIX onto: <http://www.ontotext.com/>\nSELECT ?label ?iri {\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\n ?iri rdfs:label|skos:prefLabel ?label .\n}",queryType:"sparql",errorOutput:null},{name:"sparql_query",rawQuery:"SELECT ?height WHERE {\n <https://swapi.co/resource/human/1> voc:height ?height.\n}",query:"SELECT ?height WHERE {\n <https://swapi.co/resource/human/1> voc:height ?height.\n}",queryType:"sparql",errorOutput:"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:height' uses an undefined prefix"},{name:"sparql_query",rawQuery:'PREFIX voc: <https://swapi.co/vocabulary/>\nSELECT ?name ?height WHERE {\n ?character voc:height ?height;\n rdfs:label ?name.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',query:'PREFIX voc: <https://swapi.co/vocabulary/>\nSELECT ?name ?height WHERE {\n ?character voc:height ?height;\n rdfs:label ?name.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',queryType:"sparql",errorOutput:null},{name:"fts_search",rawQuery:"Second Luke",query:"PREFIX onto: <http://www.ontotext.com/>\nDESCRIBE ?iri {\n\t?x onto:fts '''Second Luke''' .\n\t{\n\t\t?x ?p ?iri .\n\t} union {\n\t\t?iri ?p ?x .\n\t}\n}",queryType:"sparql",errorOutput:null},{name:"similarity_search",rawQuery:"Second Luke",query:"PREFIX onto: <http://www.ontotext.com/>\nDESCRIBE ?iri {\n\t?x onto:fts '''Second Luke''' .\n\t{\n\t\t?x ?p ?iri .\n\t} union {\n\t\t?iri ?p ?x .\n\t}\n}",queryType:"sparql",errorOutput:null},{name:"iri_discovery",rawQuery:"Luke Skywalker",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\nPREFIX onto: <http://www.ontotext.com/>\nSELECT ?label ?iri {\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\n ?iri rdfs:label|skos:prefLabel ?label .\n}",queryType:"sparql",errorOutput:null},{name:"sparql_query",rawQuery:"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }",query:"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }",queryType:"sparql",errorOutput:"Error: java.lang.IllegalArgumentException: The following IRIs are not used in the data stored in GraphDB: https://swapi.co/vocabulary/name"},{name:"sparql_query",rawQuery:"SELECT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }",query:"SELEdCT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }",queryType:"sparql",errorOutput:null}]}})}}const i=[{id:"thread_jdQBvbkaU6JPoO48oFbC54dA",name:"Very long chat name which does not fit in the sidebar",timestamp:1725235200,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oQaL76dB",name:"Test chat 2",timestamp:1725238800,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oQaL76dC",name:"Test chat 3",timestamp:1725242400,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oFbC54dD",name:"Test chat 4",timestamp:1697331600,messages:[]}];let l=[{id:"asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",name:"agent-1",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"\n\n",userInstruction:""},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc5",name:"agent-2",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_Cr0RxobrY07WpOvvyQilEWMI",name:"Databricks-general-unbiased",model:"gpt-4o-2024-08-06",temperature:1,topP:1,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"You are helpful assistant in discovering information regarding diagnostic biomarkers.",userInstruction:null},assistantExtractionMethods:[],maxNumberOfTriplesPerCall:null},{id:"asst_5GxNYTdaOh7Tl6lLl6Pya2aH",name:"Databricks-biomarkers",model:"gpt-3.5-turbo-0125",temperature:1,topP:1,seed:null,repositoryId:"biomarkers",instructions:{systemInstruction:"You're a helpful assistant in discovering new diagnostic biomarkers for given diseases. I'll submit a set of publication abstracts discussing given disease and your task is to find in the abstracts any potential new biomarkers which are not yet listed in the appropriate databases. Each abstract is preceded by identifier - its PubMed id called for short PMID. \n\nReturn the set of biomarkers listed one per row, each marker followed by the | and PMID of the respective abstract if was mentioned in.\n\nExample: \nInput: 36418457\t[Amyotrophic lateral sclerosis (ALS) is a genetically and phenotypically heterogeneous disease results in the loss of motor neurons. Mounting information points to involvement of other systems including cognitive impairment. However, neither the valid biomarker for diagnosis nor effective therapeutic intervention is available for ALS. The present study is aimed at identifying potentially genetic biomarker that improves the diagnosis and treatment of ALS patients based on the data of the Gene Expression Omnibus. We retrieved datasets and conducted a weighted gene co-expression network analysis (WGCNA) to identify ALS-related co-expression genes. Functional enrichment analysis was performed to determine the features and pathways of the main modules. We then constructed an ALS-related model using the least absolute shrinkage and selection operator (LASSO) regression analysis and verified the model by the receiver operating characteristic (ROC) curve. Besides we screened the non-preserved gene modules in FTD and ALS-mimic disorders to distinct ALS-related genes from disorders with overlapping genes and features. Altogether, 4198 common genes between datasets with the most variation were analyzed and 16 distinct modules were identified through WGCNA. Blue module had the most correlation with ALS and functionally enriched in pathways of neurodegeneration-multiple diseases', 'amyotrophic lateral sclerosis', and 'endocytosis' KEGG terms. Further, some of other modules related to ALS were enriched in 'autophagy' and 'amyotrophic lateral sclerosis'. The 30 top of hub genes were recruited to a LASSO regression model and 5 genes (BCLAF1, GNA13, ARL6IP5, ARGLU1, and YPEL5) were identified as potentially diagnostic ALS biomarkers with validating of the ROC curve and AUC value.]\n\nYour response: BCLAF1|36418457\nGNA13|36418457\nARL6IP5|36418457\nARGLU1|36418457\nYPEL5|36418457",userInstruction:null},assistantExtractionMethods:[],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc555",name:"agent with long name long long long long long long long long long long long long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzcр555",name:"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc55д5",name:"agent with long name long long long long long long long long long long long long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzcя555",name:"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null}];const u={id:"id",name:"Quadro",model:"gpt-4o",api:"openai-completions",contextSize:128e3,temperature:.7,topP:1,seed:0,repositoryId:"test-repository",instructions:{systemInstruction:"You are a helpful, knowledgeable, and friendly assistant. Your goal is to provide clear and accurate information while being polite, respectful, and professional.",userInstruction:"If you need to write a SPARQL query, use only the classes and properties provided in the schema and don't invent or guess any. Always try to return human-readable names or labels and not only the IRIs. If SPARQL fails to provide the necessary information you can try another tool too."},assistantExtractionMethods:[{method:"sparql_search",ontologyGraph:"http://example.com",sparqlQuery:"CONSTRUCT {?s ?p ?o} WHERE {GRAPH <http://example.org/ontology> {?s ?p ?o .}}"},{method:"fts_search",maxNumberOfTriplesPerCall:0},{method:"similarity_search",similarityIndex:"similarity-index",similarityIndexThreshold:.6,maxNumberOfTriplesPerCall:0},{method:"retrieval_search",retrievalConnectorInstance:"retrieval-connector",queryTemplate:'{"query": "string"}',maxNumberOfTriplesPerCall:0}],additionalExtractionMethods:[{method:"iri_discovery_search"}]}}};
2
- //# sourceMappingURL=73964.fd1ad5e7aa228ad4cbbb.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"73964.fd1ad5e7aa228ad4cbbb.bundle.js","mappings":"8LAAO,MAAMA,EACTC,WAAAA,CAAYC,GAKRC,KAAKC,IAAMF,EAAKG,GAKhBF,KAAKG,MAAQJ,EAAKK,KAKlBJ,KAAKK,SAAWN,EAAKO,QAKrBN,KAAKO,WAA8B,IAAjBR,EAAKS,UAQvBR,KAAKS,eAAiBV,EAAKU,cAC/B,CAEA,MAAIP,GACA,OAAOF,KAAKC,GAChB,CAEA,MAAIC,CAAGQ,GACHV,KAAK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,0BAA6B,OAIrC,MAAMW,EAAqB,CACvB,GAAM,KACN,KAAQ,SACR,MAAS,SACT,IAAO,qBACP,YAAe,MACf,YAAe,GACf,KAAQ,EACR,KAAQ,EACR,aAAgB,kBAChB,aAAgB,CACZ,kBAAqB,qKACrB,gBAAmB,gSAEvB,2BAA8B,CAC1B,CACI,OAAU,gBACV,cAAiB,qBACjB,YAAe,iFAEnB,CACI,OAAU,aACV,0BAA6B,GAEjC,CACI,OAAU,oBACV,gBAAmB,mBACnB,yBAA4B,GAC5B,0BAA6B,GAEjC,CACI,OAAU,mBACV,2BAA8B,sBAC9B,cAAiB,sBACjB,0BAA6B,IAGrC,4BAA+B,CAC3B,CACI,OAAU,yB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-message.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/rest/ttyg.rest.service.fake.backend.js"],"sourcesContent":["export class ChatMessageModel {\n constructor(data) {\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type @type {string} - A value from {@link CHAT_MESSAGE_ROLE}, determining the owner of the message (e.g., user, assistant).\n */\n this._role = data.role;\n\n /**\n * @type {string}\n */\n this._message = data.message;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp * 1000;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n * It is applicable only to the assistant role ({@link CHAT_MESSAGE_ROLE#ASSISTANT}).\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get role() {\n return this._role;\n }\n\n set role(value) {\n this._role = value;\n }\n\n get message() {\n return this._message;\n }\n\n set message(value) {\n this._message = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n}\n\nexport const CHAT_MESSAGE_ROLE = {\n USER: 'user',\n ASSISTANT: 'assistant'\n};\n","import {cloneDeep} from \"lodash\";\nimport {CHAT_MESSAGE_ROLE} from \"../models/ttyg/chat-message\";\n\n// Delay for askQuestion()\nconst ASK_DELAY = 2000;\n\n// Delay for getConversations()\nconst LIST_CHATS_DELAY = 2000;\n\n// Delay for getConversation(id)\nconst GET_CHAT_DELAY = 2000;\n\nconst CREATE_AGENT_DELAY = 2000;\nconst EDIT_AGENT_DELAY = 2000;\nconst LOAD_AGENTS_DELAY = 2000;\n\nconst DELETE_DELAY = 2000;\n\nexport class TtygRestServiceFakeBackend {\n\n constructor() {\n this.conversations = [...conversationList];\n }\n\n getConversations() {\n return new Promise((resolve) => {\n setTimeout(() => resolve({data: cloneDeep(this.conversations)}), LIST_CHATS_DELAY);\n });\n }\n\n getConversation(id) {\n return new Promise((resolve) => {\n setTimeout(() => resolve({data: cloneDeep(this.conversations.find((conversation) => conversation.id === id))}),\n GET_CHAT_DELAY);\n });\n }\n\n renameConversation(id, data) {\n const conversation = this.conversations.find((conversation) => conversation.id === id);\n if (conversation) {\n conversation.name = data.name;\n }\n return Promise.resolve({data: cloneDeep(conversation)});\n }\n\n exportConversation(id) {\n console.log(\"Exporting conversation with id: \", id);\n return Promise.resolve();\n }\n\n askQuestion(askRequestData) {\n const question = {\n id: \"msg_Bn07kVDCYT1qmgu1G7Zw0KNe\",\n conversationId: askRequestData.conversationId,\n agentId: null,\n message: `${askRequestData.question}`,\n role: CHAT_MESSAGE_ROLE.USER,\n timestamp: Math.floor(Date.now() / 1000)\n };\n\n const conversation = this.conversations.find((conversation) => conversation.id === askRequestData.conversationId);\n\n const answer = {\n id: askRequestData.conversationId,\n name: conversation ? conversation.name : \"Han Solo is a character in the Star Wars...\",\n timestamp: Math.floor(Date.now() / 1000),\n messages: [\n {\n id: \"msg_Bn07kVDCYT1qmgu1G7Zw0KNe_\" + Date.now(),\n conversationId: askRequestData.conversationId,\n role: CHAT_MESSAGE_ROLE.ASSISTANT,\n agentId: askRequestData.agentId,\n message: \"Certainly! Here's a random example that incorporates code, JSON, and a SPARQL query:\\n\\n### Code (Python)\\n\\n```python\\ndef greet(name):\\n return f\\\"Hello, {name}!\\\"\\n\\nprint(greet(\\\"World\\\"))\\n```\\n\\n### JSON\\n\\n```json\\n{\\n \\\"greeting\\\": \\\"Hello\\\",\\n \\\"target\\\": \\\"World\\\",\\n \\\"language\\\": \\\"English\\\"\\n}\\n```\\n\\n### SPARQL Query\\n\\n```sparql\\nSELECT ?person ?name\\nWHERE {\\n ?person a ex:Person .\\n ?person ex:hasName ?name .\\n}\\nLIMIT 10\\n```\\n\\nThis example demonstrates a simple Python function for greeting, a JSON object representing a greeting structure, and a SPARQL query to retrieve names of persons from a dataset.\",\n timestamp: Math.floor(Date.now() / 1000),\n name: null\n },\n {\n id: \"msg_Bn07kVDCYT1qmgu1G7Zw0KNeс_\" + Date.now(),\n conversationId: askRequestData.conversationId,\n role: CHAT_MESSAGE_ROLE.ASSISTANT,\n agentId: askRequestData.agentId,\n message: `Reply to '${askRequestData.question}' It seems there was an error with the query. Let me rectify this and try again.`,\n timestamp: Math.floor(Date.now() / 1000),\n name: null\n }\n ]\n };\n\n if (conversation) {\n conversation.messages.push(question);\n conversation.messages.push(...answer.messages);\n }\n return new Promise((resolve) => setTimeout(() => resolve({data: answer}), ASK_DELAY));\n // return new Promise((resolve, reject) => setTimeout(() => reject(''), ASK_DELAY));\n }\n\n continueChatRun(data) {\n alert(\"continueChatRun() not implemented\");\n }\n\n deleteConversation(id) {\n this.conversations = this.conversations.filter((conversation) => conversation.id !== id);\n return new Promise((resolve) => setTimeout(() => resolve(), DELETE_DELAY));\n }\n\n createConversation(data) {\n const conversation = {\n id: `thread_${this.conversations.length}`,\n name: `Thread ${this.conversations.length}`,\n timestamp: Math.floor(Date.now() / 1000),\n messages: []\n };\n this.conversations.unshift(conversation);\n\n const askRequestData = cloneDeep(data);\n askRequestData.conversationId = conversation.id;\n return this.askQuestion(askRequestData);\n }\n\n getAgents() {\n return new Promise((resolve) => setTimeout(() => resolve({data: [...agentsList]}), LOAD_AGENTS_DELAY));\n }\n\n getAgent(id) {\n return Promise.resolve({data: cloneDeep(agentsList.find((agent) => agent.id === id))});\n }\n\n createAgent(agent) {\n if (agent.name === 'err') {\n return new Promise((resolve, reject) => setTimeout(() => reject({status: 500, message: 'Internal Server Error'}), CREATE_AGENT_DELAY));\n }\n agentsList.push(agent);\n return new Promise((resolve) => setTimeout(() => resolve({data: agent}), CREATE_AGENT_DELAY));\n }\n\n editAgent(editedAgent) {\n if (editedAgent.name === 'err') {\n return new Promise((resolve, reject) => setTimeout(() => reject({status: 500, message: 'Internal Server Error'}), EDIT_AGENT_DELAY));\n }\n agentsList = agentsList.map((agent) => agent.id === editedAgent.id ? editedAgent : agent);\n return new Promise((resolve) => setTimeout(() => resolve({data: editedAgent}), CREATE_AGENT_DELAY));\n }\n\n deleteAgent(id) {\n agentsList = agentsList.filter((agent) => agent.id !== id);\n return Promise.resolve();\n // return new Promise((resolve) => {\n // setTimeout(() => resolve(), 5000);\n // });\n }\n\n getAgentDefaultValues() {\n return Promise.resolve({data: defaultAgentValues});\n }\n\n explainAgentSettings() {\n return Promise.resolve({data: {}});\n }\n\n // Simulate an HTTP error\n simulateHttpError() {\n return Promise.reject({\n status: 500,\n message: 'Internal Server Error'\n });\n }\n\n explainResponse(data) {\n return Promise.resolve({data: {\n conversationId: data.conversationId,\n answerId: data.answerId,\n queryMethods: [\n {\n name: \"sparql_query\",\n rawQuery: \"SELECT ?character ?name ?height WHERE {\\n ?character a voc:Character;\\n rdfs:label ?name;\\n voc:height ?height.\\n FILTER(?name = \\\"Luke Skywalker\\\" || ?name = \\\"Leia Organa\\\")\\n}\",\n query: \"SELECT ?character ?name ?height WHERE {\\n ?character a voc:Character;\\n rdfs:label ?name;\\n voc:height ?height.\\n FILTER(?name = \\\"Luke Skywalker\\\" || ?name = \\\"Leia Organa\\\")\\n}\",\n queryType: \"sparql\",\n errorOutput: \"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:Character' uses an undefined prefix\"\n }, {\n name: \"retrieval_search\",\n rawQuery: \"{\\\"queries\\\":[{\\\"query\\\":\\\"pilots that work with Luke Skywalker\\\",\\\"filter\\\":{\\\"document_id\\\":\\\"https://swapi.co/resource/human/1\\\"},\\\"top_k\\\":3}]}\",\n query: \"{\\n \\\"queries\\\" : [ {\\n \\\"query\\\" : \\\"pilots that work with Luke Skywalker\\\",\\n \\\"filter\\\" : {\\n \\\"document_id\\\" : \\\"https://swapi.co/resource/human/1\\\"\\n },\\n \\\"top_k\\\" : 3\\n } ]\\n}\",\n queryType: \"json\",\n errorOutput: null\n },\n {\n name: \"iri_discovery\",\n rawQuery: \"Luke Skywalker\",\n query: \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\\nPREFIX onto: <http://www.ontotext.com/>\\nSELECT ?label ?iri {\\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\\n ?iri rdfs:label|skos:prefLabel ?label .\\n}\",\n queryType: \"sparql\",\n errorOutput: null\n },\n {\n name: \"sparql_query\",\n rawQuery: \"SELECT ?height WHERE {\\n <https://swapi.co/resource/human/1> voc:height ?height.\\n}\",\n query: \"SELECT ?height WHERE {\\n <https://swapi.co/resource/human/1> voc:height ?height.\\n}\",\n queryType: \"sparql\",\n errorOutput: \"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:height' uses an undefined prefix\"\n },\n {\n name: \"sparql_query\",\n rawQuery: \"PREFIX voc: <https://swapi.co/vocabulary/>\\nSELECT ?name ?height WHERE {\\n ?character voc:height ?height;\\n rdfs:label ?name.\\n FILTER(?name = \\\"Luke Skywalker\\\" || ?name = \\\"Leia Organa\\\")\\n}\",\n query: \"PREFIX voc: <https://swapi.co/vocabulary/>\\nSELECT ?name ?height WHERE {\\n ?character voc:height ?height;\\n rdfs:label ?name.\\n FILTER(?name = \\\"Luke Skywalker\\\" || ?name = \\\"Leia Organa\\\")\\n}\",\n queryType: \"sparql\",\n errorOutput: null\n },\n {\n name: 'fts_search',\n rawQuery: 'Second Luke',\n query: 'PREFIX onto: <http://www.ontotext.com/>\\nDESCRIBE ?iri {\\n\\t?x onto:fts \\'\\'\\'Second Luke\\'\\'\\' .\\n\\t{\\n\\t\\t?x ?p ?iri .\\n\\t} union {\\n\\t\\t?iri ?p ?x .\\n\\t}\\n}',\n queryType: \"sparql\",\n errorOutput: null\n }, {\n name: 'similarity_search',\n rawQuery: 'Second Luke',\n query: 'PREFIX onto: <http://www.ontotext.com/>\\nDESCRIBE ?iri {\\n\\t?x onto:fts \\'\\'\\'Second Luke\\'\\'\\' .\\n\\t{\\n\\t\\t?x ?p ?iri .\\n\\t} union {\\n\\t\\t?iri ?p ?x .\\n\\t}\\n}',\n queryType: \"sparql\",\n errorOutput: null\n }, {\n name: \"iri_discovery\",\n rawQuery: \"Luke Skywalker\",\n query: \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\\nPREFIX onto: <http://www.ontotext.com/>\\nSELECT ?label ?iri {\\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\\n ?iri rdfs:label|skos:prefLabel ?label .\\n}\",\n queryType: \"sparql\",\n errorOutput: null\n }, {\n name: \"sparql_query\",\n rawQuery: \"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }\",\n query: \"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }\",\n queryType: \"sparql\",\n errorOutput: \"Error: java.lang.IllegalArgumentException: The following IRIs are not used in the data stored in GraphDB: https://swapi.co/vocabulary/name\"\n }, {\n name: \"sparql_query\",\n rawQuery: \"SELECT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }\",\n query: \"SELEdCT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }\",\n queryType: \"sparql\",\n errorOutput: null\n }\n ]\n }});\n }\n}\n\nconst conversationList = [\n {\n \"id\": \"thread_jdQBvbkaU6JPoO48oFbC54dA\",\n \"name\": \"Very long chat name which does not fit in the sidebar\",\n \"timestamp\": 1725235200,\n \"messages\": []\n },\n {\n \"id\": \"thread_jdQBvbkaU6JPoO48oQaL76dB\",\n \"name\": \"Test chat 2\",\n \"timestamp\": 1725238800,\n \"messages\": []\n },\n {\n \"id\": \"thread_jdQBvbkaU6JPoO48oQaL76dC\",\n \"name\": \"Test chat 3\",\n \"timestamp\": 1725242400,\n \"messages\": []\n },\n {\n \"id\": \"thread_jdQBvbkaU6JPoO48oFbC54dD\",\n \"name\": \"Test chat 4\",\n \"timestamp\": 1697331600,\n \"messages\": []\n }\n];\n\nlet agentsList = [\n {\n \"id\": \"asst_gAPcrHQQ9ZIxD5eXWH2BNFfo\",\n \"name\": \"agent-1\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": 'starwars',\n \"instructions\": {\n \"systemInstruction\": \"\\n\\n\",\n \"userInstruction\": \"\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_qMyCpCBmqxV9I2B8UoMfFzc5\",\n \"name\": \"agent-2\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": \"Non existing repo\",\n \"instructions\": {\n \"systemInstruction\": \"string\\n\\nstring\",\n \"userInstruction\": \"string\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_Cr0RxobrY07WpOvvyQilEWMI\",\n \"name\": \"Databricks-general-unbiased\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"temperature\": 1.0,\n \"topP\": 1.0,\n \"seed\": null,\n \"repositoryId\": 'starwars',\n \"instructions\": {\n \"systemInstruction\": \"You are helpful assistant in discovering information regarding diagnostic biomarkers.\",\n \"userInstruction\": null\n },\n \"assistantExtractionMethods\": [],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_5GxNYTdaOh7Tl6lLl6Pya2aH\",\n \"name\": \"Databricks-biomarkers\",\n \"model\": \"gpt-3.5-turbo-0125\",\n \"temperature\": 1.0,\n \"topP\": 1.0,\n \"seed\": null,\n \"repositoryId\": 'biomarkers',\n \"instructions\": {\n \"systemInstruction\": \"You're a helpful assistant in discovering new diagnostic biomarkers for given diseases. I'll submit a set of publication abstracts discussing given disease and your task is to find in the abstracts any potential new biomarkers which are not yet listed in the appropriate databases. Each abstract is preceded by identifier - its PubMed id called for short PMID. \\n\\nReturn the set of biomarkers listed one per row, each marker followed by the | and PMID of the respective abstract if was mentioned in.\\n\\nExample: \\nInput: 36418457\\t[Amyotrophic lateral sclerosis (ALS) is a genetically and phenotypically heterogeneous disease results in the loss of motor neurons. Mounting information points to involvement of other systems including cognitive impairment. However, neither the valid biomarker for diagnosis nor effective therapeutic intervention is available for ALS. The present study is aimed at identifying potentially genetic biomarker that improves the diagnosis and treatment of ALS patients based on the data of the Gene Expression Omnibus. We retrieved datasets and conducted a weighted gene co-expression network analysis (WGCNA) to identify ALS-related co-expression genes. Functional enrichment analysis was performed to determine the features and pathways of the main modules. We then constructed an ALS-related model using the least absolute shrinkage and selection operator (LASSO) regression analysis and verified the model by the receiver operating characteristic (ROC) curve. Besides we screened the non-preserved gene modules in FTD and ALS-mimic disorders to distinct ALS-related genes from disorders with overlapping genes and features. Altogether, 4198 common genes between datasets with the most variation were analyzed and 16 distinct modules were identified through WGCNA. Blue module had the most correlation with ALS and functionally enriched in pathways of neurodegeneration-multiple diseases', 'amyotrophic lateral sclerosis', and 'endocytosis' KEGG terms. Further, some of other modules related to ALS were enriched in 'autophagy' and 'amyotrophic lateral sclerosis'. The 30 top of hub genes were recruited to a LASSO regression model and 5 genes (BCLAF1, GNA13, ARL6IP5, ARGLU1, and YPEL5) were identified as potentially diagnostic ALS biomarkers with validating of the ROC curve and AUC value.]\\n\\nYour response: BCLAF1|36418457\\nGNA13|36418457\\nARL6IP5|36418457\\nARGLU1|36418457\\nYPEL5|36418457\",\n \"userInstruction\": null\n },\n \"assistantExtractionMethods\": [],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_qMyCpCBmqxV9I2B8UoMfFzc555\",\n \"name\": \"agent with long name long long long long long long long long long long long long\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": \"Non existing repo\",\n \"instructions\": {\n \"systemInstruction\": \"string\\n\\nstring\",\n \"userInstruction\": \"string\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_qMyCpCBmqxV9I2B8UoMfFzcр555\",\n \"name\": \"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": \"Non existing repo\",\n \"instructions\": {\n \"systemInstruction\": \"string\\n\\nstring\",\n \"userInstruction\": \"string\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_qMyCpCBmqxV9I2B8UoMfFzc55д5\",\n \"name\": \"agent with long name long long long long long long long long long long long long\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": \"starwars\",\n \"instructions\": {\n \"systemInstruction\": \"string\\n\\nstring\",\n \"userInstruction\": \"string\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n },\n {\n \"id\": \"asst_qMyCpCBmqxV9I2B8UoMfFzcя555\",\n \"name\": \"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long\",\n \"model\": \"gpt-4o\",\n \"temperature\": 0.0,\n \"topP\": 0.0,\n \"seed\": null,\n \"repositoryId\": \"starwars\",\n \"instructions\": {\n \"systemInstruction\": \"string\\n\\nstring\",\n \"userInstruction\": \"string\"\n },\n \"assistantExtractionMethods\": [\n {\n \"ftsMethod\": \"fts_search\"\n }\n ],\n \"maxNumberOfTriplesPerCall\": null\n }\n];\n\nconst defaultAgentValues = {\n \"id\": \"id\",\n \"name\": \"Quadro\",\n \"model\": \"gpt-4o\",\n \"api\": \"openai-completions\",\n \"contextSize\": 128000,\n \"temperature\": 0.7,\n \"topP\": 1,\n \"seed\": 0,\n \"repositoryId\": \"test-repository\",\n \"instructions\": {\n \"systemInstruction\": \"You are a helpful, knowledgeable, and friendly assistant. Your goal is to provide clear and accurate information while being polite, respectful, and professional.\",\n \"userInstruction\": \"If you need to write a SPARQL query, use only the classes and properties provided in the schema and don't invent or guess any. Always try to return human-readable names or labels and not only the IRIs. If SPARQL fails to provide the necessary information you can try another tool too.\"\n },\n \"assistantExtractionMethods\": [\n {\n \"method\": \"sparql_search\",\n \"ontologyGraph\": \"http://example.com\",\n \"sparqlQuery\": \"CONSTRUCT {?s ?p ?o} WHERE {GRAPH <http://example.org/ontology> {?s ?p ?o .}}\"\n },\n {\n \"method\": \"fts_search\",\n \"maxNumberOfTriplesPerCall\": 0\n },\n {\n \"method\": \"similarity_search\",\n \"similarityIndex\": \"similarity-index\",\n \"similarityIndexThreshold\": 0.6,\n \"maxNumberOfTriplesPerCall\": 0\n },\n {\n \"method\": \"retrieval_search\",\n \"retrievalConnectorInstance\": \"retrieval-connector\",\n \"queryTemplate\": \"{\\\"query\\\": \\\"string\\\"}\",\n \"maxNumberOfTriplesPerCall\": 0\n }\n ],\n \"additionalExtractionMethods\": [\n {\n \"method\": \"iri_discovery_search\"\n }\n ]\n};\n"],"names":["ChatMessageModel","constructor","data","this","_id","id","_role","role","_message","message","_timestamp","timestamp","tokenUsageInfo","value","CHAT_MESSAGE_ROLE","USER","ASSISTANT","CREATE_AGENT_DELAY","TtygRestServiceFakeBackend","conversations","conversationList","getConversations","Promise","resolve","setTimeout","cloneDeep","getConversation","find","conversation","renameConversation","name","exportConversation","console","log","askQuestion","askRequestData","question","conversationId","agentId","Math","floor","Date","now","answer","messages","push","continueChatRun","alert","deleteConversation","filter","createConversation","length","unshift","getAgents","agentsList","getAgent","agent","createAgent","reject","status","editAgent","editedAgent","map","deleteAgent","getAgentDefaultValues","defaultAgentValues","explainAgentSettings","simulateHttpError","explainResponse","answerId","queryMethods","rawQuery","query","queryType","errorOutput"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=75849;export const __webpack_ids__=[75849];export const __webpack_modules__={75849:(t,a,e)=>{e.r(a),e.d(a,{default:()=>n});const n='<link href="css/ttyg/chat-list.css?v=3.2.0-TR2" rel="stylesheet"/> <div class="chat-list-component"> <div class="chat-list"> <div ng-repeat="chatGroup in chatList.chatsByDay" class="chat-group"> <label>{{ getHumanReadableChatGroupTimestamp(chatGroup.timestamp) }}</label> <ul> <li ng-repeat="chat in chatGroup.chats track by chat.hash" class="chat-item" ng-class="{\'selected\': chat.id === selectedChat.id, \'edited\': renamedChat && chat.id === renamedChat.id}"> <div ng-if="!deletingChat || deletingChat.chatId !== chat.id" class="chat-detail"> <div class="chat-name"> <inline-editable-text field-name="name" source="chat" is-editing="chat.id && renamedChat && chat.id === renamedChat.id" on-save="onRenameChat(newText, source)" on-cancel="onCancelChatRenaming()" on-dblclick="onSelectChatForRenaming(chat)" on-click="onSelectChat(source)" title="{{chat.name}}" show-tooltip-on-overflow> </inline-editable-text> </div> <div ng-if="chat.id && (!renamedChat || chat.id !== renamedChat.id)" class="btn-group"> <button class="btn btn-link secondary btn-sm open-chat-actions-btn" data-toggle="dropdown" aria-expanded="false" ng-if="true" ng-click="openChatActionMenu()" ng-disabled="false"> <i class="fa fa-ellipsis"></i> </button> <div class="dropdown-menu dropdown-menu-right chat-actions-menu"> <button class="dropdown-item export-chat-btn" type="button" ng-click="onExportChat(chat)"> <i class="fa fa-arrow-down-to-line"></i> <span>{{\'ttyg.chat.btn.export_chat.label\' | translate}}</span> </button> <button class="dropdown-item rename-chat-btn" type="button" ng-click="onSelectChatForRenaming(chat)"> <i class="fa fa-pen"></i> <span>{{\'ttyg.chat.btn.rename_chat.label\' | translate}}</span> </button> <div class="dropdown-divider"></div> <button class="dropdown-item delete-chat-btn" type="button" ng-click="onDeleteChat(chat)"> <i class="fa fa-trash-can"></i> <span>{{\'ttyg.chat.btn.delete_chat.label\' | translate}}</span> </button> </div> </div> </div> <div class="deleting-chat-loader" ng-if="deletingChat && deletingChat.chatId === chat.id && deletingChat.inProgress" onto-loader-fancy message="{{\'ttyg.chat.deleting_chat\' | translate}}" size="25"></div> </li> </ul> </div> </div> </div> '}};
2
- //# sourceMappingURL=75849.bd0bdefa903741034a71.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"75849.bd0bdefa903741034a71.bundle.js","mappings":"uJAGA,QAFW,2pE","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/templates/chat-list.html"],"sourcesContent":["// Module\nvar code = `<link href=\"css/ttyg/chat-list.css?v=3.2.0-TR2\" rel=\"stylesheet\"/> <div class=\"chat-list-component\"> <div class=\"chat-list\"> <div ng-repeat=\"chatGroup in chatList.chatsByDay\" class=\"chat-group\"> <label>{{ getHumanReadableChatGroupTimestamp(chatGroup.timestamp) }}</label> <ul> <li ng-repeat=\"chat in chatGroup.chats track by chat.hash\" class=\"chat-item\" ng-class=\"{'selected': chat.id === selectedChat.id, 'edited': renamedChat && chat.id === renamedChat.id}\"> <div ng-if=\"!deletingChat || deletingChat.chatId !== chat.id\" class=\"chat-detail\"> <div class=\"chat-name\"> <inline-editable-text field-name=\"name\" source=\"chat\" is-editing=\"chat.id && renamedChat && chat.id === renamedChat.id\" on-save=\"onRenameChat(newText, source)\" on-cancel=\"onCancelChatRenaming()\" on-dblclick=\"onSelectChatForRenaming(chat)\" on-click=\"onSelectChat(source)\" title=\"{{chat.name}}\" show-tooltip-on-overflow> </inline-editable-text> </div> <div ng-if=\"chat.id && (!renamedChat || chat.id !== renamedChat.id)\" class=\"btn-group\"> <button class=\"btn btn-link secondary btn-sm open-chat-actions-btn\" data-toggle=\"dropdown\" aria-expanded=\"false\" ng-if=\"true\" ng-click=\"openChatActionMenu()\" ng-disabled=\"false\"> <i class=\"fa fa-ellipsis\"></i> </button> <div class=\"dropdown-menu dropdown-menu-right chat-actions-menu\"> <button class=\"dropdown-item export-chat-btn\" type=\"button\" ng-click=\"onExportChat(chat)\"> <i class=\"fa fa-arrow-down-to-line\"></i> <span>{{'ttyg.chat.btn.export_chat.label' | translate}}</span> </button> <button class=\"dropdown-item rename-chat-btn\" type=\"button\" ng-click=\"onSelectChatForRenaming(chat)\"> <i class=\"fa fa-pen\"></i> <span>{{'ttyg.chat.btn.rename_chat.label' | translate}}</span> </button> <div class=\"dropdown-divider\"></div> <button class=\"dropdown-item delete-chat-btn\" type=\"button\" ng-click=\"onDeleteChat(chat)\"> <i class=\"fa fa-trash-can\"></i> <span>{{'ttyg.chat.btn.delete_chat.label' | translate}}</span> </button> </div> </div> </div> <div class=\"deleting-chat-loader\" ng-if=\"deletingChat && deletingChat.chatId === chat.id && deletingChat.inProgress\" onto-loader-fancy message=\"{{'ttyg.chat.deleting_chat' | translate}}\" size=\"25\"></div> </li> </ul> </div> </div> </div> `;\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=7928;export const __webpack_ids__=[7928,49539,71920];export const __webpack_modules__={7928:(e,t,n)=>{n.r(t);var E=n(71920),a=n(76076);function T(e,t){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:n=>{n.canModifyAgent=!1,n.talkToGraphDocumentationLink=a.DocumentationUrlResolver.getDocumentationUrl(t.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=()=>{e.emit(E.TTYGEventName.OPEN_AGENT_SETTINGS)};const T=[];T.push(e.onCanUpdateAgentUpdated(e=>{n.canModifyAgent=e})),n.$on("$destroy",()=>{T.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",T),T.$inject=["TTYGContextService","productInfo"]},71920:(e,t,n)=>{n.r(t),n.d(t,{TTYGEventName:()=>T});var E=n(98980);function a(e){let t,n,a,A,_,o={},C=!1;const c=()=>(0,E.cloneDeep)(t),i=()=>(0,E.cloneDeep)(n),d=e=>{n=(0,E.cloneDeep)(e),p(T.CHAT_LIST_UPDATED,i())},l=()=>(0,E.cloneDeep)(a),s=()=>(0,E.cloneDeep)(A),D=()=>(0,E.cloneDeep)(o),r=e=>!!o[e],S=()=>C,p=(t,n)=>{e.emitSync(t,(0,E.cloneDeep)(n))},g=(t,n)=>e.subscribeSync(t,e=>n(e));return{resetContext:()=>{t=void 0,n=void 0,a=void 0,A=void 0,o={},_=void 0,C=!1},emit:p,subscribe:g,getChats:i,updateChats:d,addChat:e=>{n.appendChat(e),d(n)},replaceChat:(e,t)=>{n.replaceChat(e,t),d(n)},onChatsListChanged:e=>(n&&angular.isFunction(e)&&e(i()),g(T.CHAT_LIST_UPDATED,t=>e(t))),getSelectedChat:l,selectChat:e=>{a&&a.id===e.id||(a=(0,E.cloneDeep)(e),p(T.SELECT_CHAT,l()))},deselectChat:()=>{a=void 0,p(T.SELECT_CHAT,l())},deleteChat:e=>{n.deleteChat(e),d(n)},onSelectedChatChanged:e=>(angular.isFunction(e)&&e(l()),g(T.SELECT_CHAT,t=>e(t))),updateSelectedChat:e=>{a&&a.id&&e&&a.id!==e.id||(a=(0,E.cloneDeep)(e),p(T.SELECTED_CHAT_UPDATED,l()))},onSelectedChatUpdated:e=>(a&&angular.isFunction(e)&&e(l()),g(T.SELECTED_CHAT_UPDATED,t=>e(t))),onLastMessageReceived:e=>(a&&angular.isFunction(e)&&e(l()),g(T.LAST_MESSAGE_RECEIVED,t=>e(t))),updateAgents:e=>{t=(0,E.cloneDeep)(e),p(T.AGENT_LIST_UPDATED,c())},onAgentsListChanged:e=>(t&&angular.isFunction(e)&&e(c()),g(T.AGENT_LIST_UPDATED,t=>e(t))),getAgents:c,getAgent:e=>{if(t)return(0,E.cloneDeep)(t.getAgent(e))},selectAgent:e=>{A=(0,E.cloneDeep)(e),p(T.AGENT_SELECTED,s())},getSelectedAgent:s,onSelectedAgentChanged:e=>(A&&angular.isFunction(e)&&e(s()),g(T.AGENT_SELECTED,t=>e(t))),getDefaultAgent:()=>(0,E.cloneDeep)(_),setDefaultAgent:e=>{_=e},setCanModifyAgent:e=>{C=(0,E.cloneDeep)(e),p(T.CAN_MODIFY_AGENT_UPDATED,S())},getCanModifyAgent:S,onCanUpdateAgentUpdated:e=>(angular.isFunction(e)&&e(S()),g(T.CAN_MODIFY_AGENT_UPDATED,t=>e(t))),hasExplainResponse:r,toggleExplainResponse:e=>{r(e)&&(o[e].expanded=!o[e].expanded,p(T.EXPLAIN_RESPONSE_CACHE_UPDATED,D()))},getExplainResponse:e=>(0,E.cloneDeep)(o[e]),addExplainResponseCache:e=>{o[e.answerId]=(0,E.cloneDeep)(e),p(T.EXPLAIN_RESPONSE_CACHE_UPDATED,D())},onExplainResponseCacheUpdated:e=>(angular.isFunction(e)&&e(D()),g(T.EXPLAIN_RESPONSE_CACHE_UPDATED,t=>e(t)))}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",a),a.$inject=["EventEmitterService","TTYGService"];const T={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",GO_TO_AUTOCOMPLETE_INDEX_VIEW:"goToAutocompleteIndexView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}}};
2
- //# sourceMappingURL=7928.7900a3911c83495d74dd.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"7928.7900a3911c83495d74dd.bundle.js","mappings":"mKASA,SAASA,EA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BAAwB,cAKxBC,oBAAqB,qBAErBC,YAAa,aACbC,uBAAwB,cACxBC,oBAAqB,qBAKrBvC,YAAa,aAKbM,sBAAuB,oBAKvBG,sBAAuB,sBAMvB+B,cAAe,eAKfC,YAAa,aAKbC,uBAAwB,cASxBC,oBAAqB,qBAErBC,YAAa,aACbC,uBAAwB,oBACxBC,oBAAqB,oBACrBvE,kBAAmB,kBAKnBwE,aAAc,cAKdC,qBAAsB,qBAKtBC,kBAAmB,kBAKnBC,WAAY,YACZC,qBAAsB,kBACtBC,kBAAmB,kBAEnBxC,mBAAoB,mBAMpB9D,oBAAqB,oBAKrBuG,WAAY,YAKZC,YAAa,aAKbC,aAAc,cAKdC,cAAe,eAMfC,eAAgB,gBAKhBvC,eAAgB,gBAKhBwC,6BAA8B,2BAK9BC,sBAAuB,qBAKvBC,8BAA+B,4BAK/BC,iBAAkB,kBAKlBlC,+BAAgC,8BAKhCmC,oBAAqB,0BAErBtC,yBAA0B,wB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/no-agents-view.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-context.service.js"],"sourcesContent":["import {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {DocumentationUrlResolver} from \"../../utils/documentation-url-resolver\";\n\nangular\n .module('graphdb.framework.ttyg.directives.no-agents-view', [])\n .directive('noAgentsView', NoAgentsView);\n\nNoAgentsView.$inject = ['TTYGContextService', 'productInfo'];\n\nfunction NoAgentsView(TTYGContextService, productInfo) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/no-agents-view.html',\n scope: {\n },\n link: ($scope) => {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.canModifyAgent = false;\n $scope.talkToGraphDocumentationLink = DocumentationUrlResolver.getDocumentationUrl(productInfo.productShortVersion, 'talk-to-graph.html');\n\n // =========================\n // Public functions\n // =========================\n\n $scope.onCreateAgent = () => {\n TTYGContextService.emit(TTYGEventName.OPEN_AGENT_SETTINGS);\n };\n\n // =========================\n // Private functions\n // =========================\n\n const onCanUpdateAgentUpdated = (canModifyAgent) => {\n $scope.canModifyAgent = canModifyAgent;\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const onDestroy = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n subscriptions.push(TTYGContextService.onCanUpdateAgentUpdated(onCanUpdateAgentUpdated));\n $scope.$on('$destroy', onDestroy);\n }\n };\n}\n","import {cloneDeep} from 'lodash';\n\nangular\n .module('graphdb.framework.ttyg.services.ttygcontext', [])\n .factory('TTYGContextService', TTYGContextService);\n\nTTYGContextService.$inject = ['EventEmitterService', 'TTYGService'];\n\nfunction TTYGContextService(EventEmitterService) {\n\n /**\n * The list of agents.\n * @type {AgentListModel}\n * @private\n */\n let _agents = undefined;\n\n /**\n * The ChatsListModel.\n * @type {ChatsListModel}\n * @private\n */\n let _chats = undefined;\n\n /**\n * The currently selected in the UI chat which is used for conversation.\n * @type {ChatModel|undefined}\n * @private\n */\n let _selectedChat = undefined;\n\n /**\n * The currently selected in the UI agent which is used for conversation.\n * @type {AgentModel|undefined}\n * @private\n */\n let _selectedAgent = undefined;\n\n /**\n * Stores information about loaded explain responses.\n * The key is the answer ID, and the value is an instance of {@see ExplainResponseModel} that holds the explanation message.\n *\n * @type {{[key: string]: ExplainResponseModel}}\n */\n let _explainCache = {};\n\n /**\n * The default agent values.\n * @type {AgentModel|undefined}\n * @private\n */\n let _defaultAgent = undefined;\n\n let _canModifyAgent = false;\n\n const resetContext = () => {\n _agents = undefined;\n _chats = undefined;\n _selectedChat = undefined;\n _selectedAgent = undefined;\n _explainCache = {};\n _defaultAgent = undefined;\n _canModifyAgent = false;\n };\n\n /**\n * @return {Promise<AgentModel>}\n */\n const getDefaultAgent = () => {\n return cloneDeep(_defaultAgent);\n };\n\n const setDefaultAgent = (agent) => {\n _defaultAgent = agent;\n };\n\n /**\n * @return {AgentListModel}\n */\n const getAgents = () => {\n return cloneDeep(_agents);\n };\n\n const getAgent = (agentId) => {\n if (_agents) {\n return cloneDeep(_agents.getAgent(agentId));\n }\n };\n\n /**\n * @return {ChatsListModel}\n */\n const getChats = () => {\n return cloneDeep(_chats);\n };\n\n /**\n * @param {ChatsListModel} chats\n */\n const updateChats = (chats) => {\n _chats = cloneDeep(chats);\n emit(TTYGEventName.CHAT_LIST_UPDATED, getChats());\n };\n\n /**\n * Deletes the chat with the provided <code>chatId</code>.\n * @param {ChatModel} chat\n */\n const deleteChat = (chat) => {\n _chats.deleteChat(chat);\n updateChats(_chats);\n };\n\n const addChat = (newChat) => {\n _chats.appendChat(newChat);\n updateChats(_chats);\n };\n\n const replaceChat = (newChat, oldChat) => {\n _chats.replaceChat(newChat, oldChat);\n updateChats(_chats);\n };\n\n /** Subscribes to the 'chatListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onChatsListChanged = (callback) => {\n if (_chats && angular.isFunction(callback)) {\n callback(getChats());\n }\n return subscribe(TTYGEventName.CHAT_LIST_UPDATED, (chats) => callback(chats));\n };\n\n /**\n * @return {ChatModel}\n */\n const getSelectedChat = () => {\n return cloneDeep(_selectedChat);\n };\n\n /**\n * Updates the selected chat with the provided <code>selectedChat</code> and emits the 'selectChat' event\n * to notify listeners that a new chat has been selected.\n *\n * @param {ChatModel} selectedChat - The chat object to select.\n */\n const selectChat = (selectedChat) => {\n if (!_selectedChat || _selectedChat.id !== selectedChat.id) {\n _selectedChat = cloneDeep(selectedChat);\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n }\n };\n\n const deselectChat = () => {\n _selectedChat = undefined;\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n };\n\n /**\n * Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatChanged = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECT_CHAT, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the selected chat and emits the 'selectChatUpdated' event to notify listeners that a property\n * of the selected chat has changed.\n *\n * If the ID of the passed chat differs from the current selected chat, no action will occur.\n *\n * The selected chat can be updated through {@link TTYGContextService#selectChat}.\n *\n * @param {ChatModel} chat - The chat object that is being updated.\n */\n const updateSelectedChat = (chat) => {\n if (!_selectedChat || !_selectedChat.id || !chat || _selectedChat.id === chat.id) {\n _selectedChat = cloneDeep(chat);\n emit(TTYGEventName.SELECTED_CHAT_UPDATED, getSelectedChat());\n }\n };\n\n /** Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatUpdated = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECTED_CHAT_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /** Subscribes to the 'lastMessageReceived' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onLastMessageReceived = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.LAST_MESSAGE_RECEIVED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @param {AgentListModel} agents\n */\n const updateAgents = (agents) => {\n _agents = cloneDeep(agents);\n emit(TTYGEventName.AGENT_LIST_UPDATED, getAgents());\n };\n\n /**\n * Subscribes to the 'agentListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onAgentsListChanged = (callback) => {\n if (_agents && angular.isFunction(callback)) {\n callback(getAgents());\n }\n return subscribe(TTYGEventName.AGENT_LIST_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @return {AgentModel}\n */\n const getSelectedAgent = () => {\n return cloneDeep(_selectedAgent);\n };\n\n /**\n * Updates the selected agent with the provided <code>selectedAgent</code> and emits the 'agentSelected' event\n * to notify listeners that a new agent has been selected.\n *\n * @param {AgentModel} selectedAgent - The instance of selected agent.\n */\n const selectAgent = (selectedAgent) => {\n _selectedAgent = cloneDeep(selectedAgent);\n emit(TTYGEventName.AGENT_SELECTED, getSelectedAgent());\n };\n\n const _getExplainResponseCache = () => {\n return cloneDeep(_explainCache);\n };\n\n /**\n * Gets the explain response.\n * @param {string} answerId\n * @return {ExplainResponseModel}\n */\n const getExplainResponse = (answerId) => {\n return cloneDeep(_explainCache[answerId]);\n };\n\n /**\n * Adds the <code>explainResponse</code> into the explain response cache.\n *\n * @param {ExplainResponseModel} explainResponse\n */\n const addExplainResponseCache = (explainResponse) => {\n _explainCache[explainResponse.answerId] = cloneDeep(explainResponse);\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n };\n\n const hasExplainResponse = (answerId) => {\n return !!_explainCache[answerId];\n };\n\n const toggleExplainResponse = (answerId) => {\n if (hasExplainResponse(answerId)) {\n _explainCache[answerId].expanded = !_explainCache[answerId].expanded;\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n }\n };\n\n /**\n * Subscribes to the 'explainResponseCacheUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onExplainResponseCacheUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(_getExplainResponseCache());\n }\n return subscribe(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, (explainResponses) => callback(explainResponses));\n };\n\n /**\n * Subscribes to the 'agentSelected' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedAgentChanged = (callback) => {\n if (_selectedAgent && angular.isFunction(callback)) {\n callback(getSelectedAgent());\n }\n return subscribe(TTYGEventName.AGENT_SELECTED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the \"canModifyAgent\" flag and emits the 'canModifyAgentUpdated' event to notify listeners that the canModifyAgent flag is changed.\n *\n * @param {boolean} canModifyAgent\n */\n const setCanModifyAgent = (canModifyAgent) => {\n _canModifyAgent = cloneDeep(canModifyAgent);\n emit(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, getCanModifyAgent());\n };\n\n const getCanModifyAgent = () => {\n return _canModifyAgent;\n };\n\n /**\n * Subscribes to the 'canModifyAgentUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onCanUpdateAgentUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getCanModifyAgent());\n }\n return subscribe(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, (canModifyAgent) => callback(canModifyAgent));\n };\n\n /**\n * Emits an event with a deep-cloned payload using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to emit. It must be a value from {@link TTYGEventName}.\n * @param {*} payload - The data to emit with the event. The payload is deep-cloned before emission.\n */\n const emit = (tTYGEventName, payload) => {\n EventEmitterService.emitSync(tTYGEventName, cloneDeep(payload));\n };\n\n /**\n * Subscribes to an event with the specified callback using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to subscribe to. It must be a value from {@link TTYGEventName}.\n * @param {function} callback - The function to call when the event is emitted.\n * @return {function} - Returns a function that can be called to unsubscribe from the event.\n */\n const subscribe = (tTYGEventName, callback) => {\n return EventEmitterService.subscribeSync(tTYGEventName, (payload) => callback(payload));\n };\n\n return {\n resetContext,\n emit,\n subscribe,\n // chats\n getChats,\n updateChats,\n addChat,\n replaceChat,\n onChatsListChanged,\n getSelectedChat,\n selectChat,\n deselectChat,\n deleteChat,\n onSelectedChatChanged,\n updateSelectedChat,\n onSelectedChatUpdated,\n onLastMessageReceived,\n // agents\n updateAgents,\n onAgentsListChanged,\n getAgents,\n getAgent,\n selectAgent,\n getSelectedAgent,\n onSelectedAgentChanged,\n getDefaultAgent,\n setDefaultAgent,\n setCanModifyAgent,\n getCanModifyAgent,\n onCanUpdateAgentUpdated,\n // chat explain\n hasExplainResponse,\n toggleExplainResponse,\n getExplainResponse,\n addExplainResponseCache,\n onExplainResponseCacheUpdated\n };\n}\n\nexport const TTYGEventName = {\n /**\n * Emitting the \"createChat\" event triggers a backend request to create a new chat.\n */\n CREATE_CHAT: 'createChat',\n\n /**\n * This event is emitted when a chat is successfully created.\n */\n CREATE_CHAT_SUCCESSFUL: 'chatCreated',\n\n /**\n * This event is emitted when the creation of a chat fails.\n */\n CREATE_CHAT_FAILURE: 'chatCreationFailed',\n\n RENAME_CHAT: 'renameChat',\n RENAME_CHAT_SUCCESSFUL: 'chatRenamed',\n RENAME_CHAT_FAILURE: 'chatRenamedFailure',\n\n /**\n * Emitting the \"selectChat\" event when the selected chat has been changed.\n */\n SELECT_CHAT: 'selectChat',\n\n /**\n * Emitting the \"selectChatUpdated\" event when the selected chat has been updated.\n */\n SELECTED_CHAT_UPDATED: 'selectChatUpdated',\n\n /**\n * Emitting the \"lastMessageReceived\" event when the final answer message has been received.\n */\n LAST_MESSAGE_RECEIVED: 'lastMessageReceived',\n\n /**\n * This event will be emitted when the chat delete request is in progress. The payload will contain the chat ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_CHAT: 'deletingChat',\n\n /**\n * This event will be emitted when the delete chat process is triggered but before the chat delete request is sent.\n */\n DELETE_CHAT: 'deleteChat',\n\n /**\n * This event will be emitted when the chat was successfully deleted.\n */\n DELETE_CHAT_SUCCESSFUL: 'chatDeleted',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n\n /**\n * This event is emitted when the deletion of a chat fails.\n */\n DELETE_CHAT_FAILURE: 'chatDeletedFailure',\n\n CHAT_EXPORT: 'chatExport',\n CHAT_EXPORT_SUCCESSFUL: 'chatExportSuccess',\n CHAT_EXPORT_FAILURE: 'chatExportFailure',\n CHAT_LIST_UPDATED: 'chatListUpdated',\n\n /**\n * Emitting the \"askQuestion\" event triggers a request to the backend to retrieve an answer to a question.\n */\n ASK_QUESTION: 'askQuestion',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n ASK_QUESTION_FAILURE: 'askQuestionFailure',\n\n /**\n * Emitting the \"continueChatRun\" event triggers a request to the backend to retrieve more remaining answers from the same chat run.\n */\n CONTINUE_CHAT_RUN: 'continueChatRun',\n\n /**\n * Emitting the \"loadChats\" event will trigger an action to loads all chats from backend server.\n */\n LOAD_CHATS: 'loadChats',\n LOAD_CHAT_SUCCESSFUL: 'loadChatSuccess',\n LOAD_CHAT_FAILURE: 'loadChatFailure',\n\n AGENT_LIST_UPDATED: 'agentListUpdated',\n\n /**\n * This event will be emitted when the create agent process is triggered through the UI but before the agent create\n * request is sent. This is used to open the agent settings dialog.\n */\n OPEN_AGENT_SETTINGS: 'openAgentSettings',\n\n /**\n * This event will be emitted when an agent needs to be edited.\n */\n EDIT_AGENT: 'editAgent',\n\n /**\n * This event will be emitted when an agent needs to be cloned.\n */\n CLONE_AGENT: 'cloneAgent',\n\n /**\n * This event will be emitted when the delete agent process is triggered but before the agent delete request is sent.\n */\n DELETE_AGENT: 'deleteAgent',\n\n /**\n * This event will be emitted when the agent was successfully deleted.\n */\n AGENT_DELETED: 'agentDeleted',\n\n /**\n * This event will be emitted when the agent delete request is in progress. The payload will contain the agent ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_AGENT: 'deletingAgent',\n\n /**\n * This event will be emitted when an agent is selected by the user through the UI.\n */\n AGENT_SELECTED: 'agentSelected',\n\n /**\n * This event will trigger the opening of the similarity view.\n */\n GO_TO_CREATE_SIMILARITY_VIEW: \"goToCreateSimilarityView\",\n\n /**\n * This event will trigger the opening of the connectors view.\n */\n GO_TO_CONNECTORS_VIEW: \"goToConnectorsView\",\n\n /**\n * This event will trigger the opening of the \"Autocomplete index\" view.\n */\n GO_TO_AUTOCOMPLETE_INDEX_VIEW: \"goToAutocompleteIndexView\",\n\n /**\n * This event will trigger fetching a new explanation of how the answer was generated.\n */\n EXPLAIN_RESPONSE: \"explainResponse\",\n\n /**\n * This event will be emitted when the cache with explain responses changed.\n */\n EXPLAIN_RESPONSE_CACHE_UPDATED: \"explainResponseCacheUpdated\",\n\n /**\n * This event will trigger the opening of the sparql view.\n */\n GO_TO_SPARQL_EDITOR: \"openQueryInSparqlEditor\",\n\n CAN_MODIFY_AGENT_UPDATED: \"canModifyAgentUpdated\",\n};\n"],"names":["NoAgentsView","TTYGContextService","productInfo","restrict","templateUrl","scope","link","$scope","canModifyAgent","talkToGraphDocumentationLink","DocumentationUrlResolver","getDocumentationUrl","productShortVersion","onCreateAgent","emit","TTYGEventName","OPEN_AGENT_SETTINGS","subscriptions","push","onCanUpdateAgentUpdated","$on","onDestroy","forEach","subscription","angular","module","directive","$inject","EventEmitterService","_agents","_chats","_selectedChat","_selectedAgent","_defaultAgent","_explainCache","_canModifyAgent","getAgents","cloneDeep","getChats","updateChats","chats","CHAT_LIST_UPDATED","getSelectedChat","getSelectedAgent","_getExplainResponseCache","hasExplainResponse","answerId","getCanModifyAgent","tTYGEventName","payload","emitSync","subscribe","callback","subscribeSync","resetContext","undefined","addChat","newChat","appendChat","replaceChat","oldChat","onChatsListChanged","isFunction","selectChat","selectedChat","id","SELECT_CHAT","deselectChat","deleteChat","chat","onSelectedChatChanged","updateSelectedChat","SELECTED_CHAT_UPDATED","onSelectedChatUpdated","onLastMessageReceived","LAST_MESSAGE_RECEIVED","updateAgents","agents","AGENT_LIST_UPDATED","onAgentsListChanged","getAgent","agentId","selectAgent","selectedAgent","AGENT_SELECTED","onSelectedAgentChanged","getDefaultAgent","setDefaultAgent","agent","setCanModifyAgent","CAN_MODIFY_AGENT_UPDATED","toggleExplainResponse","expanded","EXPLAIN_RESPONSE_CACHE_UPDATED","getExplainResponse","addExplainResponseCache","explainResponse","onExplainResponseCacheUpdated","explainResponses","factory","CREATE_CHAT","CREATE_CHAT_SUCCESSFUL","CREATE_CHAT_FAILURE","RENAME_CHAT","RENAME_CHAT_SUCCESSFUL","RENAME_CHAT_FAILURE","DELETING_CHAT","DELETE_CHAT","DELETE_CHAT_SUCCESSFUL","DELETE_CHAT_FAILURE","CHAT_EXPORT","CHAT_EXPORT_SUCCESSFUL","CHAT_EXPORT_FAILURE","ASK_QUESTION","ASK_QUESTION_FAILURE","CONTINUE_CHAT_RUN","LOAD_CHATS","LOAD_CHAT_SUCCESSFUL","LOAD_CHAT_FAILURE","EDIT_AGENT","CLONE_AGENT","DELETE_AGENT","AGENT_DELETED","DELETING_AGENT","GO_TO_CREATE_SIMILARITY_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_AUTOCOMPLETE_INDEX_VIEW","EXPLAIN_RESPONSE","GO_TO_SPARQL_EDITOR"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=85609;export const __webpack_ids__=[19402,36633,45458,63415,85609,85788];export const __webpack_modules__={19402:(t,s,e)=>{e.r(s),e.d(s,{ChatByDayModel:()=>n,ChatModel:()=>h,ChatsListModel:()=>r});var a=e(63415),i=e(93135);class h{static getEmptyChat(){const t={name:"· · ·",timestamp:Math.floor(Date.now()/1e3)};return new h(t,(0,i.md5HashGenerator)())}constructor(t,s){this.hashGenerator=s,this._id=t.id,this._name=t.name,this._timestamp=t.timestamp,this._chatHistory=t.chatHistory||new a.ChatItemsListModel,this.hash=this.generateHash()}generateHash(){return this.hashGenerator(JSON.stringify(this))}get id(){return this._id}set id(t){this._id=t}get name(){return this._name}set name(t){this.generateHash(),this._name=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chatHistory(){return this._chatHistory}set chatHistory(t){this._chatHistory=t||new a.ChatItemsListModel}toRenameRequestPayload(){return{name:this._name}}}class n{constructor(t){this._day=t.day,this._timestamp=t.timestamp,this._chats=t.chats}get day(){return this._day}set day(t){this._day=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chats(){return this._chats}set chats(t){this._chats=t}}class r{constructor(t){this._chats=t||[],this._chatsByDay=[],this.sortByTime(),this.updateChatsByDay()}sortByTime(){this._chats.sort((t,s)=>s.timestamp-t.timestamp)}updateChatTimestamp(t,s){const e=this._chats.find(s=>s.id===t);e&&(e.timestamp=s,this.sortByTime(),this.updateChatsByDay())}updateChatName(t,s){const e=this._chats.find(s=>s.id===t);e&&(e.name=s)}deleteChat(t){this._chats=this._chats.filter(s=>s.id!==t.id),this.sortByTime(),this.updateChatsByDay()}updateChatsByDay(){this._chatsByDay=[],this._chats.forEach(t=>{const s=new Date(1e3*t.timestamp).toDateString(),e=this._chatsByDay.find(t=>t.day===s);e?e.chats.push(t):this._chatsByDay.push(new n({day:s,timestamp:1e3*t.timestamp,chats:[t]}))})}appendChat(t){this._chats.push(t),this.sortByTime(),this.updateChatsByDay()}replaceChat(t,s){this._chats=this._chats.map(e=>e.id===s.id?t:e),this.sortByTime(),this.updateChatsByDay()}isEmpty(){return 0===this._chats.length}getFirstChat(){return this._chats[0]}deselectAll(){this._chats.forEach(t=>{t.selected=!1})}selectChat(t){this.deselectAll(),this._chats.forEach(s=>{s.selected=s.id===t.id})}getChat(t){return this._chats.find(s=>s.id===t)}getNonPersistedChat(){return this._chats.find(t=>!t.id)}renameChat(t){const s=this._chats.find(s=>s.id===t.id);s&&(s.name=t.name)}get chats(){return this._chats}set chats(t){this._chats=t}get chatsByDay(){return this._chatsByDay}set chatsByDay(t){this._chatsByDay=t}}},36633:(t,s,e)=>{e.r(s),e.d(s,{CHAT_MESSAGE_ROLE:()=>i,ChatMessageModel:()=>a});class a{constructor(t){this._id=t.id,this._role=t.role,this._message=t.message,this._timestamp=1e3*t.timestamp,this.tokenUsageInfo=t.tokenUsageInfo}get id(){return this._id}set id(t){this._id=t}get role(){return this._role}set role(t){this._role=t}get message(){return this._message}set message(t){this._message=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}}const i={USER:"user",ASSISTANT:"assistant"}},45458:(t,s,e)=>{e.r(s),e.d(s,{ChatAnswerModel:()=>a,ContinueChatRun:()=>i});class a{constructor(t={}){this._chatId=t.chatId,this._chatName=t.chatName||"",this._timestamp=t.timestamp,this._messages=t.messages||[],this._continueRunId=t.continueRunId,this.tokenUsageInfo=t.tokenUsageInfo}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get chatName(){return this._chatName}set chatName(t){this._chatName=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get messages(){return this._messages}set messages(t){this._messages=t}get continueRunId(){return this._continueRunId}set continueRunId(t){this._continueRunId=t}}class i{constructor(t,s){this._chatItem=t,this._runId=s}get chatId(){return this._chatItem.chatId}toContinueRunRequestPayload(){return{conversationId:this.chatId,runId:this._runId,agentId:this._chatItem.agentId,tzOffset:-(new Date).getTimezoneOffset()}}}},63415:(t,s,e)=>{e.r(s),e.d(s,{ChatItemModel:()=>i,ChatItemsListModel:()=>h});var a=e(36633);class i{constructor(t,s){this._chatId=t,this._agentId=void 0,this._question=s,this._answers=[]}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get agentId(){return this._agentId}set agentId(t){this._agentId=t}get question(){return this._question}set question(t){this._question=t}get answers(){return this._answers}set answers(t){this._answers=t}setQuestionMessage(t){this._question||(this._question=new a.ChatMessageModel({role:a.CHAT_MESSAGE_ROLE.USER})),this._question.message=t}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(t){return{conversationId:this._chatId,answerId:t}}}class h{constructor(t=[]){this._items=t}isEmpty(){return 0===this._items.length}appendItem(t){this._items.push(t)}get items(){return this._items}set items(t){this._items=t||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}},85609:(t,s,e)=>{e.r(s),e.d(s,{chatModelMapper:()=>o,chatsListMapper:()=>m});var a=e(19402),i=e(93135),h=e(85788),n=e(63415);const r=(0,i.md5HashGenerator)(),m=t=>{if(!t)return new a.ChatsListModel;const s=t.map(t=>o(t));return new a.ChatsListModel(s)},o=t=>{if(t)return new a.ChatModel({id:t.id,name:t.name,timestamp:t.timestamp,chatHistory:t.messages&&t.messages.length?(0,h.chatItemsModelMapper)(t.messages):new n.ChatItemsListModel},r)}},85788:(t,s,e)=>{e.r(s),e.d(s,{chatAnswerModelMapper:()=>o,chatItemsModelMapper:()=>r,chatMessageModelListMapper:()=>n,chatMessageModelMapper:()=>m});var a=e(36633),i=e(63415),h=e(45458);const n=t=>t?t.map(t=>m(t)):[],r=(t=[])=>{const s=[];let e;return t.forEach(t=>{const h=t.conversationId;a.CHAT_MESSAGE_ROLE.USER===t.role?(e&&s.push(e),e=new i.ChatItemModel(h,m(t))):(e||(e=new i.ChatItemModel(h,null)),e.answers.push(m(t)),e.agentId=t.agentId)}),e&&s.push(e),new i.ChatItemsListModel(s)},m=t=>{if(t)return new a.ChatMessageModel({id:t.id,role:t.role,message:t.message,timestamp:t.timestamp,tokenUsageInfo:t.usage,data:t})},o=t=>{if(t)return new h.ChatAnswerModel({chatId:t.id,chatName:t.name,timestamp:t.timestamp,messages:n(t.messages),continueRunId:t.continueRunId,tokenUsageInfo:t.usage})}}};
2
- //# sourceMappingURL=85609.680b755726c66ea1de34.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"85609.680b755726c66ea1de34.bundle.js","mappings":"2PAGO,MAAMA,EACT,mBAAOC,GACH,MAAMC,EAAO,CACTC,KAAM,QACNC,UAAWC,KAAKC,MAAMC,KAAKC,MAAQ,MAEvC,OAAO,IAAIR,EAAUE,GAAMO,EAAAA,EAAAA,oBAC/B,CAEAC,WAAAA,CAAYR,EAAMS,GACdC,KAAKD,cAAgBA,EAKrBC,KAAKC,IAAMX,EAAKY,GAKhBF,KAAKG,MAAQb,EAAKC,KAKlBS,KAAKI,WAAad,EAAKE,UAKvBQ,KAAKK,aAAef,EAAKgB,aAAe,IAAIC,EAAAA,mBAC5CP,KAAKQ,KAAOR,KAAKS,cACrB,CAEAA,YAAAA,GACI,OAAOT,KAAKD,cAAcW,KAAKC,UAAU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AA2BlH,EAAKgF,UAC1CE,cAAelF,EAAKkF,cACpBX,eAAgBvE,EAAKsH,Q","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chats.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-message.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-answer.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-item.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/chats.mapper.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/chat-message.mapper.js"],"sourcesContent":["import {ChatItemsListModel} from \"./chat-item\";\nimport {md5HashGenerator} from \"../../utils/hash-utils\";\n\nexport class ChatModel {\n static getEmptyChat() {\n const data = {\n name: \"\\u00B7 \\u00B7 \\u00B7\",\n timestamp: Math.floor(Date.now() / 1000)\n };\n return new ChatModel(data, md5HashGenerator());\n }\n\n constructor(data, hashGenerator) {\n this.hashGenerator = hashGenerator;\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type {string}\n */\n this._name = data.name;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp;\n\n /**\n * @type {ChatItemsListModel}\n */\n this._chatHistory = data.chatHistory || new ChatItemsListModel();\n this.hash = this.generateHash();\n }\n\n generateHash() {\n return this.hashGenerator(JSON.stringify(this));\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get name() {\n return this._name;\n }\n\n set name(value) {\n this.generateHash();\n this._name = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get chatHistory() {\n return this._chatHistory;\n }\n\n set chatHistory(value) {\n this._chatHistory = value || new ChatItemsListModel();\n }\n\n /**\n * Converts the instance to a rename chat request payload.\n * This request object contains the new name for renaming the chat.\n *\n * @return {{name: string}} An object representing the rename request payload.\n */\n toRenameRequestPayload() {\n return {name: this._name};\n }\n}\n\nexport class ChatByDayModel {\n constructor(data) {\n this._day = data.day;\n /**\n * @type {number}\n * @private\n */\n this._timestamp = data.timestamp;\n /**\n * @type {ChatModel[]|*}\n * @private\n */\n this._chats = data.chats;\n }\n\n get day() {\n return this._day;\n }\n\n set day(value) {\n this._day = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get chats() {\n return this._chats;\n }\n\n set chats(value) {\n this._chats = value;\n }\n}\n\nexport class ChatsListModel {\n constructor(chats) {\n /**\n * @type {ChatModel[]}\n * @private\n */\n this._chats = chats || [];\n /**\n * @type {ChatByDayModel[]}\n * @private\n */\n this._chatsByDay = [];\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n /**\n * Sorts the list of chats by timestamp in descending order, with the newest items on top.\n */\n sortByTime() {\n this._chats.sort((a, b) => {\n return b.timestamp - a.timestamp;\n });\n }\n\n /**\n * Updates the timestamp of a chat in the list.\n * @param {string} chatId\n * @param {number} timestamp\n */\n updateChatTimestamp(chatId, timestamp) {\n const chat = this._chats.find((c) => c.id === chatId);\n if (chat) {\n chat.timestamp = timestamp;\n this.sortByTime();\n this.updateChatsByDay();\n }\n }\n\n /**\n * Updates the name of a chat in the list.\n * @param {string} chatId\n * @param {string} name\n */\n updateChatName(chatId, name) {\n const chat = this._chats.find((c) => c.id === chatId);\n if (chat) {\n chat.name = name;\n }\n }\n\n /**\n * Deletes a chat from the chat list.\n * @param {ChatModel} chatToBeDeleted\n */\n deleteChat(chatToBeDeleted) {\n this._chats = this._chats.filter((chat) => chat.id !== chatToBeDeleted.id);\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n updateChatsByDay() {\n this._chatsByDay = [];\n // group chats by day\n this._chats.forEach((chat) => {\n const day = new Date(chat.timestamp * 1000).toDateString();\n const dayModel = this._chatsByDay.find((d) => d.day === day);\n if (dayModel) {\n dayModel.chats.push(chat);\n } else {\n this._chatsByDay.push(new ChatByDayModel({day: day, timestamp: chat.timestamp * 1000, chats: [chat]}));\n }\n });\n }\n\n appendChat(chat) {\n this._chats.push(chat);\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n replaceChat(newChat, oldChat) {\n this._chats = this._chats.map((chat) => {\n if (chat.id === oldChat.id) {\n return newChat;\n }\n return chat;\n });\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n /**\n * Checks if the chat list is empty.\n * @return {boolean}\n */\n isEmpty() {\n return this._chats.length === 0;\n }\n\n /**\n * Returns the first chat from the list.\n * @return {ChatModel|undefined}\n */\n getFirstChat() {\n return this._chats[0];\n }\n\n /**\n * Deselects all chats.\n */\n deselectAll() {\n this._chats.forEach((c) => {\n c.selected = false;\n });\n }\n\n /**\n * Selects a chat.\n * @param {ChatModel} chat\n */\n selectChat(chat) {\n this.deselectAll();\n this._chats.forEach((c) => {\n c.selected = c.id === chat.id;\n });\n }\n\n getChat(id) {\n return this._chats.find((c) => c.id === id);\n }\n\n getNonPersistedChat() {\n return this._chats.find((chat) => !chat.id);\n }\n\n renameChat(renamedChat) {\n const chat = this._chats.find((c) => c.id === renamedChat.id);\n if (chat) {\n chat.name = renamedChat.name;\n }\n }\n\n /**\n * @return {ChatModel[]}\n */\n get chats() {\n return this._chats;\n }\n\n /**\n * @param {ChatModel[]} value\n */\n set chats(value) {\n this._chats = value;\n }\n\n get chatsByDay() {\n return this._chatsByDay;\n }\n\n set chatsByDay(value) {\n this._chatsByDay = value;\n }\n}\n","export class ChatMessageModel {\n constructor(data) {\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type @type {string} - A value from {@link CHAT_MESSAGE_ROLE}, determining the owner of the message (e.g., user, assistant).\n */\n this._role = data.role;\n\n /**\n * @type {string}\n */\n this._message = data.message;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp * 1000;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n * It is applicable only to the assistant role ({@link CHAT_MESSAGE_ROLE#ASSISTANT}).\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get role() {\n return this._role;\n }\n\n set role(value) {\n this._role = value;\n }\n\n get message() {\n return this._message;\n }\n\n set message(value) {\n this._message = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n}\n\nexport const CHAT_MESSAGE_ROLE = {\n USER: 'user',\n ASSISTANT: 'assistant'\n};\n","export class ChatAnswerModel {\n constructor(data = {}) {\n /**\n * @type {string | undefined}\n */\n this._chatId = data.chatId;\n\n /**\n * @type {string}\n */\n this._chatName = data.chatName || '';\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp;\n\n /**\n * @type {ChatMessageModel[]}\n */\n this._messages = data.messages || [];\n\n /**\n * @type {string}\n */\n this._continueRunId = data.continueRunId;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get chatName() {\n return this._chatName;\n }\n\n set chatName(value) {\n this._chatName = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get messages() {\n return this._messages;\n }\n\n set messages(value) {\n this._messages = value;\n }\n\n get continueRunId() {\n return this._continueRunId;\n }\n\n set continueRunId(value) {\n this._continueRunId = value;\n }\n}\n\n/**\n * Represents information on continuing the chat run, i.e., fetching answers iteratively after\n * asking until the last answer is received.\n */\nexport class ContinueChatRun {\n constructor(chatItem, runId) {\n this._chatItem = chatItem;\n this._runId = runId;\n }\n\n get chatId() {\n return this._chatItem.chatId;\n }\n\n toContinueRunRequestPayload() {\n return {\n conversationId: this.chatId,\n runId: this._runId,\n agentId: this._chatItem.agentId,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n}\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"./chat-message\";\n\n/**\n *\n * Represents a model that holds a question and the answer of it in a chat.\n *\n */\nexport class ChatItemModel {\n\n /**\n * Creates an instance of ChatItemModel.\n *\n * @param {string} chatId - The unique identifier for the chat associated with this instance.\n * @param {ChatMessageModel} question - The message object representing the question.\n */\n constructor(chatId, question) {\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._chatId = chatId;\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._agentId = undefined;\n\n /**\n * @type {ChatMessageModel}\n * @private\n */\n this._question = question;\n\n /**\n *\n * @type {ChatMessageModel[] | undefined}\n * @private\n */\n this._answers = [];\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get agentId() {\n return this._agentId;\n }\n\n set agentId(value) {\n this._agentId = value;\n }\n\n get question() {\n return this._question;\n }\n\n set question(value) {\n this._question = value;\n }\n\n get answers() {\n return this._answers;\n }\n\n /**\n *\n * @param {ChatMessageModel[]} value\n */\n set answers(value) {\n this._answers = value;\n }\n\n /**\n * Sets the message for the user's question.\n *\n * @param {string} message - The message content for the user's question.\n */\n setQuestionMessage(message) {\n if (!this._question) {\n this._question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n }\n this._question.message = message;\n }\n\n /**\n * Retrieves the message of the user's question.\n *\n * @return {string} - The message content of the user's question.\n */\n getQuestionMessage() {\n return this._question.message;\n }\n\n /**\n * Converts the instance to a create chat request payload.\n *\n * @return {{agentId: string, question: string}} An object representing the create request payload.\n */\n toCreateChatRequestPayload() {\n return {\n agentId: this._agentId,\n question: this._question.message\n };\n }\n\n /**\n * Converts the instance to an ask request payload.\n *\n * @return {{conversationId: string, agentId: string, question: string}} An object representing the ask request payload.\n */\n toAskRequestPayload() {\n return {\n conversationId: this._chatId,\n agentId: this._agentId,\n question: this._question.message,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n\n toExplainResponsePayload(answerId) {\n return {\n conversationId: this._chatId,\n answerId\n };\n }\n}\n\nexport class ChatItemsListModel {\n\n /**\n * @param {ChatItemModel[]} items\n */\n constructor(items = []) {\n this._items = items;\n }\n\n isEmpty() {\n return this._items.length === 0;\n }\n\n /**\n * @param {ChatItemModel} chatItem\n */\n appendItem(chatItem) {\n this._items.push(chatItem);\n }\n\n get items() {\n return this._items;\n }\n\n set items(value) {\n this._items = value || [];\n }\n\n getLast() {\n if (!this.isEmpty()) {\n return this._items[this._items.length - 1];\n }\n }\n}\n","import {ChatsListModel, ChatModel} from \"../../models/ttyg/chats\";\nimport {md5HashGenerator} from \"../../utils/hash-utils\";\nimport {chatItemsModelMapper} from \"./chat-message.mapper\";\nimport {ChatItemsListModel} from \"../../models/ttyg/chat-item\";\n\nconst hashGenerator = md5HashGenerator();\n\n/**\n * Converts the response from the server to a list of ChatModels.\n * @param {*[]} data\n * @return {ChatsListModel}\n */\nexport const chatsListMapper = (data) => {\n if (!data) {\n return new ChatsListModel();\n }\n const chatModels = data.map((chat) => chatModelMapper(chat));\n return new ChatsListModel(chatModels);\n};\n\n/**\n * Converts the response from the server to a ChatModel.\n * @param {*} data\n * @return {ChatModel|undefined}\n */\nexport const chatModelMapper = (data) => {\n if (!data) {\n return;\n }\n return new ChatModel({\n id: data.id,\n name: data.name,\n timestamp: data.timestamp,\n chatHistory: data.messages && data.messages.length ? chatItemsModelMapper(data.messages) : new ChatItemsListModel()\n }, hashGenerator);\n};\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"../../models/ttyg/chat-message\";\nimport {ChatItemModel, ChatItemsListModel} from \"../../models/ttyg/chat-item\";\nimport {ChatAnswerModel} from \"../../models/ttyg/chat-answer\";\n\n/**\n * Converts the response from the server to a list of ChatMessageModel array.\n * @param {*[]} data\n * @return {ChatMessageModel[]}\n */\nexport const chatMessageModelListMapper = (data) => {\n if (!data) {\n return [];\n }\n return data.map((chatMessage) => chatMessageModelMapper(chatMessage));\n};\n\n/**\n * Maps a list of chat messages into an instance of {@see ChatItemsListModel}, which contains a list of `ChatItemModel` objects. Each object represents a question (from the user) and its corresponding answer (from the agent).\n * The backend returns messages as individual entries, and this function transforms those entries into objects that pair each question with its answer.\n *\n * @param {Array<Object>} data - An array of message objects, where each message contains details such as the role (user or assistant) and the message content.\n * @return {ChatItemsListModel} An instance of `ChatItemsListModel` containing a list of `ChatItemModel` objects, where each object holds a question and its corresponding answer.\n *\n * @example\n * // Example message data from the backend\n * const data = [\n * { role: 'user', conversationId: '123', agentId: 'agent-1', message: 'What is the weather?', timestamp: 1628876583 },\n * { role: 'assistant', conversationId: '123', agentId: 'agent-1', message: 'The weather is sunny.', timestamp: 1628876590 }\n * ];\n *\n * // Example of the resulting ChatItemsListModel array\n * const items = [\n * {\n * conversationId: '123',\n * agentId: 'agent-1',\n * question: {\n * role: 'user',\n * message: 'What is the weather?',\n * timestamp: 1628876583\n * },\n * answer: {\n * role: 'assistant',\n * message: 'The weather is sunny.',\n * timestamp: 1628876590\n * }\n * }]\n */\nexport const chatItemsModelMapper = (data = []) => {\n const items = [];\n let currentItem;\n data.forEach((message) => {\n // NOTE: The backend chat model doesn't have a ChatItemModel object,\n // i.e. it doesn't group user + assistant messages together.\n // In essence, there may be multiple consecutive user messages as well as\n // multiple consecutive assistant messages.\n const chatId = message.conversationId;\n if (CHAT_MESSAGE_ROLE.USER === message.role) {\n if (currentItem) {\n items.push(currentItem);\n }\n currentItem = new ChatItemModel(chatId, chatMessageModelMapper(message));\n } else {\n if (!currentItem) {\n currentItem = new ChatItemModel(chatId, null);\n }\n currentItem.answers.push(chatMessageModelMapper(message));\n currentItem.agentId = message.agentId;\n }\n });\n if (currentItem) {\n items.push(currentItem);\n }\n return new ChatItemsListModel(items);\n};\n\n/**\n * Converts the response from the server to a ChatMessageModel.\n * @param {*} data\n * @return {ChatMessageModel|undefined}\n */\nexport const chatMessageModelMapper = (data) => {\n if (!data) {\n return;\n }\n return new ChatMessageModel({\n id: data.id,\n role: data.role,\n message: data.message,\n timestamp: data.timestamp,\n tokenUsageInfo: data.usage,\n data: data\n });\n};\n\n/**\n * Converts the response from the server to a ChatAnswerModel instance.\n * @param {*} data\n * @return {ChatAnswerModel|undefined}\n */\nexport const chatAnswerModelMapper = (data) => {\n if (!data) {\n return;\n }\n return new ChatAnswerModel({\n chatId: data.id,\n chatName: data.name,\n timestamp: data.timestamp,\n messages: chatMessageModelListMapper(data.messages),\n continueRunId: data.continueRunId,\n tokenUsageInfo: data.usage\n });\n};\n"],"names":["ChatModel","getEmptyChat","data","name","timestamp","Math","floor","Date","now","md5HashGenerator","constructor","hashGenerator","this","_id","id","_name","_timestamp","_chatHistory","chatHistory","ChatItemsListModel","hash","generateHash","JSON","stringify","value","toRenameRequestPayload","ChatByDayModel","_day","day","_chats","chats","ChatsListModel","_chatsByDay","sortByTime","updateChatsByDay","sort","a","b","updateChatTimestamp","chatId","chat","find","c","updateChatName","deleteChat","chatToBeDeleted","filter","forEach","toDateString","dayModel","d","push","appendChat","replaceChat","newChat","oldChat","map","isEmpty","length","getFirstChat","deselectAll","selected","selectChat","getChat","getNonPersistedChat","renameChat","renamedChat","chatsByDay","ChatMessageModel","_role","role","_message","message","tokenUsageInfo","CHAT_MESSAGE_ROLE","USER","ASSISTANT","ChatAnswerModel","_chatId","_chatName","chatName","_messages","messages","_continueRunId","continueRunId","ContinueChatRun","chatItem","runId","_chatItem","_runId","toContinueRunRequestPayload","conversationId","agentId","tzOffset","getTimezoneOffset","ChatItemModel","question","_agentId","undefined","_question","_answers","answers","setQuestionMessage","getQuestionMessage","toCreateChatRequestPayload","toAskRequestPayload","toExplainResponsePayload","answerId","items","_items","appendItem","getLast","chatsListMapper","chatModels","chatModelMapper","chatItemsModelMapper","chatMessageModelListMapper","chatMessage","chatMessageModelMapper","currentItem","usage","chatAnswerModelMapper"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=85788;export const __webpack_ids__=[36633,45458,63415,85788];export const __webpack_modules__={36633:(t,e,s)=>{s.r(e),s.d(e,{CHAT_MESSAGE_ROLE:()=>n,ChatMessageModel:()=>a});class a{constructor(t){this._id=t.id,this._role=t.role,this._message=t.message,this._timestamp=1e3*t.timestamp,this.tokenUsageInfo=t.tokenUsageInfo}get id(){return this._id}set id(t){this._id=t}get role(){return this._role}set role(t){this._role=t}get message(){return this._message}set message(t){this._message=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}}const n={USER:"user",ASSISTANT:"assistant"}},45458:(t,e,s)=>{s.r(e),s.d(e,{ChatAnswerModel:()=>a,ContinueChatRun:()=>n});class a{constructor(t={}){this._chatId=t.chatId,this._chatName=t.chatName||"",this._timestamp=t.timestamp,this._messages=t.messages||[],this._continueRunId=t.continueRunId,this.tokenUsageInfo=t.tokenUsageInfo}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get chatName(){return this._chatName}set chatName(t){this._chatName=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get messages(){return this._messages}set messages(t){this._messages=t}get continueRunId(){return this._continueRunId}set continueRunId(t){this._continueRunId=t}}class n{constructor(t,e){this._chatItem=t,this._runId=e}get chatId(){return this._chatItem.chatId}toContinueRunRequestPayload(){return{conversationId:this.chatId,runId:this._runId,agentId:this._chatItem.agentId,tzOffset:-(new Date).getTimezoneOffset()}}}},63415:(t,e,s)=>{s.r(e),s.d(e,{ChatItemModel:()=>n,ChatItemsListModel:()=>i});var a=s(36633);class n{constructor(t,e){this._chatId=t,this._agentId=void 0,this._question=e,this._answers=[]}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get agentId(){return this._agentId}set agentId(t){this._agentId=t}get question(){return this._question}set question(t){this._question=t}get answers(){return this._answers}set answers(t){this._answers=t}setQuestionMessage(t){this._question||(this._question=new a.ChatMessageModel({role:a.CHAT_MESSAGE_ROLE.USER})),this._question.message=t}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(t){return{conversationId:this._chatId,answerId:t}}}class i{constructor(t=[]){this._items=t}isEmpty(){return 0===this._items.length}appendItem(t){this._items.push(t)}get items(){return this._items}set items(t){this._items=t||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}},85788:(t,e,s)=>{s.r(e),s.d(e,{chatAnswerModelMapper:()=>m,chatItemsModelMapper:()=>o,chatMessageModelListMapper:()=>h,chatMessageModelMapper:()=>r});var a=s(36633),n=s(63415),i=s(45458);const h=t=>t?t.map(t=>r(t)):[],o=(t=[])=>{const e=[];let s;return t.forEach(t=>{const i=t.conversationId;a.CHAT_MESSAGE_ROLE.USER===t.role?(s&&e.push(s),s=new n.ChatItemModel(i,r(t))):(s||(s=new n.ChatItemModel(i,null)),s.answers.push(r(t)),s.agentId=t.agentId)}),s&&e.push(s),new n.ChatItemsListModel(e)},r=t=>{if(t)return new a.ChatMessageModel({id:t.id,role:t.role,message:t.message,timestamp:t.timestamp,tokenUsageInfo:t.usage,data:t})},m=t=>{if(t)return new i.ChatAnswerModel({chatId:t.id,chatName:t.name,timestamp:t.timestamp,messages:h(t.messages),continueRunId:t.continueRunId,tokenUsageInfo:t.usage})}}};
2
- //# sourceMappingURL=85788.4e0818c48b6f29153db4.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"85788.4e0818c48b6f29153db4.bundle.js","mappings":"0MAAO,MAAMA,EACTC,WAAAA,CAAYC,GAKRC,KAAKC,IAAMF,EAAKG,GAKhBF,KAAKG,MAAQJ,EAAKK,KAKlBJ,KAAKK,SAAWN,EAAKO,QAKrBN,KAAKO,WAA8B,IAAjBR,EAAKS,UAQvBR,KAAKS,eAAiBV,EAAKU,cAC/B,CAEA,MAAIP,GACA,OAAOF,KAAKC,GAChB,CAEA,MAAIC,CAAGQ,GACHV,KAAKC,IAAMS,CACf,CAEA,QAAIN,GACA,OAAOJ,KAAK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xB,KAAKiD,OAAOI,KAAK7B,EACrB,CAEA,SAAIwB,GACA,OAAOhD,KAAKiD,MAChB,CAEA,SAAID,CAAMtC,GACNV,KAAKiD,OAASvC,GAAS,EAC3B,CAEA4C,OAAAA,GACI,IAAKtD,KAAKkD,UACN,OAAOlD,KAAKiD,OAAOjD,KAAKiD,OAAOE,OAAS,EAEhD,E,4LC7JG,MAAMI,EAA8BxD,GAClCA,EAGEA,EAAKyD,IAAKC,GAAgBC,EAAuBD,IAF7C,GAoCFE,EAAuBA,CAAC5D,EAAO,MACxC,MAAMiD,EAAQ,GACd,IAAIY,EAuBJ,OAtBA7D,EAAK8D,QAASvD,IAKV,MAAMU,EAASV,EAAQuB,eACnBlB,EAAAA,kBAAkBC,OAASN,EAAQF,MAC/BwD,GACAZ,EAAMK,KAAKO,GAEfA,EAAc,IAAI1B,EAAAA,cAAclB,EAAQ0C,EAAuBpD,MAE1DsD,IACDA,EAAc,IAAI1B,EAAAA,cAAclB,EAAQ,OAE5C4C,EAAYpB,QAAQa,KAAKK,EAAuBpD,IAChDsD,EAAY9B,QAAUxB,EAAQwB,WAGlC8B,GACAZ,EAAMK,KAAKO,GAER,IAAIb,EAAAA,mBAAmBC,IAQrBU,EAA0B3D,IACnC,GAAKA,EAGL,OAAO,IAAIF,EAAAA,iBAAiB,CACxBK,GAAIH,EAAKG,GACTE,KAAML,EAAKK,KACXE,QAASP,EAAKO,QACdE,UAAWT,EAAKS,UAChBC,eAAgBV,EAAK+D,MACrB/D,KAAMA,KASDgE,EAAyBhE,IAClC,GAAKA,EAGL,OAAO,IAAIe,EAAAA,gBAAgB,CACvBE,OAAQjB,EAAKG,GACbgB,SAAUnB,EAAKiE,KACfxD,UAAWT,EAAKS,UAChBY,SAAUmC,EAA2BxD,EAAKqB,UAC1CE,cAAevB,EAAKuB,cACpBb,eAAgBV,EAAK+D,Q","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-message.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-answer.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-item.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/chat-message.mapper.js"],"sourcesContent":["export class ChatMessageModel {\n constructor(data) {\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type @type {string} - A value from {@link CHAT_MESSAGE_ROLE}, determining the owner of the message (e.g., user, assistant).\n */\n this._role = data.role;\n\n /**\n * @type {string}\n */\n this._message = data.message;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp * 1000;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n * It is applicable only to the assistant role ({@link CHAT_MESSAGE_ROLE#ASSISTANT}).\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get role() {\n return this._role;\n }\n\n set role(value) {\n this._role = value;\n }\n\n get message() {\n return this._message;\n }\n\n set message(value) {\n this._message = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n}\n\nexport const CHAT_MESSAGE_ROLE = {\n USER: 'user',\n ASSISTANT: 'assistant'\n};\n","export class ChatAnswerModel {\n constructor(data = {}) {\n /**\n * @type {string | undefined}\n */\n this._chatId = data.chatId;\n\n /**\n * @type {string}\n */\n this._chatName = data.chatName || '';\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp;\n\n /**\n * @type {ChatMessageModel[]}\n */\n this._messages = data.messages || [];\n\n /**\n * @type {string}\n */\n this._continueRunId = data.continueRunId;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get chatName() {\n return this._chatName;\n }\n\n set chatName(value) {\n this._chatName = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get messages() {\n return this._messages;\n }\n\n set messages(value) {\n this._messages = value;\n }\n\n get continueRunId() {\n return this._continueRunId;\n }\n\n set continueRunId(value) {\n this._continueRunId = value;\n }\n}\n\n/**\n * Represents information on continuing the chat run, i.e., fetching answers iteratively after\n * asking until the last answer is received.\n */\nexport class ContinueChatRun {\n constructor(chatItem, runId) {\n this._chatItem = chatItem;\n this._runId = runId;\n }\n\n get chatId() {\n return this._chatItem.chatId;\n }\n\n toContinueRunRequestPayload() {\n return {\n conversationId: this.chatId,\n runId: this._runId,\n agentId: this._chatItem.agentId,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n}\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"./chat-message\";\n\n/**\n *\n * Represents a model that holds a question and the answer of it in a chat.\n *\n */\nexport class ChatItemModel {\n\n /**\n * Creates an instance of ChatItemModel.\n *\n * @param {string} chatId - The unique identifier for the chat associated with this instance.\n * @param {ChatMessageModel} question - The message object representing the question.\n */\n constructor(chatId, question) {\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._chatId = chatId;\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._agentId = undefined;\n\n /**\n * @type {ChatMessageModel}\n * @private\n */\n this._question = question;\n\n /**\n *\n * @type {ChatMessageModel[] | undefined}\n * @private\n */\n this._answers = [];\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get agentId() {\n return this._agentId;\n }\n\n set agentId(value) {\n this._agentId = value;\n }\n\n get question() {\n return this._question;\n }\n\n set question(value) {\n this._question = value;\n }\n\n get answers() {\n return this._answers;\n }\n\n /**\n *\n * @param {ChatMessageModel[]} value\n */\n set answers(value) {\n this._answers = value;\n }\n\n /**\n * Sets the message for the user's question.\n *\n * @param {string} message - The message content for the user's question.\n */\n setQuestionMessage(message) {\n if (!this._question) {\n this._question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n }\n this._question.message = message;\n }\n\n /**\n * Retrieves the message of the user's question.\n *\n * @return {string} - The message content of the user's question.\n */\n getQuestionMessage() {\n return this._question.message;\n }\n\n /**\n * Converts the instance to a create chat request payload.\n *\n * @return {{agentId: string, question: string}} An object representing the create request payload.\n */\n toCreateChatRequestPayload() {\n return {\n agentId: this._agentId,\n question: this._question.message\n };\n }\n\n /**\n * Converts the instance to an ask request payload.\n *\n * @return {{conversationId: string, agentId: string, question: string}} An object representing the ask request payload.\n */\n toAskRequestPayload() {\n return {\n conversationId: this._chatId,\n agentId: this._agentId,\n question: this._question.message,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n\n toExplainResponsePayload(answerId) {\n return {\n conversationId: this._chatId,\n answerId\n };\n }\n}\n\nexport class ChatItemsListModel {\n\n /**\n * @param {ChatItemModel[]} items\n */\n constructor(items = []) {\n this._items = items;\n }\n\n isEmpty() {\n return this._items.length === 0;\n }\n\n /**\n * @param {ChatItemModel} chatItem\n */\n appendItem(chatItem) {\n this._items.push(chatItem);\n }\n\n get items() {\n return this._items;\n }\n\n set items(value) {\n this._items = value || [];\n }\n\n getLast() {\n if (!this.isEmpty()) {\n return this._items[this._items.length - 1];\n }\n }\n}\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"../../models/ttyg/chat-message\";\nimport {ChatItemModel, ChatItemsListModel} from \"../../models/ttyg/chat-item\";\nimport {ChatAnswerModel} from \"../../models/ttyg/chat-answer\";\n\n/**\n * Converts the response from the server to a list of ChatMessageModel array.\n * @param {*[]} data\n * @return {ChatMessageModel[]}\n */\nexport const chatMessageModelListMapper = (data) => {\n if (!data) {\n return [];\n }\n return data.map((chatMessage) => chatMessageModelMapper(chatMessage));\n};\n\n/**\n * Maps a list of chat messages into an instance of {@see ChatItemsListModel}, which contains a list of `ChatItemModel` objects. Each object represents a question (from the user) and its corresponding answer (from the agent).\n * The backend returns messages as individual entries, and this function transforms those entries into objects that pair each question with its answer.\n *\n * @param {Array<Object>} data - An array of message objects, where each message contains details such as the role (user or assistant) and the message content.\n * @return {ChatItemsListModel} An instance of `ChatItemsListModel` containing a list of `ChatItemModel` objects, where each object holds a question and its corresponding answer.\n *\n * @example\n * // Example message data from the backend\n * const data = [\n * { role: 'user', conversationId: '123', agentId: 'agent-1', message: 'What is the weather?', timestamp: 1628876583 },\n * { role: 'assistant', conversationId: '123', agentId: 'agent-1', message: 'The weather is sunny.', timestamp: 1628876590 }\n * ];\n *\n * // Example of the resulting ChatItemsListModel array\n * const items = [\n * {\n * conversationId: '123',\n * agentId: 'agent-1',\n * question: {\n * role: 'user',\n * message: 'What is the weather?',\n * timestamp: 1628876583\n * },\n * answer: {\n * role: 'assistant',\n * message: 'The weather is sunny.',\n * timestamp: 1628876590\n * }\n * }]\n */\nexport const chatItemsModelMapper = (data = []) => {\n const items = [];\n let currentItem;\n data.forEach((message) => {\n // NOTE: The backend chat model doesn't have a ChatItemModel object,\n // i.e. it doesn't group user + assistant messages together.\n // In essence, there may be multiple consecutive user messages as well as\n // multiple consecutive assistant messages.\n const chatId = message.conversationId;\n if (CHAT_MESSAGE_ROLE.USER === message.role) {\n if (currentItem) {\n items.push(currentItem);\n }\n currentItem = new ChatItemModel(chatId, chatMessageModelMapper(message));\n } else {\n if (!currentItem) {\n currentItem = new ChatItemModel(chatId, null);\n }\n currentItem.answers.push(chatMessageModelMapper(message));\n currentItem.agentId = message.agentId;\n }\n });\n if (currentItem) {\n items.push(currentItem);\n }\n return new ChatItemsListModel(items);\n};\n\n/**\n * Converts the response from the server to a ChatMessageModel.\n * @param {*} data\n * @return {ChatMessageModel|undefined}\n */\nexport const chatMessageModelMapper = (data) => {\n if (!data) {\n return;\n }\n return new ChatMessageModel({\n id: data.id,\n role: data.role,\n message: data.message,\n timestamp: data.timestamp,\n tokenUsageInfo: data.usage,\n data: data\n });\n};\n\n/**\n * Converts the response from the server to a ChatAnswerModel instance.\n * @param {*} data\n * @return {ChatAnswerModel|undefined}\n */\nexport const chatAnswerModelMapper = (data) => {\n if (!data) {\n return;\n }\n return new ChatAnswerModel({\n chatId: data.id,\n chatName: data.name,\n timestamp: data.timestamp,\n messages: chatMessageModelListMapper(data.messages),\n continueRunId: data.continueRunId,\n tokenUsageInfo: data.usage\n });\n};\n"],"names":["ChatMessageModel","constructor","data","this","_id","id","_role","role","_message","message","_timestamp","timestamp","tokenUsageInfo","value","CHAT_MESSAGE_ROLE","USER","ASSISTANT","ChatAnswerModel","_chatId","chatId","_chatName","chatName","_messages","messages","_continueRunId","continueRunId","ContinueChatRun","chatItem","runId","_chatItem","_runId","toContinueRunRequestPayload","conversationId","agentId","tzOffset","Date","getTimezoneOffset","ChatItemModel","question","_agentId","undefined","_question","_answers","answers","setQuestionMessage","getQuestionMessage","toCreateChatRequestPayload","toAskRequestPayload","toExplainResponsePayload","answerId","ChatItemsListModel","items","_items","isEmpty","length","appendItem","push","getLast","chatMessageModelListMapper","map","chatMessage","chatMessageModelMapper","chatItemsModelMapper","currentItem","forEach","usage","chatAnswerModelMapper","name"],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"89695.4ee87c52d4088115c51e.bundle.js","mappings":"oHAAA,MAAMA,EAAsC,gBACtCC,EAAoC,cACpCC,EAA0C,yCAEhDC,eAAeC,IAAI,aAAc,CAC7B,CACIC,eAAgB,4BAChBC,SAAUA,CAACC,EAASC,KAChB,MAAMC,EAAaD,EAASC,WACtBC,EAAiBD,EAAWE,wBAAwB,oCAC1D,MAAO,CACH,CACIN,eAAgB,oBAChBE,QAAS,CACLK,QAAS,0DAELL,EAAQM,WAAa,CAAC,EAAI,CAACC,MAAOZ,GACtCa,MAAO,0BACJR,EACHS,IAAK,OACLC,gBAAiBR,EAAWE,wBAAwB,8BACpDO,yBAA0BR,EAC1BS,eAAgBA,IAAMC,QAAQC,QAAQZ,EAAWa,UAAUZ,SAM/E,CACIL,eAA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,KAChB,MAAMsB,EAAQ,CACV,CACIzB,eAAgB,yCAA0CE,QAAS,IAAIA,IAE3E,CACIF,eAAgB,8BAA+BE,QAAS,IAAIA,KAUpE,OANIA,EAAQwB,sBACRD,EAAME,KAAK,CACP3B,eAAgB,mCAAoCE,QAAS,IAAIA,KAIlEuB,IAGf,CACIzB,eAAgB,uBAChBC,SAAUA,CAACC,EAASC,KAChBD,EAAQM,WAAa,uBAErB,MAAMoB,EAAkB1B,EAAQ2B,QAEhC,IAAIC,EAOJ,GANI5B,EAAQkB,cACRU,EAAsBnC,EACfO,EAAQsB,cACfM,EAAsBlC,GAGtBgC,EACA,MAAO,CAAC,CACJ5B,eAAgB,6BAA8BE,QAAS,IAAIA,KAInE,MAAMuB,EAAQ,CACV,CACIzB,eAAgB,oCAAqCE,QAAS,IAAIA,IAEtE,CACIF,eAAgB,4BAA6BE,QAAS,IAAIA,KAgBlE,OAZI4B,IAAwBnC,EACxB8B,EAAME,KAAK,CACP3B,eAAgB,6CAChBE,QAAS,IAAIA,KAEV4B,IAAwBlC,GAC/B6B,EAAME,KAAK,CACP3B,eAAgB,2CAChBE,QAAS,IAAIA,KAIduB,K","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/guides/steps/complex/ttyg/common/sparql-search-method/plugin.js"],"sourcesContent":["const CONFIGURATION_OPTION_ONTOLOGY_GRAPH = 'ontologyGraph';\nconst CONFIGURATION_OPTION_SPARQL_QUERY = 'sparqlQuery';\nconst TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE = 'guide.step-action.sparql-search-method';\n\nPluginRegistry.add('guide.step', [\n {\n guideBlockName: 'ttyg-sparql-method-enable',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n const toggleSelector = GuideUtils.getGuideElementSelector('query-method-sparql_search-input');\n return [\n {\n guideBlockName: 'clickable-element',\n options: {\n content: 'guide.step_plugin.sparql-search-method.enable-toggle',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n class: 'toggle-sparql-search',\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('query-method-sparql_search'),\n clickableElementSelector: toggleSelector,\n onNextValidate: () => Promise.resolve(GuideUtils.isChecked(toggleSelector)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'ttyg-sparql-method-disable',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n const toggleSelector = GuideUtils.getGuideElementSelector('query-method-sparql_search-input');\n\n return [\n {\n guideBlockName: 'clickable-element',\n options: {\n content: 'guide.step_plugin.sparql-search-method.disable-toggle',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n class: 'toggle-sparql-search',\n ...options,\n url: 'ttyg',\n showOn: () => GuideUtils.isChecked(toggleSelector),\n elementSelector: GuideUtils.getGuideElementSelector('query-method-sparql_search'),\n clickableElementSelector: toggleSelector,\n onNextValidate: () => Promise.resolve(!GuideUtils.isChecked(toggleSelector)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: \"ttyg-sparql-method-ontology-select\",\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n return [\n {\n guideBlockName: 'clickable-element',\n options: {\n content: 'guide.step_plugin.sparql-search-method.enable-ontology-from-graph',\n class: 'enable-ontology-from-graph',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('sparql-ontology-graph-option'),\n clickableElementSelector: GuideUtils.getGuideElementSelector('sparql-ontology-graph-option-input'),\n onNextValidate: () => Promise.resolve(GuideUtils.isChecked(GuideUtils.getGuideElementSelector('sparql-ontology-graph-option-input'))),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'sparql-search-method-type-graph-name',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n return [\n {\n guideBlockName: 'input-element',\n options: {\n content: `guide.step_plugin.sparql-search-method.type-ontology-graph-name`,\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n class: 'input-ontology-graph-name',\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('sparql-ontology-graph-input'),\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(GuideUtils.getGuideElementSelector('sparql-ontology-graph-input'), options.ontologyGraph, false)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'ttyg-sparql-method-sparql-query-select',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n return [\n {\n guideBlockName: 'clickable-element',\n options: angular.extend({}, {\n content: 'guide.step_plugin.sparql-search-method.enable-sparql-query',\n class: 'enable-sparql-query',\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('sparql-query-option'),\n clickableElementSelector: GuideUtils.getGuideElementSelector('sparql-query-option-input'),\n onNextValidate: () => Promise.resolve(GuideUtils.isChecked(GuideUtils.getGuideElementSelector('sparql-query-option-input'))),\n }, options),\n },\n ];\n },\n },\n {\n guideBlockName: \"ttyg-sparql-copy-query-text\",\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n return [\n {\n guideBlockName: 'copy-text-element',\n options: {\n elementSelector: GuideUtils.getGuideElementSelector('sparql-query-input'),\n text: options.sparqlQuery,\n ...options,\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(GuideUtils.getGuideElementSelector('sparql-query-input'), options.sparqlQuery, false)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'ttyg-sparql-click-add-namespaces',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n return [\n {\n guideBlockName: 'clickable-element',\n options: {\n content: 'guide.step_plugin.sparql-search-method.add-missing-namespaces',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n class: 'enable-sparql-query',\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('add-missing-namespaces-option'),\n onNextValidate: () => Promise.resolve(GuideUtils.isChecked(GuideUtils.getGuideElementSelector('add-missing-namespaces-input'))),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'ttyg-enabling-sparql-info-message',\n getSteps: (options, services) => {\n return [\n {\n guideBlockName: 'info-message',\n options: {\n content: `guide.step_plugin.sparql-search-method.content`,\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE}),\n class: 'info-sparql-search',\n ...options,\n url: 'ttyg',\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'sparql-search-method-enable-ontology-graph',\n getSteps: (options, services) => {\n const steps = [\n {\n guideBlockName: 'ttyg-sparql-method-ontology-select', options: {...options},\n },\n {\n guideBlockName: 'sparql-search-method-type-graph-name', options: {...options},\n },\n ];\n\n if (options.addMissingNamespaces) {\n steps.push({\n guideBlockName: 'ttyg-sparql-click-add-namespaces', options: {...options},\n });\n }\n\n return steps;\n },\n },\n {\n guideBlockName: 'sparql-search-method-enable-sparql-query',\n getSteps: (options, services) => {\n const steps = [\n {\n guideBlockName: 'ttyg-sparql-method-sparql-query-select', options: {...options},\n },\n {\n guideBlockName: 'ttyg-sparql-copy-query-text', options: {...options},\n },\n ];\n\n if (options.addMissingNamespaces) {\n steps.push({\n guideBlockName: 'ttyg-sparql-click-add-namespaces', options: {...options},\n });\n }\n\n return steps;\n },\n },\n {\n guideBlockName: 'sparql-search-method',\n getSteps: (options, services) => {\n options.mainAction = 'sparql-search-method';\n\n const shouldToggleOff = options.disable;\n\n let configurationOption;\n if (options.ontologyGraph) {\n configurationOption = CONFIGURATION_OPTION_ONTOLOGY_GRAPH;\n } else if (options.sparqlQuery) {\n configurationOption = CONFIGURATION_OPTION_SPARQL_QUERY;\n }\n\n if (shouldToggleOff) {\n return [{\n guideBlockName: 'ttyg-sparql-method-disable', options: {...options},\n }];\n }\n\n const steps = [\n {\n guideBlockName: 'ttyg-enabling-sparql-info-message', options: {...options},\n },\n {\n guideBlockName: 'ttyg-sparql-method-enable', options: {...options},\n },\n ];\n\n if (configurationOption === CONFIGURATION_OPTION_ONTOLOGY_GRAPH) {\n steps.push({\n guideBlockName: 'sparql-search-method-enable-ontology-graph',\n options: {...options},\n });\n } else if (configurationOption === CONFIGURATION_OPTION_SPARQL_QUERY) {\n steps.push({\n guideBlockName: 'sparql-search-method-enable-sparql-query',\n options: {...options},\n });\n }\n\n return steps;\n },\n },\n]);\n"],"names":["CONFIGURATION_OPTION_ONTOLOGY_GRAPH","CONFIGURATION_OPTION_SPARQL_QUERY","TTYG_SPARQL_SEARCH_METHOD_DEFAULT_TITLE","PluginRegistry","add","guideBlockName","getSteps","options","services","GuideUtils","toggleSelector","getGuideElementSelector","content","mainAction","title","class","url","elementSelector","clickableElementSelector","onNextValidate","Promise","resolve","isChecked","showOn","validateTextInput","ontologyGraph","angular","extend","text","sparqlQuery","steps","addMissingNamespaces","push","shouldToggleOff","disable","configurationOption"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=96089;export const __webpack_ids__=[96089];export const __webpack_modules__={96089:(e,t,n)=>{n.r(t);var o=n(73964);angular.module("graphdb.framework.rest.ttyg.service",[]).factory("TTYGRestService",i),i.$inject=["$http"];const s="rest/chat/conversations",a="rest/chat/agents",r=`${s}/explain`,g=!1;function i(e){const t=new o.TtygRestServiceFakeBackend;return{getConversation:n=>g?t.getConversation(n):e.get(`${s}/${n}`),renameConversation:(n,o)=>g?t.renameConversation(n,o):e.put(`${s}/${n}`,o),exportConversation:n=>g?t.exportConversation(n):e.get(`${s}/export/${n}`,{responseType:"blob"}),askQuestion:n=>g?t.askQuestion(n):e.post(`${s}`,n),continueChatRun:n=>g?t.continueChatRun(n):e.post(`${s}/continue`,n),getConversations:()=>g?t.getConversations():e.get(s),deleteConversation:n=>g?t.deleteConversation(n):e.delete(`${s}/${n}`),createConversation:(n={})=>g?t.createConversation(n):e.post(s,n),getAgents:()=>g?t.getAgents():e.get(a),getAgent:n=>g?t.getAgent(n):e.get(`${a}/${n}`),createAgent:n=>g?t.createAgent(n):e.post(a,n),editAgent:n=>g?t.editAgent(n):e.put(`${a}`,n),deleteAgent:n=>g?t.deleteAgent(n):e.delete(`${a}/${n}`),explainResponse:(n={})=>g?t.explainResponse(n):e.post(r,n),getAgentDefaultValues:()=>g?t.getAgentDefaultValues():e.get(`${a}/default`),explainAgentSettings:n=>g?t.explainAgentSettings():e.post(`${a}/explain`,n)}}}};
2
- //# sourceMappingURL=96089.7e28823f34c450de1f7e.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"96089.7e28823f34c450de1f7e.bundle.js","mappings":"+IAEAA,QACKC,OAAO,sCAAuC,IAC9CC,QAAQ,kBAAmBC,GAEhCA,EAAgBC,QAAU,CAAC,SAE3B,MAAMC,EAAyB,0BACzBC,EAAkB,mBAClBC,EAA4B,GAAGF,YAE/BG,GAAc,EAEpB,SAASL,EAAgBM,GAErB,MAAMC,EAAe,IAAIC,EAAAA,2BAoMzB,MAAO,CACHC,gBAvLqBC,GACjBL,EACOE,EAAaE,gBAAgBC,GAEjCJ,EAAMK,IAAI,GAAGT,KAA0BQ,KAoL9CE,mBAxKuBA,CAACF,EAAIG,IACxBR,EACOE,EAAaK,mBAAmBF,EAAIG,GAExCP,EAAMQ,IAAI,GAAGZ,KAA0BQ,IAAMG,GAqKpDE,mBA7JwBL,GACpBL,EACOE,EAAaQ,mBAAmBL,GAEpCJ,EAAMK,IAAI,GAAGT,YAAiCQ,IAAM,CAACM,aAAc,SA0J1EC,YAlJiBJ,GACbR,EACOE,EAAaU,YAAYJ,GAE7BP,EAAMY,KAAK,GAAGhB,IAA0BW,GA+I/CM,gBAvIqBN,GACjBR,EACOE,EAAaY,gBAAgBN,GAEjCP,EAAMY,KAAK,GAAGhB,aAAmCW,GAoIxDO,iBAxMqBA,IACjBf,EACOE,EAAaa,mBAEjBd,EAAMK,IAAIT,GAqMjBmB,mBA7HwBX,GACpBL,EACOE,EAAac,mBAAmBX,GAEpCJ,EAAMgB,OAAO,GAAGpB,KAA0BQ,KA0HjDa,mBAlHuBA,CAACV,EAAO,CAAC,IAC5BR,EACOE,EAAagB,mBAAmBV,GAEpCP,EAAMY,KAAKhB,EAAwBW,GA+G1CW,UAxGcA,IACVnB,EAEOE,EAAaiB,YAKjBlB,EAAMK,IAAIR,GAiGjBsB,SAzFcf,GACVL,EACOE,EAAakB,SAASf,GAE1BJ,EAAMK,IAAI,GAAGR,KAAmBO,KAsFvCgB,YA9EiBC,GACbtB,EACOE,EAAamB,YAAYC,GAE7BrB,EAAMY,KAAKf,EAAiBwB,GA2EnCC,UAnEeD,GACXtB,EACOE,EAAaqB,UAAUD,GAE3BrB,EAAMQ,IAAI,GAAGX,IAAmBwB,GAgEvCE,YAxDiBnB,GACbL,EACOE,EAAasB,YAAYnB,GAE7BJ,EAAMgB,OAAO,GAAGnB,KAAmBO,KAqD1CoB,gBA7CoBA,CAACjB,EAAO,CAAC,IACzBR,EACOE,EAAauB,gBAAgBjB,GAEjCP,EAAMY,KAAKd,EAA2BS,GA0C7CkB,sBAnC0BA,IACtB1B,EACOE,EAAawB,wBAEjBzB,EAAMK,IAAI,GAAGR,aAgCpB6B,qBAxB0BnB,GACtBR,EACOE,EAAayB,uBAEjB1B,EAAMY,KAAK,GAAGf,YAA2BU,GAsBxD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/rest/ttyg.rest.service.js"],"sourcesContent":["import {TtygRestServiceFakeBackend} from './ttyg.rest.service.fake.backend';\n\nangular\n .module('graphdb.framework.rest.ttyg.service', [])\n .factory('TTYGRestService', TTYGRestService);\n\nTTYGRestService.$inject = ['$http'];\n\nconst CONVERSATIONS_ENDPOINT = 'rest/chat/conversations';\nconst AGENTS_ENDPOINT = 'rest/chat/agents';\nconst EXPLAIN_RESPONSE_ENDPOINT = `${CONVERSATIONS_ENDPOINT}/explain`;\n\nconst DEVELOPMENT = false;\n\nfunction TTYGRestService($http) {\n\n const _fakeBackend = new TtygRestServiceFakeBackend();\n\n const getConversations = () => {\n if (DEVELOPMENT) {\n return _fakeBackend.getConversations();\n }\n return $http.get(CONVERSATIONS_ENDPOINT);\n };\n\n /**\n * Loads a conversation by its ID.\n * @param {string} id\n * @return {Promise<*>}\n */\n const getConversation = (id) => {\n if (DEVELOPMENT) {\n return _fakeBackend.getConversation(id);\n }\n return $http.get(`${CONVERSATIONS_ENDPOINT}/${id}`);\n };\n\n /**\n * Calls the REST API to rename the conversation.\n *\n * Bear in mind that the backend doesn't return the whole conversation object, but only the name and the ID.\n *\n * @param {string} id - the conversation ID\n * @param {{name: string}} data - request payload containing the new name\n * @return {Promise<{name: string, id: string}>}\n */\n const renameConversation = (id, data) => {\n if (DEVELOPMENT) {\n return _fakeBackend.renameConversation(id, data);\n }\n return $http.put(`${CONVERSATIONS_ENDPOINT}/${id}`, data);\n };\n\n /**\n * Exports a conversation by its ID.\n * @param {string} id\n * @return {Promise<{Blob}>} Returns the conversation as a Blob\n */\n const exportConversation = (id) => {\n if (DEVELOPMENT) {\n return _fakeBackend.exportConversation(id);\n }\n return $http.get(`${CONVERSATIONS_ENDPOINT}/export/${id}`, {responseType: 'blob'});\n };\n\n /**\n * Calls the REST API to ask a question.\n * @param {*} data\n * @return {*}\n */\n const askQuestion = (data) => {\n if (DEVELOPMENT) {\n return _fakeBackend.askQuestion(data);\n }\n return $http.post(`${CONVERSATIONS_ENDPOINT}`, data);\n };\n\n /**\n * Calls the REST API to continue a chat run.\n * @param {*} data\n * @return {*}\n */\n const continueChatRun = (data) => {\n if (DEVELOPMENT) {\n return _fakeBackend.continueChatRun(data);\n }\n return $http.post(`${CONVERSATIONS_ENDPOINT}/continue`, data);\n };\n\n /**\n * Deletes a conversation by its ID.\n * @param {string} id\n * @return {Promise<void>}\n */\n const deleteConversation = (id) => {\n if (DEVELOPMENT) {\n return _fakeBackend.deleteConversation(id);\n }\n return $http.delete(`${CONVERSATIONS_ENDPOINT}/${id}`);\n };\n\n /**\n * Creates a new conversation.\n * @param {*} data - the data to be sent to the backend\n * @return {Promise<*>}\n */\n const createConversation = (data = {}) => {\n if (DEVELOPMENT) {\n return _fakeBackend.createConversation(data);\n }\n return $http.post(CONVERSATIONS_ENDPOINT, data);\n };\n\n /**\n * Fetches agents from the backend.\n * @return {Promise<*>|*}\n */\n const getAgents = () => {\n if (DEVELOPMENT) {\n // return _fakeBackend.simulateHttpError();\n return _fakeBackend.getAgents();\n // return new Promise((resolve) => {\n // setTimeout(() => resolve(_fakeBackend.getAgents()), 3000);\n // });\n }\n return $http.get(AGENTS_ENDPOINT);\n };\n\n /**\n * Fetches an agent by its ID from the backend.\n * @param {string} id\n * @return {Promise<Awaited<{data: T}>>|*}\n */\n const getAgent = (id) => {\n if (DEVELOPMENT) {\n return _fakeBackend.getAgent(id);\n }\n return $http.get(`${AGENTS_ENDPOINT}/${id}`);\n };\n\n /**\n * Creates a new agent in the backend.\n * @param {*} agent\n * @return {Promise<AgentModel>}\n */\n const createAgent = (agent) => {\n if (DEVELOPMENT) {\n return _fakeBackend.createAgent(agent);\n }\n return $http.post(AGENTS_ENDPOINT, agent);\n };\n\n /**\n * Updates the specified <code>agent</code>.\n * @param {AgentModel} agent - The agent to be updated.\n * @return {Promise<AgentModel>} A promise that resolves the updated agent.\n */\n const editAgent = (agent) => {\n if (DEVELOPMENT) {\n return _fakeBackend.editAgent(agent);\n }\n return $http.put(`${AGENTS_ENDPOINT}`, agent);\n };\n\n /**\n * Deletes an agent by its ID from the backend.\n * @param {string} id\n * @return {Promise<void>}\n */\n const deleteAgent = (id) => {\n if (DEVELOPMENT) {\n return _fakeBackend.deleteAgent(id);\n }\n return $http.delete(`${AGENTS_ENDPOINT}/${id}`);\n };\n\n /**\n * Calls backend server to fetch an explanation of how the answer was generated.\n * @param {*} data\n * @return {Promise}\n */\n const explainResponse = (data = {}) => {\n if (DEVELOPMENT) {\n return _fakeBackend.explainResponse(data);\n }\n return $http.post(EXPLAIN_RESPONSE_ENDPOINT, data);\n };\n\n /**\n * Calls the backend server to fetch the default values for an agent.\n * @return {Promise}\n */\n const getAgentDefaultValues = () => {\n if (DEVELOPMENT) {\n return _fakeBackend.getAgentDefaultValues();\n }\n return $http.get(`${AGENTS_ENDPOINT}/default`);\n };\n\n /**\n * Calls the backend server to fetch an explanation of how the agent settings were generated.\n * @param {*} data\n * @return {Promise}\n */\n const explainAgentSettings = (data) => {\n if (DEVELOPMENT) {\n return _fakeBackend.explainAgentSettings();\n }\n return $http.post(`${AGENTS_ENDPOINT}/explain`, data);\n };\n\n\n return {\n getConversation,\n renameConversation,\n exportConversation,\n askQuestion,\n continueChatRun,\n getConversations,\n deleteConversation,\n createConversation,\n getAgents,\n getAgent,\n createAgent,\n editAgent,\n deleteAgent,\n explainResponse,\n getAgentDefaultValues,\n explainAgentSettings\n };\n}\n"],"names":["angular","module","factory","TTYGRestService","$inject","CONVERSATIONS_ENDPOINT","AGENTS_ENDPOINT","EXPLAIN_RESPONSE_ENDPOINT","DEVELOPMENT","$http","_fakeBackend","TtygRestServiceFakeBackend","getConversation","id","get","renameConversation","data","put","exportConversation","responseType","askQuestion","post","continueChatRun","getConversations","deleteConversation","delete","createConversation","getAgents","getAgent","createAgent","agent","editAgent","deleteAgent","explainResponse","getAgentDefaultValues","explainAgentSettings"],"sourceRoot":""}