mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
feat(openai): support azure api type #475
This commit is contained in:
parent
835349c33f
commit
ad97f973ab
23 changed files with 4726 additions and 3837 deletions
|
@ -72,6 +72,7 @@ export interface OpenaiSettings {
|
|||
base_url: string
|
||||
proxy: string
|
||||
token: string
|
||||
api_type: string
|
||||
}
|
||||
|
||||
export interface TerminalSettings {
|
||||
|
|
|
@ -1 +1 @@
|
|||
ar en zh_CN zh_TW fr_FR es ru_RU vi_VN ko_KR tr_TR
|
||||
en zh_CN zh_TW fr_FR es ru_RU vi_VN ko_KR tr_TR ar
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -30,7 +30,7 @@ const errors: Record<string, Record<string, string>> = inject('errors') as Recor
|
|||
:label="$gettext('Node name')"
|
||||
:validate-status="errors?.node?.name ? 'error' : ''"
|
||||
:help="errors?.node?.name.includes('safety_text')
|
||||
? $gettext('The node name should only contain letters, unicode, numbers, hyphens, dashes, and dots.')
|
||||
? $gettext('The node name should only contain letters, unicode, numbers, hyphens, dashes, colons, and dots.')
|
||||
: $gettext('Customize the name of local node to be displayed in the environment indicator.')"
|
||||
>
|
||||
<AInput v-model:value="data.node.name" />
|
||||
|
@ -51,7 +51,7 @@ const errors: Record<string, Record<string, string>> = inject('errors') as Recor
|
|||
:label="$gettext('ICP Number')"
|
||||
:validate-status="errors?.node?.icp_number ? 'error' : ''"
|
||||
:help="errors?.node?.icp_number.includes('safety_text')
|
||||
? $gettext('The ICP Number should only contain letters, unicode, numbers, hyphens, dashes, and dots.')
|
||||
? $gettext('The ICP Number should only contain letters, unicode, numbers, hyphens, dashes, colons, and dots.')
|
||||
: ''"
|
||||
>
|
||||
<AInput
|
||||
|
@ -63,7 +63,7 @@ const errors: Record<string, Record<string, string>> = inject('errors') as Recor
|
|||
:label="$gettext('Public Security Number')"
|
||||
:validate-status="errors?.node?.public_security_number ? 'error' : ''"
|
||||
:help="errors?.node?.public_security_number.includes('safety_text')
|
||||
? $gettext('The Public Security Number should only contain letters, unicode, numbers, hyphens, dashes, and dots.')
|
||||
? $gettext('The Public Security Number should only contain letters, unicode, numbers, hyphens, dashes, colons, and dots.')
|
||||
: ''"
|
||||
>
|
||||
<AInput
|
||||
|
|
|
@ -32,7 +32,7 @@ const models = shallowRef([
|
|||
:label="$gettext('Model')"
|
||||
:validate-status="errors?.openai?.model ? 'error' : ''"
|
||||
:help="errors?.openai?.model === 'safety_text'
|
||||
? $gettext('The model name should only contain letters, unicode, numbers, hyphens, dashes, and dots.')
|
||||
? $gettext('The model name should only contain letters, unicode, numbers, hyphens, dashes, colons, and dots.')
|
||||
: ''"
|
||||
>
|
||||
<AAutoComplete
|
||||
|
@ -45,7 +45,7 @@ const models = shallowRef([
|
|||
:validate-status="errors?.openai?.base_url ? 'error' : ''"
|
||||
:help="errors?.openai?.base_url === 'url'
|
||||
? $gettext('The url is invalid.')
|
||||
: $gettext('To use a local large model, deploy it with vllm or imdeploy. '
|
||||
: $gettext('To use a local large model, deploy it with ollama, vllm or imdeploy. '
|
||||
+ 'They provide an OpenAI-compatible API endpoint, so just set the baseUrl to your local API.')"
|
||||
>
|
||||
<AInput
|
||||
|
@ -74,6 +74,19 @@ const models = shallowRef([
|
|||
>
|
||||
<AInputPassword v-model:value="data.openai.token" />
|
||||
</AFormItem>
|
||||
<AFormItem
|
||||
:label="$gettext('API Type')"
|
||||
:validate-status="errors?.openai?.apt_type ? 'error' : ''"
|
||||
>
|
||||
<ASelect v-model:value="data.openai.api_type">
|
||||
<ASelectOption value="OPEN_AI">
|
||||
OpenAI
|
||||
</ASelectOption>
|
||||
<ASelectOption value="AZURE">
|
||||
Azure
|
||||
</ASelectOption>
|
||||
</ASelect>
|
||||
</AFormItem>
|
||||
</AForm>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ const data = ref<Settings>({
|
|||
base_url: '',
|
||||
proxy: '',
|
||||
token: '',
|
||||
api_type: 'OPEN_AI',
|
||||
},
|
||||
terminal: {
|
||||
start_cmd: '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue