Support more parameters for Infermatic

This commit is contained in:
Cohee
2024-06-24 19:16:20 +03:00
parent b188c176fd
commit 41ab90bb8e
5 changed files with 23 additions and 9 deletions

View File

@@ -340,7 +340,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 || choice.text }));
data['choices'] = (data?.choices || []).map(choice => ({ text: choice?.message?.content || choice.text, logprobs: choice?.logprobs, index: choice?.index }));
}
return response.send(data);