mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2026-04-29 14:34:26 +08:00
Compare commits
9 Commits
f12058463b
...
24261d20b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24261d20b3 | ||
|
|
1b5a81c7ad | ||
|
|
70f066c15f | ||
|
|
bfa433919f | ||
|
|
afb0752d5d | ||
|
|
819d249a09 | ||
|
|
8d66fedb1f | ||
|
|
7cf89b53ce | ||
|
|
1d14a991ee |
@@ -2071,6 +2071,6 @@ function _Chat() {
|
||||
|
||||
export function Chat() {
|
||||
const chatStore = useChatStore();
|
||||
const sessionIndex = chatStore.currentSessionIndex;
|
||||
return <_Chat key={sessionIndex}></_Chat>;
|
||||
const session = chatStore.currentSession();
|
||||
return <_Chat key={session.id}></_Chat>;
|
||||
}
|
||||
|
||||
@@ -978,9 +978,14 @@ export function Settings() {
|
||||
value={accessStore.awsRegion}
|
||||
placeholder="us-west-2"
|
||||
onChange={(e) =>
|
||||
accessStore.update(
|
||||
(access) => (access.awsRegion = e.currentTarget.value),
|
||||
)
|
||||
accessStore.update((access) => {
|
||||
const region = e.currentTarget.value;
|
||||
if (!/^[a-z]{2}-[a-z]+-\d+$/.test(region)) {
|
||||
showToast(Locale.Settings.Access.Bedrock.Region.Invalid);
|
||||
return;
|
||||
}
|
||||
access.awsRegion = region;
|
||||
})
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
@@ -994,9 +999,14 @@ export function Settings() {
|
||||
type="text"
|
||||
placeholder={Locale.Settings.Access.Bedrock.AccessKey.Placeholder}
|
||||
onChange={(e) => {
|
||||
accessStore.update(
|
||||
(access) => (access.awsAccessKey = e.currentTarget.value),
|
||||
);
|
||||
accessStore.update((access) => {
|
||||
const accessKey = e.currentTarget.value;
|
||||
if (accessKey && accessKey.length !== 20) {
|
||||
showToast(Locale.Settings.Access.Bedrock.AccessKey.Invalid);
|
||||
return;
|
||||
}
|
||||
access.awsAccessKey = accessKey;
|
||||
});
|
||||
}}
|
||||
maskWhenShow={true}
|
||||
/>
|
||||
@@ -1011,9 +1021,14 @@ export function Settings() {
|
||||
type="text"
|
||||
placeholder={Locale.Settings.Access.Bedrock.SecretKey.Placeholder}
|
||||
onChange={(e) => {
|
||||
accessStore.update(
|
||||
(access) => (access.awsSecretKey = e.currentTarget.value),
|
||||
);
|
||||
accessStore.update((access) => {
|
||||
const secretKey = e.currentTarget.value;
|
||||
if (secretKey && secretKey.length !== 40) {
|
||||
showToast(Locale.Settings.Access.Bedrock.SecretKey.Invalid);
|
||||
return;
|
||||
}
|
||||
access.awsSecretKey = secretKey;
|
||||
});
|
||||
}}
|
||||
maskWhenShow={true}
|
||||
/>
|
||||
|
||||
@@ -242,6 +242,8 @@ export const ChatGLM = {
|
||||
|
||||
export const Bedrock = {
|
||||
ChatPath: "converse",
|
||||
ApiVersion: "2023-11-01",
|
||||
getEndpoint: (region: string = "us-west-2") =>`https://bedrock-runtime.${region}.amazonaws.com`,
|
||||
};
|
||||
|
||||
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
|
||||
|
||||
@@ -257,11 +257,11 @@ export function isVisionModel(model: string) {
|
||||
const excludeKeywords = ["claude-3-5-haiku-20241022"];
|
||||
const visionKeywords = [
|
||||
"vision",
|
||||
"claude-3",
|
||||
"gemini-1.5-pro",
|
||||
"gemini-1.5-flash",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"claude-3",
|
||||
"gemini-1.5",
|
||||
"qwen-vl",
|
||||
"qwen2-vl",
|
||||
];
|
||||
const isGpt4Turbo =
|
||||
model.includes("gpt-4-turbo") && !model.includes("preview");
|
||||
|
||||
Reference in New Issue
Block a user