mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* doc * feat: file upload config * perf: chat box file params * feat: markdown show file * feat: chat file store and clear * perf: read file contentType * feat: llm vision config * feat: file url output * perf: plugin error text * perf: image load * feat: ai chat document * perf: file block ui * feat: read file node * feat: file read response field * feat: simple mode support read files * feat: tool call * feat: read file histories * perf: select file * perf: select file config * i18n * i18n * fix: ts; feat: tool response preview result
35 lines
749 B
TypeScript
35 lines
749 B
TypeScript
import { connectionMongo, getMongoModel } from '../../mongo';
|
|
const { Schema } = connectionMongo;
|
|
import { RawTextBufferSchemaType } from './type';
|
|
|
|
export const collectionName = 'buffer_rawtexts';
|
|
|
|
const RawTextBufferSchema = new Schema({
|
|
sourceId: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
rawText: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
createTime: {
|
|
type: Date,
|
|
default: () => new Date()
|
|
},
|
|
metadata: Object
|
|
});
|
|
|
|
try {
|
|
RawTextBufferSchema.index({ sourceId: 1 });
|
|
// 20 minutes
|
|
RawTextBufferSchema.index({ createTime: 1 }, { expireAfterSeconds: 20 * 60 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoRawTextBuffer = getMongoModel<RawTextBufferSchemaType>(
|
|
collectionName,
|
|
RawTextBufferSchema
|
|
);
|