Skip to content

Commit 1464cb4

Browse files
authored
Merge pull request #1196 from horochx/patch-3
feat: improve support for the DashScope provider
2 parents 0cc63ac + 4fcd6ee commit 1464cb4

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/providers/dashscope/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ProviderAPIConfig } from '../types';
22

33
export const dashscopeAPIConfig: ProviderAPIConfig = {
4-
getBaseURL: () => 'https://dashscope.aliyuncs.com/compatible-mode/v1',
4+
getBaseURL: () => 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
55
headers({ providerOptions }) {
66
const { apiKey } = providerOptions;
77
return { Authorization: `Bearer ${apiKey}` };

src/providers/dashscope/index.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,30 @@ import { ProviderConfigs } from '../types';
88
import { dashscopeAPIConfig } from './api';
99

1010
export const DashScopeConfig: ProviderConfigs = {
11-
chatComplete: chatCompleteParams([], { model: 'qwen-turbo' }),
11+
chatComplete: chatCompleteParams(
12+
[],
13+
{ model: 'qwen-turbo' },
14+
{
15+
top_k: {
16+
param: 'top_k',
17+
},
18+
repetition_penalty: {
19+
param: 'repetition_penalty',
20+
},
21+
stop: {
22+
param: 'stop',
23+
},
24+
enable_search: {
25+
param: 'enable_search',
26+
},
27+
enable_thinking: {
28+
param: 'enable_thinking',
29+
},
30+
thinking_budget: {
31+
param: 'thinking_budget',
32+
},
33+
}
34+
),
1235
embed: embedParams([], { model: 'text-embedding-v1' }),
1336
api: dashscopeAPIConfig,
1437
responseTransforms: responseTransformers(DASHSCOPE, {

0 commit comments

Comments
 (0)