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:
commit
2fd0f20638
@ -341,6 +341,11 @@ export const chatCompletions = async (request: any, reply: any) => {
|
|||||||
request.body.stop = request.body.stop.slice(0, 4)
|
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 fetch = require('node-fetch')
|
||||||
const response = await fetch(apiUrl, {
|
const response = await fetch(apiUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@ -6,9 +6,7 @@ import {
|
|||||||
Model,
|
Model,
|
||||||
ModelExtension,
|
ModelExtension,
|
||||||
OptionType,
|
OptionType,
|
||||||
baseName,
|
|
||||||
fs,
|
fs,
|
||||||
joinPath,
|
|
||||||
} from '@janhq/core'
|
} from '@janhq/core'
|
||||||
|
|
||||||
import { atom, useSetAtom } from 'jotai'
|
import { atom, useSetAtom } from 'jotai'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user