balibabu commited on
Commit
79f4fcc
·
1 Parent(s): 9fe9fc4

feat: fixed an issue where the default value for temperature was not set when creating a new chat and install remark-gfm so that the markdown table can be displayed (#124)

Browse files

* feat: install remark-gfm so that the markdown table can be displayed

* feat: fixed an issue where the default value for temperature was not set when creating a new chat

web/package-lock.json CHANGED
@@ -25,6 +25,7 @@
25
  "react-markdown": "^9.0.1",
26
  "react-pdf-highlighter": "^6.1.0",
27
  "react-string-replace": "^1.1.1",
 
28
  "umi": "^4.0.90",
29
  "umi-request": "^1.4.0",
30
  "unist-util-visit-parents": "^6.0.1",
@@ -11087,6 +11088,11 @@
11087
  "node": ">=0.10.0"
11088
  }
11089
  },
 
 
 
 
 
11090
  "node_modules/mathml-tag-names": {
11091
  "version": "2.1.3",
11092
  "resolved": "https://registry.npmmirror.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
@@ -11103,6 +11109,25 @@
11103
  "safe-buffer": "^5.1.2"
11104
  }
11105
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11106
  "node_modules/mdast-util-from-markdown": {
11107
  "version": "2.0.0",
11108
  "resolved": "https://registry.npmmirror.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz",
@@ -11122,6 +11147,77 @@
11122
  "unist-util-stringify-position": "^4.0.0"
11123
  }
11124
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11125
  "node_modules/mdast-util-mdx-expression": {
11126
  "version": "2.0.0",
11127
  "resolved": "https://registry.npmmirror.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz",
@@ -11315,6 +11411,92 @@
11315
  "micromark-util-types": "^2.0.0"
11316
  }
11317
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11318
  "node_modules/micromark-factory-destination": {
11319
  "version": "2.0.0",
11320
  "resolved": "https://registry.npmmirror.com/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz",
@@ -14952,6 +15134,19 @@
14952
  "node": ">= 0.10"
14953
  }
14954
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
14955
  "node_modules/remark-parse": {
14956
  "version": "11.0.0",
14957
  "resolved": "https://registry.npmmirror.com/remark-parse/-/remark-parse-11.0.0.tgz",
@@ -14975,6 +15170,16 @@
14975
  "vfile": "^6.0.0"
14976
  }
14977
  },
 
 
 
 
 
 
 
 
 
 
14978
  "node_modules/remove-accents": {
14979
  "version": "0.4.2",
14980
  "resolved": "https://registry.npmmirror.com/remove-accents/-/remove-accents-0.4.2.tgz",
 
25
  "react-markdown": "^9.0.1",
26
  "react-pdf-highlighter": "^6.1.0",
27
  "react-string-replace": "^1.1.1",
28
+ "remark-gfm": "^4.0.0",
29
  "umi": "^4.0.90",
30
  "umi-request": "^1.4.0",
31
  "unist-util-visit-parents": "^6.0.1",
 
11088
  "node": ">=0.10.0"
11089
  }
11090
  },
11091
+ "node_modules/markdown-table": {
11092
+ "version": "3.0.3",
11093
+ "resolved": "https://registry.npmmirror.com/markdown-table/-/markdown-table-3.0.3.tgz",
11094
+ "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw=="
11095
+ },
11096
  "node_modules/mathml-tag-names": {
11097
  "version": "2.1.3",
11098
  "resolved": "https://registry.npmmirror.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
 
11109
  "safe-buffer": "^5.1.2"
11110
  }
11111
  },
11112
+ "node_modules/mdast-util-find-and-replace": {
11113
+ "version": "3.0.1",
11114
+ "resolved": "https://registry.npmmirror.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz",
11115
+ "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==",
11116
+ "dependencies": {
11117
+ "@types/mdast": "^4.0.0",
11118
+ "escape-string-regexp": "^5.0.0",
11119
+ "unist-util-is": "^6.0.0",
11120
+ "unist-util-visit-parents": "^6.0.0"
11121
+ }
11122
+ },
11123
+ "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": {
11124
+ "version": "5.0.0",
11125
+ "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
11126
+ "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
11127
+ "engines": {
11128
+ "node": ">=12"
11129
+ }
11130
+ },
11131
  "node_modules/mdast-util-from-markdown": {
11132
  "version": "2.0.0",
11133
  "resolved": "https://registry.npmmirror.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz",
 
11147
  "unist-util-stringify-position": "^4.0.0"
11148
  }
