Fix captioning URL: base + '/messages'

This commit is contained in:
Cohee 2024-03-05 20:08:40 +02:00
parent 3e1d44fc29
commit 4de9176f1a
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ router.post('/caption-image', jsonParser, async (request, response) => {
try {
const mimeType = request.body.image.split(';')[0].split(':')[1];
const base64Data = request.body.image.split(',')[1];
const url = request.body.reverse_proxy ? request.body.reverse_proxy : 'https://api.anthropic.com/v1/messages';
const baseUrl = request.body.reverse_proxy ? request.body.reverse_proxy : 'https://api.anthropic.com/v1';
const url = `${baseUrl}/messages`;
const body = {
model: request.body.model,
messages: [