File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { ProviderAPIConfig } from '../types' ;
2
2
3
3
export const dashscopeAPIConfig : ProviderAPIConfig = {
4
- getBaseURL : ( ) => 'https://dashscope.aliyuncs.com/compatible-mode/v1 ' ,
4
+ getBaseURL : ( ) => 'https://dashscope.aliyuncs.com' ,
5
5
headers ( { providerOptions } ) {
6
6
const { apiKey } = providerOptions ;
7
7
return { Authorization : `Bearer ${ apiKey } ` } ;
8
8
} ,
9
9
getEndpoint ( { fn } ) {
10
10
switch ( fn ) {
11
11
case 'chatComplete' :
12
- return `/chat/completions` ;
12
+ return `/compatible-mode/v1/ chat/completions` ;
13
13
case 'embed' :
14
- return `/embeddings` ;
14
+ return `/compatible-mode/v1/embeddings` ;
15
+ case 'rerank' :
16
+ return `/api/v1/services/rerank/text-rerank/text-rerank` ;
15
17
default :
16
18
return '' ;
17
19
}
Original file line number Diff line number Diff line change @@ -8,8 +8,45 @@ import { ProviderConfigs } from '../types';
8
8
import { dashscopeAPIConfig } from './api' ;
9
9
10
10
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
+ ) ,
12
35
embed : embedParams ( [ ] , { model : 'text-embedding-v1' } ) ,
36
+ rerank : {
37
+ model : {
38
+ param : 'model' ,
39
+ } ,
40
+ query : {
41
+ param : 'input.query' ,
42
+ } ,
43
+ documents : {
44
+ param : 'input.documents' ,
45
+ } ,
46
+ parameters : {
47
+ param : 'parameters' ,
48
+ } ,
49
+ } ,
13
50
api : dashscopeAPIConfig ,
14
51
responseTransforms : responseTransformers ( DASHSCOPE , {
15
52
chatComplete : true ,
You can’t perform that action at this time.
0 commit comments