mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01: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,
|
TConversationTag,
|
||||||
TAttachment,
|
TAttachment,
|
||||||
} from './schemas';
|
} from './schemas';
|
||||||
|
import type { Agent, AgentToolResources } from './types/assistants';
|
||||||
import type { SettingDefinition } from './generate';
|
import type { SettingDefinition } from './generate';
|
||||||
import type { TMinimalFeedback } from './feedback';
|
import type { TMinimalFeedback } from './feedback';
|
||||||
import type { ContentTypes } from './types/runs';
|
import type { ContentTypes } from './types/runs';
|
||||||
import type { Agent } from './types/assistants';
|
|
||||||
|
|
||||||
export * from './schemas';
|
export * from './schemas';
|
||||||
|
|
||||||
|
|
@ -499,6 +499,7 @@ export type TPrompt = {
|
||||||
author: string;
|
author: string;
|
||||||
prompt: string;
|
prompt: string;
|
||||||
type: 'text' | 'chat';
|
type: 'text' | 'chat';
|
||||||
|
tool_resources?: AgentToolResources;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
_id?: string;
|
_id?: string;
|
||||||
|
|
@ -521,7 +522,7 @@ export type TPromptGroup = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TCreatePrompt = {
|
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 };
|
group?: { name: string; category?: string; oneliner?: string; command?: string };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ const promptSchema: Schema<IPrompt> = new Schema(
|
||||||
enum: ['text', 'chat'],
|
enum: ['text', 'chat'],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
tool_resources: {
|
||||||
|
type: Schema.Types.Mixed,
|
||||||
|
default: {},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { AgentToolResources } from 'librechat-data-provider';
|
||||||
import type { Document, Types } from 'mongoose';
|
import type { Document, Types } from 'mongoose';
|
||||||
|
|
||||||
export interface IPrompt extends Document {
|
export interface IPrompt extends Document {
|
||||||
|
|
@ -5,6 +6,7 @@ export interface IPrompt extends Document {
|
||||||
author: Types.ObjectId;
|
author: Types.ObjectId;
|
||||||
prompt: string;
|
prompt: string;
|
||||||
type: 'text' | 'chat';
|
type: 'text' | 'chat';
|
||||||
|
tool_resources?: AgentToolResources;
|
||||||
createdAt?: Date;
|
createdAt?: Date;
|
||||||
updatedAt?: Date;
|
updatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue