Skip to content

Commit 37ee677

Browse files
committed
refactor: address review feedback
- Remove unused UNWANTED_PATTERN property - Add more detailed comment explaining the issue origin - Clarify that sanitization preserves legitimate Chinese text
1 parent 5df2ce0 commit 37ee677

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/api/providers/deepseek.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import type { ApiHandlerCreateMessageMetadata } from "../index"
1010
import { OpenAiHandler } from "./openai"
1111

1212
export class DeepSeekHandler extends OpenAiHandler {
13-
// Pattern to match unwanted "极速模式" characters and its variations
14-
private readonly UNWANTED_PATTERN = /[][][][]|[]|[]?[]?[]?/g
15-
1613
constructor(options: ApiHandlerOptions) {
1714
super({
1815
...options,
@@ -53,8 +50,10 @@ export class DeepSeekHandler extends OpenAiHandler {
5350
}
5451

5552
/**
56-
* Removes unwanted "极速模式" characters from the content.
57-
* These characters appear to be injected by some DeepSeek V3.1 configurations.
53+
* Removes unwanted "极速模式" (speed mode) characters from the content.
54+
* These characters appear to be injected by some DeepSeek V3.1 configurations,
55+
* possibly from a Chinese language interface or prompt template.
56+
* The sanitization preserves legitimate Chinese text while removing these artifacts.
5857
*/
5958
private sanitizeContent(content: string): string {
6059
// First, try to remove the complete phrase "极速模式"

0 commit comments

Comments
 (0)