feat: session 返回接口方式做显示判断

This commit is contained in:
ChenZhaoYu
2023-03-17 09:36:12 +08:00
parent c5552893d7
commit 95724845cf
3 changed files with 27 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import express from 'express'
import type { ChatContext, ChatMessage } from './chatgpt'
import { chatConfig, chatReplyProcess } from './chatgpt'
import { chatConfig, chatReplyProcess, currentModel } from './chatgpt'
import { auth } from './middleware/auth'
import { isNotEmptyString } from './utils/is'
@@ -50,7 +50,7 @@ router.post('/session', async (req, res) => {
try {
const AUTH_SECRET_KEY = process.env.AUTH_SECRET_KEY
const hasAuth = isNotEmptyString(AUTH_SECRET_KEY)
res.send({ status: 'Success', message: '', data: { auth: hasAuth } })
res.send({ status: 'Success', message: '', data: { auth: hasAuth, model: currentModel() } })
}
catch (error) {
res.send({ status: 'Fail', message: error.message, data: null })