diff --git a/backend/src/module/models/config.py b/backend/src/module/models/config.py index 3358124b..51de420a 100644 --- a/backend/src/module/models/config.py +++ b/backend/src/module/models/config.py @@ -84,8 +84,8 @@ class Notification(BaseModel): class Experimental(BaseModel): openai_enable: bool = Field(False, description="Enable experimental OpenAI") openai_api_key: str = Field("", description="OpenAI api key") - openai_api_base: str = Field("", description="OpenAI api base url") - openai_model: str = Field("", description="OpenAI model") + openai_api_base: str = Field("https://api.openai.com/v1", description="OpenAI api base url") + openai_model: str = Field("gpt-3.5-turbo", description="OpenAI model") class Config(BaseModel): @@ -96,7 +96,7 @@ class Config(BaseModel): log: Log = Log() proxy: Proxy = Proxy() notification: Notification = Notification() - Experimental: Experimental = Experimental() + experimental: Experimental = Experimental() def dict(self, *args, by_alias=True, **kwargs): return super().dict(*args, by_alias=by_alias, **kwargs) diff --git a/backend/src/module/parser/openai.py b/backend/src/module/parser/openai.py index 4f184517..2ac051ca 100644 --- a/backend/src/module/parser/openai.py +++ b/backend/src/module/parser/openai.py @@ -58,10 +58,12 @@ class OpenAIParser: the OpenAI api base url, you can use custom url here. \ Defaults to "https://api.openai.com/v1". model (str): - the ChatGPT model parameter, you can get more details from https://platform.openai.com/docs/api-reference/chat/create. \ + the ChatGPT model parameter, you can get more details from \ + https://platform.openai.com/docs/api-reference/chat/create. \ Defaults to "gpt-3.5-turbo". kwargs (dict): - the OpenAI ChatGPT parameters, you can get more details from https://platform.openai.com/docs/api-reference/chat/create. + the OpenAI ChatGPT parameters, you can get more details from \ + https://platform.openai.com/docs/api-reference/chat/create. Raises: ValueError: if api_key is not provided. diff --git a/webui/types/config.ts b/webui/types/config.ts index 00e40f1d..180fff0b 100644 --- a/webui/types/config.ts +++ b/webui/types/config.ts @@ -105,7 +105,7 @@ export const initConfig: Config = { experimental: { openai_enable: false, openai_api_key: '', - openai_api_base: '', + openai_api_base: 'https://api.openai.com/v1/', openai_model: 'gpt-3.5-turbo', }, };