feat: 添加自定义 temperature 和 top_p (#1260)
* 在设置的高级面板里自定义temperature和top_p * change default temperature from 0.8 to 0.5 * pref: 检查代码,增加仅 api 的接口判断 * chore: 锁定 pnpm-lock.yaml --------- Co-authored-by: ChenZhaoYu <790348264@qq.com>
This commit is contained in:
@@ -23,7 +23,7 @@ router.post('/chat-process', [auth, limiter], async (req, res) => {
|
||||
res.setHeader('Content-type', 'application/octet-stream')
|
||||
|
||||
try {
|
||||
const { prompt, options = {}, systemMessage } = req.body as RequestProps
|
||||
const { prompt, options = {}, systemMessage, temperature, top_p } = req.body as RequestProps
|
||||
let firstChunk = true
|
||||
await chatReplyProcess({
|
||||
message: prompt,
|
||||
@@ -33,6 +33,8 @@ router.post('/chat-process', [auth, limiter], async (req, res) => {
|
||||
firstChunk = false
|
||||
},
|
||||
systemMessage,
|
||||
temperature,
|
||||
top_p,
|
||||
})
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user