MCPcopy Index your code
hub / github.com/admineral/OpenAI-Assistant-API-Chat / uploadImageAndGetDescription

Function uploadImageAndGetDescription

app/services/api.js:4–17  ·  view source on GitHub ↗
(base64Image)

Source from the content-addressed store, hash-verified

2
3// Uploads a base64 encoded image and gets a description
4export const uploadImageAndGetDescription = async (base64Image) => {
5 console.log('Uploading image...');
6 const response = await fetch('/api/upload_gpt4v', {
7 method: 'POST',
8 headers: { 'Content-Type': 'application/json' },
9 body: JSON.stringify({ file: base64Image }),
10 });
11 if (!response.ok) {
12 console.error('Error processing image');
13 throw new Error('Error processing image');
14 }
15 console.log('Image uploaded successfully');
16 return await response.json();
17 };
18
19 // Uploads a file
20 export const uploadFile = async (file) => {

Callers 1

prepareUploadFileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected