mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-16 12:46:34 +01:00
* fix: Simplify avatar type definition in agent and assistant schemas * fix: Update regex to correctly match OpenAI model identifiers
52 lines
1 KiB
TypeScript
52 lines
1 KiB
TypeScript
import { Schema, Document, Types } from 'mongoose';
|
|
|
|
export interface IAssistant extends Document {
|
|
user: Types.ObjectId;
|
|
assistant_id: string;
|
|
avatar?: {
|
|
filepath: string;
|
|
source: string;
|
|
};
|
|
conversation_starters?: string[];
|
|
access_level?: number;
|
|
file_ids?: string[];
|
|
actions?: string[];
|
|
append_current_datetime?: boolean;
|
|
}
|
|
|
|
const assistantSchema = new Schema<IAssistant>(
|
|
{
|
|
user: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'User',
|
|
required: true,
|
|
},
|
|
assistant_id: {
|
|
type: String,
|
|
index: true,
|
|
required: true,
|
|
},
|
|
avatar: {
|
|
type: Schema.Types.Mixed,
|
|
default: undefined,
|
|
},
|
|
conversation_starters: {
|
|
type: [String],
|
|
default: [],
|
|
},
|
|
access_level: {
|
|
type: Number,
|
|
},
|
|
file_ids: { type: [String], default: undefined },
|
|
actions: { type: [String], default: undefined },
|
|
append_current_datetime: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
timestamps: true,
|
|
},
|
|
);
|
|
|
|
export default assistantSchema;
|