mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-23 15:37:50 +01:00
Merge pull request #2122 from joenunezb/fix-informaticai-missing-choices-message
Fix: Handle InformaticAI Endpoint response without message in response payload
This commit is contained in:
commit
d1f292f462
@ -325,7 +325,7 @@ router.post('/generate', jsonParser, async function (request, response) {
|
||||
|
||||
// Map InfermaticAI response to OAI completions format
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user