Skip to content

Commit

Permalink
docs: update translation and api url tip
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Oct 24, 2024
1 parent 6e2ab66 commit 596cf8e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
"provider.search_placeholder": "Search model id or name",
"provider.api.url.reset": "Reset",
"provider.api.url.preview": "Preview: {{url}}",
"provider.api.url.tip": "Add / at the end to force using the input address",
"provider.api.url.tip": "Ending with / ignores v1, ending with # forces use of input address",
"models.default_assistant_model": "Default Assistant Model",
"models.topic_naming_model": "Topic Naming Model",
"models.translate_model": "Translate Model",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
"provider.search_placeholder": "搜索模型 ID 或名称",
"provider.api.url.reset": "重置",
"provider.api.url.preview": "预览: {{url}}",
"provider.api.url.tip": "结尾添加 / 强制使用输入地址",
"provider.api.url.tip": "/结尾忽略v1版本,#结尾强制使用输入地址",
"models.default_assistant_model": "默认助手模型",
"models.topic_naming_model": "话题命名模型",
"models.translate_model": "翻译模型",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
"provider.search_placeholder": "搜尋模型 ID 或名稱",
"provider.api.url.reset": "重置",
"provider.api.url.preview": "預覽: {{url}}",
"provider.api.url.tip": "結尾新增 / 強制使用輸入地址",
"provider.api.url.tip": "/結尾忽略v1版本,#結尾強制使用輸入位址",
"models.default_assistant_model": "預設助手模型",
"models.topic_naming_model": "話題命名模型",
"models.translate_model": "翻譯模型",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
updateProvider({ ...provider, apiHost: configedApiHost })
}

const hostPreview = (apiHost.endsWith('/') ? apiHost : `${apiHost}/v1/`) + 'chat/completions'
const hostPreview = () => {
if (apiHost.endsWith('#')) {
return apiHost.replace('#', '')
}

return (apiHost.endsWith('/') ? apiHost : `${apiHost}/v1/`) + 'chat/completions'
}

return (
<SettingContainer
Expand Down Expand Up @@ -143,7 +149,7 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
</Space.Compact>
{isOpenAIProvider(provider) && (
<SettingHelpTextRow style={{ justifyContent: 'space-between' }}>
<SettingHelpText style={{ marginLeft: 6 }}>{hostPreview}</SettingHelpText>
<SettingHelpText style={{ marginLeft: 6 }}>{hostPreview()}</SettingHelpText>
<SettingHelpText>{t('settings.provider.api.url.tip')}</SettingHelpText>
</SettingHelpTextRow>
)}
Expand Down

0 comments on commit 596cf8e

Please sign in to comment.