mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-10 03:56:37 +08:00
fix: fix bugs when choosing azure api version.
This commit is contained in:
parent
ffe4c91be9
commit
45e077cd18
@ -23,7 +23,6 @@ import {
|
|||||||
useUpdateStore,
|
useUpdateStore,
|
||||||
useAccessStore,
|
useAccessStore,
|
||||||
ModalConfigValidator,
|
ModalConfigValidator,
|
||||||
AZURE_API_VERSION,
|
|
||||||
} from "../store";
|
} from "../store";
|
||||||
import { Avatar } from "./chat";
|
import { Avatar } from "./chat";
|
||||||
|
|
||||||
@ -617,13 +616,11 @@ export function Settings(props: { closeSettings: () => void }) {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(accessStore.enableAOAI ? AZURE_API_VERSION : ALL_MODELS).map(
|
{ALL_MODELS.map((v) => (
|
||||||
(v) => (
|
|
||||||
<option value={v.name} key={v.name} disabled={!v.available}>
|
<option value={v.name} key={v.name} disabled={!v.available}>
|
||||||
{v.name}
|
{v.name}
|
||||||
</option>
|
</option>
|
||||||
),
|
))}
|
||||||
)}
|
|
||||||
</select>
|
</select>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
|
@ -52,10 +52,9 @@ function getRequestPath() {
|
|||||||
const OPENAI_REQUEST_PATH = "v1/chat/completions";
|
const OPENAI_REQUEST_PATH = "v1/chat/completions";
|
||||||
|
|
||||||
const { enableAOAI, azureDeployName } = useAccessStore.getState();
|
const { enableAOAI, azureDeployName } = useAccessStore.getState();
|
||||||
const { modelConfig } = useChatStore.getState().config;
|
|
||||||
if (!enableAOAI) return OPENAI_REQUEST_PATH;
|
if (!enableAOAI) return OPENAI_REQUEST_PATH;
|
||||||
|
|
||||||
const AZURE_REQUEST_PATH = `openai/deployments/${azureDeployName}/chat/completions?api-version=${modelConfig.model}`;
|
const AZURE_REQUEST_PATH = `openai/deployments/${azureDeployName}/chat/completions?api-version=2023-03-15-preview`;
|
||||||
return AZURE_REQUEST_PATH;
|
return AZURE_REQUEST_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user