Merge pull request #3482 from janhq/fix/missing-engine-chat-completion-api

fix: add engine in payload for nitro chat completion api
This commit is contained in:
Van Pham 2024-08-28 12:56:30 +07:00 committed by GitHub
commit 2fd0f20638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -341,6 +341,11 @@ export const chatCompletions = async (request: any, reply: any) => {
request.body.stop = request.body.stop.slice(0, 4)
}
// add engine for new cortex cpp engine
if (requestedModel.engine === 'nitro') {
request.body.engine = 'cortex.llamacpp'
}
const fetch = require('node-fetch')
const response = await fetch(apiUrl, {
method: 'POST',

View File

@ -6,9 +6,7 @@ import {
Model,
ModelExtension,
OptionType,
baseName,
fs,
joinPath,
} from '@janhq/core'
import { atom, useSetAtom } from 'jotai'