Skip to content

Commit

Permalink
🐛 fix: fix model list
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jul 12, 2024
1 parent b4c7257 commit 4112e0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const getLLMConfig = () => {
AWS_ACCESS_KEY_ID: z.string().optional(),
AWS_SECRET_ACCESS_KEY: z.string().optional(),

ENABLED_WENXIN: z.boolean(),
WENXIN_ACCESS_KEY: z.string().optional(),
WENXIN_SECRET_KEY: z.string().optional(),

Expand Down Expand Up @@ -158,6 +159,7 @@ export const getLLMConfig = () => {
AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,

ENABLED_WENXIN: !!process.env.WENXIN_ACCESS_KEY && !!process.env.WENXIN_SECRET_KEY,
WENXIN_ACCESS_KEY: process.env.WENXIN_ACCESS_KEY,
WENXIN_SECRET_KEY: process.env.WENXIN_SECRET_KEY,

Expand Down
2 changes: 2 additions & 0 deletions src/config/modelProviders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import QwenProvider from './qwen';
import StepfunProvider from './stepfun';
import TaichuProvider from './taichu';
import TogetherAIProvider from './togetherai';
import WenxinProvider from './wenxin';
import ZeroOneProvider from './zeroone';
import ZhiPuProvider from './zhipu';

Expand Down Expand Up @@ -60,6 +61,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
MinimaxProvider,
MistralProvider,
GroqProvider,
WenxinProvider,
MoonshotProvider,
ZeroOneProvider,
ZhiPuProvider,
Expand Down
2 changes: 2 additions & 0 deletions src/config/modelProviders/wenxin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ModelProviderCard } from '@/types/llm';
const BaiduWenxin: ModelProviderCard = {
chatModels: [
{
displayName: 'ERNIE-4.0-8K',
enabled: true,
id: 'ERNIE-4.0-8K',
tokens: 8192,
Expand Down Expand Up @@ -72,6 +73,7 @@ const BaiduWenxin: ModelProviderCard = {
},
],
checkModel: 'ERNIE-4.0-8K',
disableBrowserRequest: true,
id: 'wenxin',
name: 'Wenxin',
};
Expand Down
3 changes: 3 additions & 0 deletions src/server/globalConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const getServerGlobalConfig = () => {
ENABLED_ZEROONE,
ENABLED_TOGETHERAI,
TOGETHERAI_MODEL_LIST,

ENABLED_WENXIN,
} = getLLMConfig();

const config: GlobalServerConfig = {
Expand Down Expand Up @@ -121,6 +123,7 @@ export const getServerGlobalConfig = () => {
modelString: TOGETHERAI_MODEL_LIST,
}),
},
wenxin: { enabled: ENABLED_WENXIN },
zeroone: { enabled: ENABLED_ZEROONE },
zhipu: { enabled: ENABLED_ZHIPU },
},
Expand Down

0 comments on commit 4112e0b

Please sign in to comment.