From 4de9176f1a208158f91c3196b11759d163aa3494 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 5 Mar 2024 20:08:40 +0200 Subject: [PATCH] Fix captioning URL: base + '/messages' --- src/endpoints/anthropic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/endpoints/anthropic.js b/src/endpoints/anthropic.js index 67ce3076c..7116988a1 100644 --- a/src/endpoints/anthropic.js +++ b/src/endpoints/anthropic.js @@ -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: [