From a8b123f0da3d68a14e5459bcb35ce23e92f2cab0 Mon Sep 17 00:00:00 2001 From: Arjun Date: Fri, 6 Dec 2024 23:43:59 +0800 Subject: [PATCH] wip: remove api analysis image --- src/api/index.ts | 24 ------------------------ src/pages/preview/App.vue | 15 --------------- 2 files changed, 39 deletions(-) delete mode 100644 src/api/index.ts diff --git a/src/api/index.ts b/src/api/index.ts deleted file mode 100644 index 1e4192b..0000000 --- a/src/api/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -export async function getChatCompletion(imageUrl: string) { - return fetch('https://api.red-pill.ai/v1/chat/completions', { - method: 'POST', - headers: { - 'Authorization': `Bearer sk-vzMB14YeVyRvIOVl1Gki2LVfYzJI6y1U6D0lPyJkdOQlDVNW`, - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - model: 'gpt-4o', - messages: [ - { - role: 'user', - content: 'What is the meaning of life?', - }, - { - type: 'image_url', - image_url: { - url: `${imageUrl}`, - }, - }, - ], - }), - }) -} diff --git a/src/pages/preview/App.vue b/src/pages/preview/App.vue index a38292c..3bfc696 100644 --- a/src/pages/preview/App.vue +++ b/src/pages/preview/App.vue @@ -11,7 +11,6 @@ import Button from '~/components/Button.vue' import PictureReview from './PictureReview.vue' // Import Pintura styles import '@pqina/pintura/pintura.css' -import { getChatCompletion } from '~/api' const store = new LazyStore('settings.json') @@ -53,17 +52,6 @@ function onSave() { appWindow.close() } -async function getImageAnalysis() { - // get image base64 - const imageBase64 = await invoke('get_image_base64', { - path: imagePath.value, - }) - console.log("imageBase64", imageBase64) - const imageUrl = `data:image/jpeg;base64,${imageBase64}` - const response = await getChatCompletion(imageUrl) - console.log('response', response) -} - onMounted(async () => { const val = await store.get<{ value: string }>('screenshot_path') appWindow.listen('image-prepared', (event: any) => { @@ -96,9 +84,6 @@ onMounted(async () => { -