Skip to content

Commit 67f0d23

Browse files
authored
fix: 修复ai issue单 (#324)
1 parent cd20ab5 commit 67f0d23

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

  • packages

packages/docs/fluent-editor/demos/ai.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ onMounted(() => {
2222
container: TOOLBAR_CONFIG,
2323
},
2424
ai: {
25-
host: 'http://localhost:11434',
25+
host: 'http://localhost:11434/api/generate',
2626
model: 'deepseek-r1:8b',
2727
apiKey: '',
2828
contentMaxLength: 1000,

packages/fluent-editor/src/modules/ai/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export class AI {
642642
this.isBreak = false // 重置打断标记,防止重复打断ai
643643
// 这里实现实际的AI查询逻辑
644644
try {
645-
const response = await fetch(`${this.host}/api/generate`, {
645+
const response = await fetch(`${this.host}`, {
646646
method: 'POST',
647647
headers: {
648648
'Content-Type': 'application/json',
@@ -709,6 +709,7 @@ export class AI {
709709
}
710710
else {
711711
this.isBreak = true
712+
this.charCount = 0
712713
}
713714
this.showResultPopupEl = true
714715
}

0 commit comments

Comments
 (0)