11149
  },
11150
+ "node_modules/mdast-util-gfm": {
11151
+ "version": "3.0.0",
11152
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz",
11153
+ "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==",
11154
+ "dependencies": {
11155
+ "mdast-util-from-markdown": "^2.0.0",
11156
+ "mdast-util-gfm-autolink-literal": "^2.0.0",
11157
+ "mdast-util-gfm-footnote": "^2.0.0",
11158
+ "mdast-util-gfm-strikethrough": "^2.0.0",
11159
+ "mdast-util-gfm-table": "^2.0.0",
11160
+ "mdast-util-gfm-task-list-item": "^2.0.0",
11161
+ "mdast-util-to-markdown": "^2.0.0"
11162
+ }
11163
+ },
11164
+ "node_modules/mdast-util-gfm-autolink-literal": {
11165
+ "version": "2.0.0",
11166
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz",
11167
+ "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==",
11168
+ "dependencies": {
11169
+ "@types/mdast": "^4.0.0",
11170
+ "ccount": "^2.0.0",
11171
+ "devlop": "^1.0.0",
11172
+ "mdast-util-find-and-replace": "^3.0.0",
11173
+ "micromark-util-character": "^2.0.0"
11174
+ }
11175
+ },
11176
+ "node_modules/mdast-util-gfm-footnote": {
11177
+ "version": "2.0.0",
11178
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz",
11179
+ "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==",
11180
+ "dependencies": {
11181
+ "@types/mdast": "^4.0.0",
11182
+ "devlop": "^1.1.0",
11183
+ "mdast-util-from-markdown": "^2.0.0",
11184
+ "mdast-util-to-markdown": "^2.0.0",
11185
+ "micromark-util-normalize-identifier": "^2.0.0"
11186
+ }
11187
+ },
11188
+ "node_modules/mdast-util-gfm-strikethrough": {
11189
+ "version": "2.0.0",
11190
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz",
11191
+ "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==",
11192
+ "dependencies": {
11193
+ "@types/mdast": "^4.0.0",
11194
+ "mdast-util-from-markdown": "^2.0.0",
11195
+ "mdast-util-to-markdown": "^2.0.0"
11196
+ }
11197
+ },
11198
+ "node_modules/mdast-util-gfm-table": {
11199
+ "version": "2.0.0",
11200
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz",
11201
+ "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==",
11202
+ "dependencies": {
11203
+ "@types/mdast": "^4.0.0",
11204
+ "devlop": "^1.0.0",
11205
+ "markdown-table": "^3.0.0",
11206
+ "mdast-util-from-markdown": "^2.0.0",
11207
+ "mdast-util-to-markdown": "^2.0.0"
11208
+ }
11209
+ },
11210
+ "node_modules/mdast-util-gfm-task-list-item": {
11211
+ "version": "2.0.0",
11212
+ "resolved": "https://registry.npmmirror.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz",
11213
+ "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==",
11214
+ "dependencies": {
11215
+ "@types/mdast": "^4.0.0",
11216
+ "devlop": "^1.0.0",
11217
+ "mdast-util-from-markdown": "^2.0.0",
11218
+ "mdast-util-to-markdown": "^2.0.0"
11219
+ }
11220
+ },
11221
  "node_modules/mdast-util-mdx-expression": {
11222
  "version": "2.0.0",
11223
  "resolved": "https://registry.npmmirror.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz",
 
11411
  "micromark-util-types": "^2.0.0"
11412
  }
11413
  },
11414
+ "node_modules/micromark-extension-gfm": {
11415
+ "version": "3.0.0",
11416
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",
11417
+ "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==",
11418
+ "dependencies": {
11419
+ "micromark-extension-gfm-autolink-literal": "^2.0.0",
11420
+ "micromark-extension-gfm-footnote": "^2.0.0",
11421
+ "micromark-extension-gfm-strikethrough": "^2.0.0",
11422
+ "micromark-extension-gfm-table": "^2.0.0",
11423
+ "micromark-extension-gfm-tagfilter": "^2.0.0",
11424
+ "micromark-extension-gfm-task-list-item": "^2.0.0",
11425
+ "micromark-util-combine-extensions": "^2.0.0",
11426
+ "micromark-util-types": "^2.0.0"
11427
+ }
11428
+ },
11429
+ "node_modules/micromark-extension-gfm-autolink-literal": {
11430
+ "version": "2.0.0",
11431
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz",
11432
+ "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==",
11433
+ "dependencies": {
11434
+ "micromark-util-character": "^2.0.0",
11435
+ "micromark-util-sanitize-uri": "^2.0.0",
11436
+ "micromark-util-symbol": "^2.0.0",
11437
+ "micromark-util-types": "^2.0.0"
11438
+ }
11439
+ },
11440
+ "node_modules/micromark-extension-gfm-footnote": {
11441
+ "version": "2.0.0",
11442
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz",
11443
+ "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==",
11444
+ "dependencies": {
11445
+ "devlop": "^1.0.0",
11446
+ "micromark-core-commonmark": "^2.0.0",
11447
+ "micromark-factory-space": "^2.0.0",
11448
+ "micromark-util-character": "^2.0.0",
11449
+ "micromark-util-normalize-identifier": "^2.0.0",
11450
+ "micromark-util-sanitize-uri": "^2.0.0",
11451
+ "micromark-util-symbol": "^2.0.0",
11452
+ "micromark-util-types": "^2.0.0"
11453
+ }
11454
+ },
11455
+ "node_modules/micromark-extension-gfm-strikethrough": {
11456
+ "version": "2.0.0",
11457
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz",
11458
+ "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==",
11459
+ "dependencies": {
11460
+ "devlop": "^1.0.0",
11461
+ "micromark-util-chunked": "^2.0.0",
11462
+ "micromark-util-classify-character": "^2.0.0",
11463
+ "micromark-util-resolve-all": "^2.0.0",
11464
+ "micromark-util-symbol": "^2.0.0",
11465
+ "micromark-util-types": "^2.0.0"
11466
+ }
11467
+ },
11468
+ "node_modules/micromark-extension-gfm-table": {
11469
+ "version": "2.0.0",
11470
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz",
11471
+ "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==",
11472
+ "dependencies": {
11473
+ "devlop": "^1.0.0",
11474
+ "micromark-factory-space": "^2.0.0",
11475
+ "micromark-util-character": "^2.0.0",
11476
+ "micromark-util-symbol": "^2.0.0",
11477
+ "micromark-util-types": "^2.0.0"
11478
+ }
11479
+ },
11480
+ "node_modules/micromark-extension-gfm-tagfilter": {
11481
+ "version": "2.0.0",
11482
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz",
11483
+ "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==",
11484
+ "dependencies": {
11485
+ "micromark-util-types": "^2.0.0"
11486
+ }
11487
+ },
11488
+ "node_modules/micromark-extension-gfm-task-list-item": {
11489
+ "version": "2.0.1",
11490
+ "resolved": "https://registry.npmmirror.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz",
11491
+ "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==",
11492
+ "dependencies": {
11493
+ "devlop": "^1.0.0",
11494
+ "micromark-factory-space": "^2.0.0",
11495
+ "micromark-util-character": "^2.0.0",
11496
+ "micromark-util-symbol": "^2.0.0",
11497
+ "micromark-util-types": "^2.0.0"
11498
+ }
11499
+ },
11500
  "node_modules/micromark-factory-destination": {
11501
  "version": "2.0.0",
11502
  "resolved": "https://registry.npmmirror.com/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz",
 
15134
  "node": ">= 0.10"
15135
  }
15136
  },
15137
+ "node_modules/remark-gfm": {
15138
+ "version": "4.0.0",
15139
+ "resolved": "https://registry.npmmirror.com/remark-gfm/-/remark-gfm-4.0.0.tgz",
15140
+ "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==",
15141
+ "dependencies": {
15142
+ "@types/mdast": "^4.0.0",
15143
+ "mdast-util-gfm": "^3.0.0",
15144
+ "micromark-extension-gfm": "^3.0.0",
15145
+ "remark-parse": "^11.0.0",
15146
+ "remark-stringify": "^11.0.0",
15147
+ "unified": "^11.0.0"
15148
+ }
15149
+ },
15150
  "node_modules/remark-parse": {
15151
  "version": "11.0.0",
15152
  "resolved": "https://registry.npmmirror.com/remark-parse/-/remark-parse-11.0.0.tgz",
 
15170
  "vfile": "^6.0.0"
15171
  }
15172
  },
