mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00
feat: add schemas and types
This commit is contained in:
parent
d91f34dd42
commit
c0ae6f277f
3 changed files with 9 additions and 2 deletions
|
@ -9,10 +9,10 @@ import type {
|
|||
TConversationTag,
|
||||
TAttachment,
|
||||
} from './schemas';
|
||||
import type { Agent, AgentToolResources } from './types/assistants';
|
||||
import type { SettingDefinition } from './generate';
|
||||
import type { TMinimalFeedback } from './feedback';
|
||||
import type { ContentTypes } from './types/runs';
|
||||
import type { Agent } from './types/assistants';
|
||||
|
||||
export * from './schemas';
|
||||
|
||||
|
@ -499,6 +499,7 @@ export type TPrompt = {
|
|||
author: string;
|
||||
prompt: string;
|
||||
type: 'text' | 'chat';
|
||||
tool_resources?: AgentToolResources;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
_id?: string;
|
||||
|
@ -521,7 +522,7 @@ export type TPromptGroup = {
|
|||
};
|
||||
|
||||
export type TCreatePrompt = {
|
||||
prompt: Pick<TPrompt, 'prompt' | 'type'> & { groupId?: string };
|
||||
prompt: Pick<TPrompt, 'prompt' | 'type' | 'tool_resources'> & { groupId?: string };
|
||||
group?: { name: string; category?: string; oneliner?: string; command?: string };
|
||||
};
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@ const promptSchema: Schema<IPrompt> = new Schema(
|
|||
enum: ['text', 'chat'],
|
||||
required: true,
|
||||
},
|
||||
tool_resources: {
|
||||
type: Schema.Types.Mixed,
|
||||
default: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import type { AgentToolResources } from 'librechat-data-provider';
|
||||
import type { Document, Types } from 'mongoose';
|
||||
|
||||
export interface IPrompt extends Document {
|
||||
|
@ -5,6 +6,7 @@ export interface IPrompt extends Document {
|
|||
author: Types.ObjectId;
|
||||
prompt: string;
|
||||
type: 'text' | 'chat';
|
||||
tool_resources?: AgentToolResources;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue