Skip to content

Commit

Permalink
fix: version,bug (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizy authored Dec 27, 2023
1 parent f2b85cc commit 1974cd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/pages/LLMBot/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function Chat() {
temperature: 1,
top_p: 0.95,
top_k: 40,
max_tokens: -1,
repeat_penalty: 1.1,
messages: sendMessages,
},
Expand Down
9 changes: 6 additions & 3 deletions app/stores/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ class LLM {
const url = (res.message.choices[0].message?.content as string)?.split('\n')[0];
const paths = url
.toLowerCase()
.replaceAll(/\s|"|\\/g, '')
.split(',');
.replaceAll(',', ',') // chinese comma
.split(',')
.map((path) => path.replaceAll(/\s|"|\\/g, ''));
console.log('select doc url:', paths);
if (paths[0] !== 'sorry') {
let doc = ngqlDoc.ngqlMap[paths[0]]?.content;
Expand All @@ -278,7 +279,9 @@ class LLM {
const doc2 = ngqlDoc.ngqlMap[paths[1]]?.content;
if (doc2) {
doc =
doc.slice(0, this.config.maxContextLength / 2) + `\n` + doc2.slice(0, this.config.maxContextLength / 2);
doc.slice(0, (this.config.maxContextLength * 2) / 3) +
`\n` +
doc2.slice(0, this.config.maxContextLength / 2);
}
doc = doc.replaceAll(/\n\n+/g, '');
if (doc.length) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@vesoft-inc/force-graph": "2.0.7",
"@vesoft-inc/i18n": "^1.0.1",
"@vesoft-inc/icons": "^1.2.0",
"@vesoft-inc/nebula-explain-graph": "^1.0.2-beta.6",
"@vesoft-inc/nebula-explain-graph": "^1.0.3",
"@vesoft-inc/veditor": "^4.4.12",
"antd": "^5.8.4",
"axios": "^0.23.0",
Expand Down

0 comments on commit 1974cd7

Please sign in to comment.