Skip to content

Commit 92a1be4

Browse files
authored
fix: Qwen Bad Request 400 (#12067) (#12083)
1 parent 5b93bc7 commit 92a1be4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/api/providers/qwen-code.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ export class QwenCodeHandler extends BaseProvider implements SingleCompletionHan
6969
this.client = new OpenAI({
7070
apiKey: "dummy-key-will-be-replaced",
7171
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1",
72+
defaultHeaders: {
73+
"User-Agent": `QwenCode/1.0.0 (${os.platform()}; ${os.arch()})`,
74+
"X-DashScope-CacheControl": "enable",
75+
"X-DashScope-UserAgent": `QwenCode/1.0.0 (${os.platform()}; ${os.arch()})`,
76+
"X-DashScope-AuthType": "qwen-oauth",
77+
},
7278
})
7379
}
7480
return this.client

0 commit comments

Comments
 (0)