mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
[chore] Fix type errors
This commit is contained in:
@ -152,7 +152,6 @@ async function sendClaudeRequest(request, response) {
|
||||
'x-api-key': apiKey,
|
||||
...additionalHeaders,
|
||||
},
|
||||
timeout: 0,
|
||||
});
|
||||
|
||||
if (request.body.stream) {
|
||||
@ -165,6 +164,7 @@ async function sendClaudeRequest(request, response) {
|
||||
return response.status(generateResponse.status).send({ error: true });
|
||||
}
|
||||
|
||||
/** @type {any} */
|
||||
const generateResponseJson = await generateResponse.json();
|
||||
const responseText = generateResponseJson?.content?.[0]?.text || '';
|
||||
console.log('Claude response:', generateResponseJson);
|
||||
@ -212,7 +212,6 @@ async function sendScaleRequest(request, response) {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Basic ${apiKey}`,
|
||||
},
|
||||
timeout: 0,
|
||||
});
|
||||
|
||||
if (!generateResponse.ok) {
|
||||
@ -220,6 +219,7 @@ async function sendScaleRequest(request, response) {
|
||||
return response.status(500).send({ error: true });
|
||||
}
|
||||
|
||||
/** @type {any} */
|
||||
const generateResponseJson = await generateResponse.json();
|
||||
console.log('Scale response:', generateResponseJson);
|
||||
|
||||
@ -335,7 +335,6 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
signal: controller.signal,
|
||||
timeout: 0,
|
||||
});
|
||||
// have to do this because of their busted ass streaming endpoint
|
||||
if (stream) {
|
||||
@ -354,6 +353,7 @@ async function sendMakerSuiteRequest(request, response) {
|
||||
return response.status(generateResponse.status).send({ error: true });
|
||||
}
|
||||
|
||||
/** @type {any} */
|
||||
const generateResponseJson = await generateResponse.json();
|
||||
|
||||
const candidates = generateResponseJson?.candidates;
|
||||
@ -676,6 +676,7 @@ router.post('/status', jsonParser, async function (request, response_getstatus_o
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
/** @type {any} */
|
||||
const data = await response.json();
|
||||
response_getstatus_openai.send(data);
|
||||
|
||||
@ -979,7 +980,6 @@ router.post('/generate', jsonParser, function (request, response) {
|
||||
},
|
||||
body: JSON.stringify(requestBody),
|
||||
signal: controller.signal,
|
||||
timeout: 0,
|
||||
};
|
||||
|
||||
console.log(requestBody);
|
||||
@ -1005,6 +1005,7 @@ router.post('/generate', jsonParser, function (request, response) {
|
||||
}
|
||||
|
||||
if (fetchResponse.ok) {
|
||||
/** @type {any} */
|
||||
let json = await fetchResponse.json();
|
||||
response.send(json);
|
||||
console.log(json);
|
||||
|
Reference in New Issue
Block a user