change: apply max url query in settings

This commit is contained in:
2024-01-19 22:15:32 +08:00
parent e3162cac0d
commit 78f0b1000a

View File

@@ -14,6 +14,7 @@ import p from "preact-markdown";
import { isVailedJSON } from "./message"; import { isVailedJSON } from "./message";
import { SetAPIsTemplate } from "./setAPIsTemplate"; import { SetAPIsTemplate } from "./setAPIsTemplate";
import { autoHeight } from "./textarea"; import { autoHeight } from "./textarea";
import getDefaultParams from "./getDefaultParam";
const TTS_VOICES: string[] = [ const TTS_VOICES: string[] = [
"alloy", "alloy",
@@ -55,7 +56,7 @@ const SelectModel = (props: {
onChange={(event: any) => { onChange={(event: any) => {
const model = event.target.value as string; const model = event.target.value as string;
props.chatStore.model = model; props.chatStore.model = model;
props.chatStore.maxTokens = models[model].maxToken; props.chatStore.maxTokens = getDefaultParams('max', models[model].maxToken);
props.setChatStore({ ...props.chatStore }); props.setChatStore({ ...props.chatStore });
}} }}
> >
@@ -296,8 +297,7 @@ export default (props: {
location.pathname + location.pathname +
`?key=${encodeURIComponent( `?key=${encodeURIComponent(
props.chatStore.apiKey props.chatStore.apiKey
)}&api=${encodeURIComponent(props.chatStore.apiEndpoint)}&mode=${ )}&api=${encodeURIComponent(props.chatStore.apiEndpoint)}&mode=${props.chatStore.streamMode ? "stream" : "fetch"
props.chatStore.streamMode ? "stream" : "fetch"
}&model=${props.chatStore.model}&sys=${encodeURIComponent( }&model=${props.chatStore.model}&sys=${encodeURIComponent(
props.chatStore.systemMessageContent props.chatStore.systemMessageContent
)}`; )}`;