mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-03 05:46:54 +08:00
feat: 1) Present 'maxtokens' as properties tied to a single model. 2) Remove the original author's implementation of the send verification logic and replace it with a user input validator. Pre-verification 3) Provides the ability to pull the 'User Visible modellist' provided by 'provider' 4) Provider-related parameters are passed in the constructor of 'providerClient'. Not passed in the 'chat' method
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import Locale from "./locale";
|
||||
|
||||
import { SettingItem } from "../../core/types";
|
||||
import { SettingItem } from "../../common";
|
||||
import { modelConfigs as openaiModelConfigs } from "../openai/config";
|
||||
|
||||
export const AzureMetas = {
|
||||
ExampleEndpoint: "https://{resource-url}/openai/deployments/{deploy-id}",
|
||||
ChatPath: "v1/chat/completions",
|
||||
OpenAI: "/api/openai",
|
||||
};
|
||||
|
||||
export type SettingKeys = "azureUrl" | "azureApiKey" | "azureApiVersion";
|
||||
@@ -20,6 +19,21 @@ export const settingItems: SettingItem<SettingKeys>[] = [
|
||||
description: Locale.Endpoint.SubTitle + AzureMetas.ExampleEndpoint,
|
||||
placeholder: AzureMetas.ExampleEndpoint,
|
||||
type: "input",
|
||||
validators: [
|
||||
async (v: any) => {
|
||||
if (typeof v === "string") {
|
||||
try {
|
||||
new URL(v);
|
||||
} catch (e) {
|
||||
return Locale.Endpoint.Error.IllegalURL;
|
||||
}
|
||||
}
|
||||
if (typeof v === "string" && v.endsWith("/")) {
|
||||
return Locale.Endpoint.Error.EndWithBackslash;
|
||||
}
|
||||
},
|
||||
"required",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "azureApiKey",
|
||||
|
Reference in New Issue
Block a user