Skip to content

Commit

Permalink
fix 视觉模型历史会话拼接bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Unagi-cq committed Jan 13, 2025
1 parent 97ad3b5 commit 48fe0b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion thchat-ui/src/components/SendBox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default {
if (this.$store.state.setting.memory) {
// 只保留最近memory_limit条有效对话
history = this.active_session_qa_data
.slice(this.$store.state.setting.memory_limit * -1)
.slice((this.$store.state.setting.memory_limit + 1) * -1)
.filter(item => item.answer && item.answer.trim());
}
Expand Down
8 changes: 4 additions & 4 deletions thchat-ui/src/util/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ function buildZhipuVLMessage(prompt, history, files) {
const chat = history[i];
array.push({
"role": "user",
"content": { "type": "text", "text": chat.query }
"content": [{ "type": "text", "text": chat.query }]
});
array.push({
"role": "assistant",
"content": { "type": "text", "text": chat.answer }
"content": [{ "type": "text", "text": chat.answer }]
});
}
return array;
Expand Down Expand Up @@ -205,11 +205,11 @@ function buildAliVLMessage(prompt, history, files) {
const chat = history[i];
array.push({
"role": "user",
"content": { "text": chat.query }
"content": [{ "text": chat.query }]
});
array.push({
"role": "assistant",
"content": { "text": chat.answer }
"content": [{ "text": chat.answer }]
});
}
return array;
Expand Down

0 comments on commit 48fe0b5

Please sign in to comment.