mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-07-16 11:41:25 +08:00
feat: add openai configuration to web ui
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user