11import  type  {  ModelProviderIdType  }  from  './provider' ; 
22
3- export  type  LLMModelItemType  =  { 
3+ type  PriceType  =  { 
4+   charsPointsPrice ?: number ;  // 1k chars=n points; 60s=n points; 
5+ 
6+   // If inputPrice is set, the input-output charging scheme is adopted 
7+   inputPrice ?: number ;  // 1k tokens=n points 
8+   outputPrice ?: number ;  // 1k tokens=n points 
9+ } ; 
10+ export  type  LLMModelItemType  =  PriceType  &  { 
411  provider : ModelProviderIdType ; 
512  model : string ; 
613  name : string ; 
@@ -10,8 +17,6 @@ export type LLMModelItemType = {
1017  quoteMaxToken : number ; 
1118  maxTemperature : number ; 
1219
13-   charsPointsPrice : number ;  // 1k chars=n points 
14- 
1520  censor ?: boolean ; 
1621  vision ?: boolean ; 
1722
@@ -33,13 +38,12 @@ export type LLMModelItemType = {
3338  fieldMap ?: Record < string ,  string > ; 
3439} ; 
3540
36- export  type  VectorModelItemType  =  { 
41+ export  type  VectorModelItemType  =  PriceType   &   { 
3742  provider : ModelProviderIdType ; 
3843  model : string ;  // model name 
3944  name : string ;  // show name 
4045  avatar ?: string ; 
4146  defaultToken : number ;  // split text default token 
42-   charsPointsPrice : number ;  // 1k tokens=n points 
4347  maxToken : number ;  // model max token 
4448  weight : number ;  // training weight 
4549  hidden ?: boolean ;  // Disallow creation 
@@ -48,25 +52,22 @@ export type VectorModelItemType = {
4852  queryConfig ?: Record < string ,  any > ;  // Custom parameters for query 
4953} ; 
5054
51- export  type  ReRankModelItemType  =  { 
55+ export  type  ReRankModelItemType  =  PriceType   &   { 
5256  model : string ; 
5357  name : string ; 
54-   charsPointsPrice : number ; 
5558  requestUrl : string ; 
5659  requestAuth : string ; 
5760} ; 
5861
59- export  type  AudioSpeechModelType  =  { 
62+ export  type  AudioSpeechModelType  =  PriceType   &   { 
6063  provider : ModelProviderIdType ; 
6164  model : string ; 
6265  name : string ; 
63-   charsPointsPrice : number ; 
6466  voices : {  label : string ;  value : string ;  bufferId : string  } [ ] ; 
6567} ; 
6668
67- export  type  STTModelType  =  { 
69+ export  type  STTModelType  =  PriceType   &   { 
6870  provider : ModelProviderIdType ; 
6971  model : string ; 
7072  name : string ; 
71-   charsPointsPrice : number ;  // 60s = n points 
7273} ; 
0 commit comments