diff --git a/app/pages/LLMBot/chat.tsx b/app/pages/LLMBot/chat.tsx index 614e434e..f11a0e94 100644 --- a/app/pages/LLMBot/chat.tsx +++ b/app/pages/LLMBot/chat.tsx @@ -78,7 +78,6 @@ function Chat() { temperature: 1, top_p: 0.95, top_k: 40, - max_tokens: -1, repeat_penalty: 1.1, messages: sendMessages, }, diff --git a/app/stores/llm.ts b/app/stores/llm.ts index 91aae60a..4c550242 100644 --- a/app/stores/llm.ts +++ b/app/stores/llm.ts @@ -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; @@ -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) { diff --git a/package.json b/package.json index 037cfda8..f1ac516d 100644 --- a/package.json +++ b/package.json @@ -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",