feat: custom title and set history top

This commit is contained in:
archer
2023-05-29 22:24:49 +08:00
parent 7fe39c2515
commit 2fce76202a
11 changed files with 210 additions and 161 deletions

View File

@@ -32,13 +32,16 @@ const ChatSchema = new Schema({
default: '历史记录'
},
customTitle: {
type: Boolean,
default: false
type: String,
default: ''
},
latestChat: {
type: String,
default: ''
},
top: {
type: Boolean
},
content: {
type: [
{

View File

@@ -6,13 +6,14 @@ export const connectPg = async () => {
return global.pgClient;
}
const maxLink = Number(process.env.VECTOR_MAX_PROCESS || 10);
global.pgClient = new Pool({
host: process.env.PG_HOST,
port: process.env.PG_PORT ? +process.env.PG_PORT : 5432,
user: process.env.PG_USER,
password: process.env.PG_PASSWORD,
database: process.env.PG_DB_NAME,
max: 20,
max: maxLink,
idleTimeoutMillis: 60000,
connectionTimeoutMillis: 20000
});