mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove a trailing slash from the API URL in case it gets added in by URL.toString
This commit is contained in:
@ -337,7 +337,7 @@ async function sendMakerSuiteRequest(request, response) {
|
|||||||
? (stream ? 'streamGenerateContent' : 'generateContent')
|
? (stream ? 'streamGenerateContent' : 'generateContent')
|
||||||
: (isText ? 'generateText' : 'generateMessage');
|
: (isText ? 'generateText' : 'generateMessage');
|
||||||
|
|
||||||
const generateResponse = await fetch(`${apiUrl}/${apiVersion}/models/${model}:${responseType}?key=${apiKey}${stream ? '&alt=sse' : ''}`, {
|
const generateResponse = await fetch(`${apiUrl.toString().replace(/\/$/, '')}/${apiVersion}/models/${model}:${responseType}?key=${apiKey}${stream ? '&alt=sse' : ''}`, {
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
Reference in New Issue
Block a user