|
|
@@ -163,11 +163,16 @@ export class DeepSeekApi implements LLMApi {
|
|
|
}
|
|
|
// 获取当前的数据
|
|
|
const currentData = info.data;
|
|
|
- const format = '```think' + '' + '```';
|
|
|
- if (responseText.startsWith(format)) {
|
|
|
- responseText = responseText.replace(format, '');
|
|
|
+ const formatStart = '```think';
|
|
|
+ const formatEnd = 'think```';
|
|
|
+
|
|
|
+ if (currentData?.startsWith(formatStart)) {
|
|
|
+ remainText += currentData.replace(formatStart, '```think\n');
|
|
|
+ } else if (currentData?.startsWith(formatEnd)) {
|
|
|
+ remainText += currentData.replace(formatEnd, '```');
|
|
|
+ } else {
|
|
|
+ remainText += currentData;
|
|
|
}
|
|
|
- remainText += currentData;
|
|
|
},
|
|
|
async onclose() {
|
|
|
finish();
|