Skip to content

Commit

Permalink
💄 style: Support Google Model List (lobehub#3938)
Browse files Browse the repository at this point in the history
* add sessionToken for bedrock model

* Support google model list

* update relate sessionToken info

* update description and revert gg model list

* update description

* change session token is a custom field

* support google model list
  • Loading branch information
khanhduyvt0101 authored Sep 13, 2024
1 parent 61bfeb2 commit be4efc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/config/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const getLLMConfig = () => {
ENABLED_GOOGLE: z.boolean(),
GOOGLE_API_KEY: z.string().optional(),
GOOGLE_PROXY_URL: z.string().optional(),
GOOGLE_MODEL_LIST: z.string().optional(),

ENABLED_MOONSHOT: z.boolean(),
MOONSHOT_API_KEY: z.string().optional(),
Expand Down Expand Up @@ -134,6 +135,7 @@ export const getLLMConfig = () => {
ENABLED_GOOGLE: !!process.env.GOOGLE_API_KEY,
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY,
GOOGLE_PROXY_URL: process.env.GOOGLE_PROXY_URL,
GOOGLE_MODEL_LIST: process.env.GOOGLE_MODEL_LIST,

ENABLED_PERPLEXITY: !!process.env.PERPLEXITY_API_KEY,
PERPLEXITY_API_KEY: process.env.PERPLEXITY_API_KEY,
Expand Down
11 changes: 10 additions & 1 deletion src/server/globalConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getLLMConfig } from '@/config/llm';
import {
BedrockProviderCard,
FireworksAIProviderCard,
GoogleProviderCard,
GroqProviderCard,
NovitaProviderCard,
OllamaProviderCard,
Expand Down Expand Up @@ -39,6 +40,7 @@ export const getServerGlobalConfig = () => {
AWS_BEDROCK_MODEL_LIST,

ENABLED_GOOGLE,
GOOGLE_MODEL_LIST,

ENABLED_GROQ,
GROQ_MODEL_LIST,
Expand Down Expand Up @@ -128,7 +130,14 @@ export const getServerGlobalConfig = () => {
}),
},

google: { enabled: ENABLED_GOOGLE },
google: {
enabled: ENABLED_GOOGLE,
enabledModels: extractEnabledModels(GOOGLE_MODEL_LIST),
serverModelCards: transformToChatModelCards({
defaultChatModels: GoogleProviderCard.chatModels,
modelString: GOOGLE_MODEL_LIST,
}),
},
groq: {
enabled: ENABLED_GROQ,
enabledModels: extractEnabledModels(GROQ_MODEL_LIST),
Expand Down

0 comments on commit be4efc7

Please sign in to comment.