mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-09-11 12:00:52 +08:00
WIP, custom API Modes
This commit is contained in:
@@ -88,6 +88,10 @@ async function checkBilling(apiKey, apiUrl) {
|
||||
}
|
||||
}
|
||||
|
||||
function isUsingSpecialCustomModel(configOrSession) {
|
||||
return isUsingCustomModel(configOrSession) && !configOrSession.apiMode
|
||||
}
|
||||
|
||||
export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
const { t, i18n } = useTranslation()
|
||||
const [balance, setBalance] = useState(null)
|
||||
@@ -173,7 +177,7 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
style={
|
||||
isUsingOpenAiApiModel(config) ||
|
||||
isUsingMultiModeModel(config) ||
|
||||
isUsingCustomModel(config) ||
|
||||
isUsingSpecialCustomModel(config) ||
|
||||
isUsingAzureOpenAiApiModel(config) ||
|
||||
isUsingClaudeApiModel(config) ||
|
||||
isUsingMoonshotApiModel(config)
|
||||
@@ -255,7 +259,7 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
{isUsingCustomModel(config) && (
|
||||
{isUsingSpecialCustomModel(config) && (
|
||||
<input
|
||||
style="width: 50%;"
|
||||
type="text"
|
||||
@@ -328,7 +332,7 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{isUsingCustomModel(config) && (
|
||||
{isUsingSpecialCustomModel(config) && (
|
||||
<input
|
||||
type="text"
|
||||
value={config.customModelApiUrl}
|
||||
@@ -339,7 +343,7 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isUsingCustomModel(config) && (
|
||||
{isUsingSpecialCustomModel(config) && (
|
||||
<input
|
||||
type="password"
|
||||
value={config.customApiKey}
|
||||
@@ -424,17 +428,6 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isUsingAzureOpenAiApiModel(config) && (
|
||||
<input
|
||||
type="text"
|
||||
value={config.azureDeploymentName}
|
||||
placeholder={t('Azure Deployment Name')}
|
||||
onChange={(e) => {
|
||||
const deploymentName = e.target.value
|
||||
updateConfig({ azureDeploymentName: deploymentName })
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isUsingGithubThirdPartyApiModel(config) && (
|
||||
<input
|
||||
type="text"
|
||||
|
||||
Reference in New Issue
Block a user