mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-22 18:34:08 +01:00
10 lines
330 B
TypeScript
10 lines
330 B
TypeScript
|
|
import agentSchema from '~/schema/agent';
|
||
|
|
import type { IAgent } from '~/types';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates or returns the Agent model using the provided mongoose instance and schema
|
||
|
|
*/
|
||
|
|
export function createAgentModel(mongoose: typeof import('mongoose')) {
|
||
|
|
return mongoose.models.Agent || mongoose.model<IAgent>('Agent', agentSchema);
|
||
|
|
}
|