fix: fix bugs when choosing azure api version.

This commit is contained in:
Duang Cheng 2023-04-19 20:04:38 +08:00
parent ffe4c91be9
commit 45e077cd18
2 changed files with 6 additions and 10 deletions

View File

@ -23,7 +23,6 @@ import {
useUpdateStore,
useAccessStore,
ModalConfigValidator,
AZURE_API_VERSION,
} from "../store";
import { Avatar } from "./chat";
@ -617,13 +616,11 @@ export function Settings(props: { closeSettings: () => void }) {
);
}}
>
{(accessStore.enableAOAI ? AZURE_API_VERSION : ALL_MODELS).map(
(v) => (
<option value={v.name} key={v.name} disabled={!v.available}>
{v.name}
</option>
),
)}
{ALL_MODELS.map((v) => (
<option value={v.name} key={v.name} disabled={!v.available}>
{v.name}
</option>
))}
</select>
</SettingItem>
<SettingItem

View File

@ -52,10 +52,9 @@ function getRequestPath() {
const OPENAI_REQUEST_PATH = "v1/chat/completions";
const { enableAOAI, azureDeployName } = useAccessStore.getState();
const { modelConfig } = useChatStore.getState().config;
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;
}