mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix: InformaticAI response without message in choices
This commit is contained in:
@@ -325,7 +325,7 @@ router.post('/generate', jsonParser, async function (request, response) {
|
|||||||
|
|
||||||
// Map InfermaticAI response to OAI completions format
|
// Map InfermaticAI response to OAI completions format
|
||||||
if (apiType === TEXTGEN_TYPES.INFERMATICAI) {
|
if (apiType === TEXTGEN_TYPES.INFERMATICAI) {
|
||||||
data['choices'] = (data?.choices || []).map(choice => ({ text: choice.message.content }));
|
data['choices'] = (data?.choices || []).map(choice => ({ text: choice?.message?.content || choice.text }));
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.send(data);
|
return response.send(data);
|
||||||
|
Reference in New Issue
Block a user