Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto
2024-04-12 12:18:38 +08:00
31 changed files with 1146 additions and 61 deletions

View File

@@ -3,7 +3,6 @@ import { showToast } from "./components/ui-lib";
import Locale from "./locales";
import { RequestMessage } from "./client/api";
import { DEFAULT_MODELS } from "./constant";
import { useAccessStore } from "./store";
export function trimTopic(topic: string) {
// Fix an issue where double quotes still show in the Indonesian language
@@ -292,10 +291,13 @@ export function getMessageImages(message: RequestMessage): string[] {
}
export function isVisionModel(model: string) {
// Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)
const visionKeywords = ["vision", "claude-3"];
const isGpt4Turbo =
model.includes("gpt-4-turbo") && !model.includes("preview");
return visionKeywords.some((keyword) => model.includes(keyword));
return (
visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo
);
}
export function isSupportRAGModel(modelName: string) {