Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed May 10, 2024
1 parent db65623 commit 33a8a5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ async function uploadImageAndGetUrl(imageFile) {
file: fileUrl, // Existing image handling for OpenAI
initialize: isFirstMessage
};
endpoint = 'http://localhost:3000/assistant'; // OpenAI endpoint
endpoint = `${baseURL}/assistant`; // OpenAI endpoint
} else {
if (currentModelID.startsWith('gemini')) {
// Prepare the payload for Google Gemini API
Expand Down
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ async function AssistantAndThread(modelID, systemMessage) {
assistant = await openai.beta.assistants.create({
name: "Assistant",
instructions: systemMessage,
tools: [{type: "retrieval"}, {type: "code_interpreter"}],
tools: [{type: "file_search"}, {type: "code_interpreter"}],
model: modelID
});
console.log("Creating new Assistant:", assistant)
Expand Down Expand Up @@ -1335,6 +1335,10 @@ app.get('/config', (req, res) => {
}
});

app.use(cors({
origin: '*'
}));


const isVercelEnvironment = process.env.VERCEL === '1' || process.env.NODE_ENV === 'production';
const PORT = isVercelEnvironment ? process.env.PORT : process.env.PORT_SERVER || 3000;
Expand Down

0 comments on commit 33a8a5c

Please sign in to comment.