mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-06 02:47:56 +00:00
refactor: address review feedback
- Remove unused UNWANTED_PATTERN property - Add more detailed comment explaining the issue origin - Clarify that sanitization preserves legitimate Chinese text
This commit is contained in:
parent
5df2ce0882
commit
37ee6779b1
1 changed files with 4 additions and 5 deletions
|
|
@ -10,9 +10,6 @@ import type { ApiHandlerCreateMessageMetadata } from "../index"
|
|||
import { OpenAiHandler } from "./openai"
|
||||
|
||||
export class DeepSeekHandler extends OpenAiHandler {
|
||||
// Pattern to match unwanted "极速模式" characters and its variations
|
||||
private readonly UNWANTED_PATTERN = /[极極][速][模][式]|[极極]|[速]?[模]?[式]?/g
|
||||
|
||||
constructor(options: ApiHandlerOptions) {
|
||||
super({
|
||||
...options,
|
||||
|
|
@ -53,8 +50,10 @@ export class DeepSeekHandler extends OpenAiHandler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes unwanted "极速模式" characters from the content.
|
||||
* These characters appear to be injected by some DeepSeek V3.1 configurations.
|
||||
* Removes unwanted "极速模式" (speed mode) characters from the content.
|
||||
* These characters appear to be injected by some DeepSeek V3.1 configurations,
|
||||
* possibly from a Chinese language interface or prompt template.
|
||||
* The sanitization preserves legitimate Chinese text while removing these artifacts.
|
||||
*/
|
||||
private sanitizeContent(content: string): string {
|
||||
// First, try to remove the complete phrase "极速模式"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue