Skip to content

Commit

Permalink
cleanup and reduce image size sent to AI
Browse files Browse the repository at this point in the history
  • Loading branch information
iansinnott committed Oct 30, 2024
1 parent 299555a commit 669540f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"type": "module",
"dependencies": {
"@fastify/cors": "8.4.2",
"@microsoft/fetch-event-source": "2.0.1",
"@radix-ui/react-progress": "1.0.3",
"@tauri-apps/api": "^2.0.3",
"@tauri-apps/plugin-dialog": "^2.0.1",
Expand Down
3 changes: 0 additions & 3 deletions src/lib/stores/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
LLMProvider,
} from "$lib/db";
import { nanoid } from "nanoid";
import { fetchEventSource, type EventSourceMessage } from "@microsoft/fetch-event-source";
import { getSystem } from "$lib/gui";
import { dev } from "$app/environment";
import { emit } from "$lib/capture";
Expand All @@ -23,8 +22,6 @@ import { createSyncer, getDefaultEndpoint, type Syncer } from "$lib/sync/vlcn";
import { PENDING_THREAD_TITLE, hasThreadTitle, persistentStore } from "../storeUtils";
import { chatModels, llmProviders, openAiConfig } from "./llmProvider";
import { activeProfileName, getOpenAi, gptProfileStore } from "./llmProfile";
import { base64FromFile } from "$lib/utils";
import { processImageForAI } from "$lib/utils";

export const showSettings = writable(false);
export const showInitScreen = writable(false);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ export async function processImageForAI(file: File): Promise<{ base64: string; f
});

// Target width for AI processing (adjust as needed)
const MAX_WIDTH = 1024;
const MAX_HEIGHT = 1024;
const MAX_WIDTH = 512;
const MAX_HEIGHT = 512;

let width = img.width;
let height = img.height;
Expand Down

0 comments on commit 669540f

Please sign in to comment.