15173
+ "node_modules/remark-stringify": {
15174
+ "version": "11.0.0",
15175
+ "resolved": "https://registry.npmmirror.com/remark-stringify/-/remark-stringify-11.0.0.tgz",
15176
+ "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==",
15177
+ "dependencies": {
15178
+ "@types/mdast": "^4.0.0",
15179
+ "mdast-util-to-markdown": "^2.0.0",
15180
+ "unified": "^11.0.0"
15181
+ }
15182
+ },
15183
  "node_modules/remove-accents": {
15184
  "version": "0.4.2",
15185
  "resolved": "https://registry.npmmirror.com/remove-accents/-/remove-accents-0.4.2.tgz",
web/package.json CHANGED
@@ -29,6 +29,7 @@
29
  "react-markdown": "^9.0.1",
30
  "react-pdf-highlighter": "^6.1.0",
31
  "react-string-replace": "^1.1.1",
 
32
  "umi": "^4.0.90",
33
  "umi-request": "^1.4.0",
34
  "unist-util-visit-parents": "^6.0.1",
 
29
  "react-markdown": "^9.0.1",
30
  "react-pdf-highlighter": "^6.1.0",
31
  "react-string-replace": "^1.1.1",
32
+ "remark-gfm": "^4.0.0",
33
  "umi": "^4.0.90",
34
  "umi-request": "^1.4.0",
35
  "unist-util-visit-parents": "^6.0.1",
web/src/pages/chat/chat-configuration-modal/index.tsx CHANGED
@@ -1,5 +1,9 @@
1
  import { ReactComponent as ChatConfigurationAtom } from '@/assets/svg/chat-configuration-atom.svg';
2
  import { IModalManagerChildrenProps } from '@/components/modal-manager';
 
 
 
 
3
  import { IDialog } from '@/interfaces/database/chat';
4
  import { Divider, Flex, Form, Modal, Segmented, UploadFile } from 'antd';
5
  import { SegmentedValue } from 'antd/es/segmented';
@@ -130,6 +134,9 @@ const ChatConfigurationModal = ({
130
  }
131
  form.setFieldsValue({
132
  ...initialDialog,
 
 
 
133
  icon: fileList,
134
  llm_id: initialDialog.llm_id ?? modelId,
135
  });
 
1
  import { ReactComponent as ChatConfigurationAtom } from '@/assets/svg/chat-configuration-atom.svg';
2
  import { IModalManagerChildrenProps } from '@/components/modal-manager';
3
+ import {
4
+ ModelVariableType,
5
+ settledModelVariableMap,
6
+ } from '@/constants/knowledge';
7
  import { IDialog } from '@/interfaces/database/chat';
8
  import { Divider, Flex, Form, Modal, Segmented, UploadFile } from 'antd';
9
  import { SegmentedValue } from 'antd/es/segmented';
 
134
  }
135
  form.setFieldsValue({
136
  ...initialDialog,
137
+ llm_setting:
138
+ initialDialog.llm_setting ??
139
+ settledModelVariableMap[ModelVariableType.Precise],
140
  icon: fileList,
141
  llm_id: initialDialog.llm_id ?? modelId,
142
  });
web/src/pages/chat/chat-configuration-modal/model-setting.tsx CHANGED
@@ -75,7 +75,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
75
  <Form.Item
76
  name={['llm_setting', 'temperature']}
77
  noStyle
78
- rules={[{ required: true, message: 'Province is required' }]}
79
  >
80
  <Slider className={styles.variableSlider} max={1} step={0.01} />
81
  </Form.Item>
@@ -83,7 +83,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
83
  <Form.Item
84
  name={['llm_setting', 'temperature']}
85
  noStyle
86
- rules={[{ required: true, message: 'Street is required' }]}
87
  >
88
  <InputNumber
89
  className={styles.sliderInputNumber}
@@ -103,7 +103,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
103
  <Form.Item
104
  name={['llm_setting', 'top_p']}
105
  noStyle
106
- rules={[{ required: true, message: 'Province is required' }]}
107
  >
108
  <Slider className={styles.variableSlider} max={1} step={0.01} />
109
  </Form.Item>
@@ -111,7 +111,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
111
  <Form.Item
112
  name={['llm_setting', 'top_p']}
113
  noStyle
114
- rules={[{ required: true, message: 'Street is required' }]}
115
  >
116
  <InputNumber
117
  className={styles.sliderInputNumber}
@@ -135,7 +135,9 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
135
  <Form.Item
136
  name={['llm_setting', 'presence_penalty']}
137
  noStyle
138
- rules={[{ required: true, message: 'Province is required' }]}
 
 
139
  >
140
  <Slider className={styles.variableSlider} max={1} step={0.01} />
141
  </Form.Item>
@@ -143,7 +145,9 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
143
  <Form.Item
144
  name={['llm_setting', 'presence_penalty']}
145
  noStyle
146
- rules={[{ required: true, message: 'Street is required' }]}
 
 
147
  >
148
  <InputNumber
149
  className={styles.sliderInputNumber}
@@ -167,7 +171,9 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
167
  <Form.Item
168
  name={['llm_setting', 'frequency_penalty']}
169
  noStyle
170
- rules={[{ required: true, message: 'Province is required' }]}
 
 
171
  >
172
  <Slider className={styles.variableSlider} max={1} step={0.01} />
173
  </Form.Item>
@@ -175,7 +181,9 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
175
  <Form.Item
176
  name={['llm_setting', 'frequency_penalty']}
177
  noStyle
178
- rules={[{ required: true, message: 'Street is required' }]}
 
 
179
  >
180
  <InputNumber
181
  className={styles.sliderInputNumber}
@@ -195,7 +203,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
195
  <Form.Item
196
  name={['llm_setting', 'max_tokens']}
197
  noStyle
198
- rules={[{ required: true, message: 'Province is required' }]}
199
  >
200
  <Slider className={styles.variableSlider} max={2048} />
201
  </Form.Item>
@@ -203,7 +211,7 @@ const ModelSetting = ({ show, form }: ISegmentedContentProps) => {
203
  <Form.Item
204
  name={['llm_setting', 'max_tokens']}
205
  noStyle
206
- rules={[{ required: true, message: 'Street is required' }]}
207
  >
208
  <InputNumber
209
  className={styles.sliderInputNumber}
 
75
  <Form.Item
76
  name={['llm_setting', 'temperature']}
77
  noStyle
78
+ rules={[{ required: true, message: 'Temperature is required' }]}
79
  >
80
  <Slider className={styles.variableSlider} max={1} step={0.01} />
81
  </Form.Item>
 
83
  <Form.Item
84
  name={['llm_setting', 'temperature']}
85
  noStyle
86
+ rules={[{ required: true, message: 'Temperature is required' }]}
87
  >
88
  <InputNumber
89
  className={styles.sliderInputNumber}
 
103
  <Form.Item
104
  name={['llm_setting', 'top_p']}
105
  noStyle
106
+ rules={[{ required: true, message: 'Top_p is required' }]}
107
  >
108
  <Slider className={styles.variableSlider} max={1} step={0.01} />
109
  </Form.Item>
 
111
  <Form.Item
112
  name={['llm_setting', 'top_p']}
113
  noStyle
114
+ rules={[{ required: true, message: 'Top_p is required' }]}
115
  >
116
  <InputNumber
117
  className={styles.sliderInputNumber}
 
135
  <Form.Item
136
  name={['llm_setting', 'presence_penalty']}
137
  noStyle
138
+ rules={[
139
+ { required: true, message: 'Presence Penalty is required' },
140
+ ]}
141
  >
142
  <Slider className={styles.variableSlider} max={1} step={0.01} />
143
  </Form.Item>
 
145
  <Form.Item
146
  name={['llm_setting', 'presence_penalty']}
147
  noStyle
148
+ rules={[
149
+ { required: true, message: 'Presence Penalty is required' },
150
+ ]}
151
  >
152
  <InputNumber
153
  className={styles.sliderInputNumber}
 
171
  <Form.Item
172
  name={['llm_setting', 'frequency_penalty']}
173
  noStyle
174
+ rules={[
175
+ { required: true, message: 'Frequency Penalty is required' },
176
+ ]}
177
  >
178
  <Slider className={styles.variableSlider} max={1} step={0.01} />
179
  </Form.Item>
 
181
  <Form.Item
182
  name={['llm_setting', 'frequency_penalty']}
183
  noStyle
184
+ rules={[
185
+ { required: true, message: 'Frequency Penalty is required' },
186
+ ]}
187
  >
188
  <InputNumber
189
  className={styles.sliderInputNumber}
 
203
  <Form.Item
204
  name={['llm_setting', 'max_tokens']}
205
  noStyle
206
+ rules={[{ required: true, message: 'Max Tokens is required' }]}
207
  >
208
  <Slider className={styles.variableSlider} max={2048} />
209
  </Form.Item>
 
211
  <Form.Item
212
  name={['llm_setting', 'max_tokens']}
213
  noStyle
214
+ rules={[{ required: true, message: 'Max Tokens is required' }]}
215
  >
216
  <InputNumber
217
  className={styles.sliderInputNumber}
web/src/pages/chat/chat-container/index.less CHANGED
@@ -15,7 +15,7 @@
15
  width: 70%;
16
  }
17
  .messageItemSectionRight {
18
- width: 30%;
19
  }
20
  .messageItemContent {
21
  display: inline-flex;
 
15
  width: 70%;
16
  }
17
  .messageItemSectionRight {
18
+ width: 40%;
19
  }
20
  .messageItemContent {
21
  display: inline-flex;
web/src/pages/chat/chat-container/index.tsx CHANGED
@@ -1,8 +1,14 @@
1
  import { ReactComponent as AssistantIcon } from '@/assets/svg/assistant.svg';
 
 
 
2
  import { MessageType } from '@/constants/chat';
 
3
  import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
4
  import { useSelectUserInfo } from '@/hooks/userSettingHook';
5
  import { IReference, Message } from '@/interfaces/database/chat';
 
 
6
  import {
7
  Avatar,
8
  Button,
@@ -16,7 +22,10 @@ import {
16
  } from 'antd';
17
  import classNames from 'classnames';
18
  import { ChangeEventHandler, useCallback, useMemo, useState } from 'react';
 
19
  import reactStringReplace from 'react-string-replace';
 
 
20
  import {
21
  useClickDrawer,
22
  useFetchConversationOnMount,
@@ -24,14 +33,6 @@ import {
24
  useSendMessage,
25
  } from '../hooks';
26
 
27
- import Image from '@/components/image';
28
- import NewDocumentLink from '@/components/new-document-link';
29
- import DocumentPreviewer from '@/components/pdf-previewer';
30
- import { useSelectFileThumbnails } from '@/hooks/knowledgeHook';
31
- import { IChunk } from '@/interfaces/database/knowledge';
32
- import { InfoCircleOutlined } from '@ant-design/icons';
33
- import Markdown from 'react-markdown';
34
- import { visitParents } from 'unist-util-visit-parents';
35
  import styles from './index.less';
36
 
37
  const reg = /(#{2}\d+\${2})/g;
@@ -178,6 +179,7 @@ const MessageItem = ({
178
  {item.content !== '' ? (
179
  <Markdown
180
  rehypePlugins={[rehypeWrapReference]}
 
181
  components={
182
  {
183
  'custom-typography': ({
@@ -243,7 +245,9 @@ const ChatContainer = () => {
243
  };
244
 
245
  const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
246
- setValue(e.target.value);
 
 
247
  };
248
 
249
  return (
 
1
  import { ReactComponent as AssistantIcon } from '@/assets/svg/assistant.svg';
2
+ import Image from '@/components/image';
3
+ import NewDocumentLink from '@/components/new-document-link';
4
+ import DocumentPreviewer from '@/components/pdf-previewer';
5
  import { MessageType } from '@/constants/chat';
6
+ import { useSelectFileThumbnails } from '@/hooks/knowledgeHook';
7
  import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
8
  import { useSelectUserInfo } from '@/hooks/userSettingHook';
9
  import { IReference, Message } from '@/interfaces/database/chat';
10
+ import { IChunk } from '@/interfaces/database/knowledge';
11
+ import { InfoCircleOutlined } from '@ant-design/icons';
12
  import {
13
  Avatar,
14
  Button,
 
22
  } from 'antd';
23
  import classNames from 'classnames';
24
  import { ChangeEventHandler, useCallback, useMemo, useState } from 'react';
25
+ import Markdown from 'react-markdown';
26
  import reactStringReplace from 'react-string-replace';
27
+ import remarkGfm from 'remark-gfm';
28
+ import { visitParents } from 'unist-util-visit-parents';
29
  import {
30
  useClickDrawer,
31
  useFetchConversationOnMount,
 
33
  useSendMessage,
34
  } from '../hooks';
35
 
 
 
 
 
 
 
 
 
36
  import styles from './index.less';
37
 
38
  const reg = /(#{2}\d+\${2})/g;
 
179
  {item.content !== '' ? (
180
  <Markdown
181
  rehypePlugins={[rehypeWrapReference]}
182
+ remarkPlugins={[remarkGfm]}
183
  components={
184
  {
185
  'custom-typography': ({
 
245
  };
246
 
247
  const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
248
+ const value = e.target.value.trim();
249
+ const nextValue = value.replaceAll('\\n', '\n');
250
+ setValue(nextValue);
251
  };
252
 
253
  return (