Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Hk-Gosuto
2024-03-26 18:00:04 +08:00
7 changed files with 91 additions and 103 deletions

View File

@@ -59,10 +59,7 @@ export async function downloadAs(text: string, filename: string) {
if (result !== null) {
try {
await window.__TAURI__.fs.writeTextFile(
result,
text
);
await window.__TAURI__.fs.writeTextFile(result, text);
showToast(Locale.Download.Success);
} catch (error) {
showToast(Locale.Download.Failed);
@@ -294,9 +291,8 @@ export function getMessageImages(message: RequestMessage): string[] {
}
export function isVisionModel(model: string) {
return (
// model.startsWith("gpt-4-vision") ||
// model.startsWith("gemini-pro-vision") ||
model.includes("vision")
);
// 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"];
return visionKeywords.some((keyword) => model.includes(keyword));
}