Skip to content

Commit c696bac

Browse files
authored
chore(dashscope): extract rerank config to a separate file
1 parent f10e236 commit c696bac

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/providers/dashscope/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '../open-ai-base';
77
import { ProviderConfigs } from '../types';
88
import { dashscopeAPIConfig } from './api';
9+
import { DashScopeRerankConfig } from './rerank';
910

1011
export const DashScopeConfig: ProviderConfigs = {
1112
chatComplete: chatCompleteParams(
@@ -33,20 +34,7 @@ export const DashScopeConfig: ProviderConfigs = {
3334
}
3435
),
3536
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-
},
37+
rerank: DashScopeRerankConfig,
5038
api: dashscopeAPIConfig,
5139
responseTransforms: responseTransformers(DASHSCOPE, {
5240
chatComplete: true,

src/providers/dashscope/rerank.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// docs: https://help.aliyun.com/zh/model-studio/text-rerank-api
2+
export const DashScopeRerankConfig = {
3+
model: {
4+
param: 'model',
5+
},
6+
query: {
7+
param: 'input.query',
8+
},
9+
documents: {
10+
param: 'input.documents',
11+
},
12+
parameters: {
13+
param: 'parameters',
14+
},
15+
};

0 commit comments

Comments
 (0)