-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessage.model.ts
56 lines (44 loc) · 1.16 KB
/
message.model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { Field, ObjectType, ID, registerEnumType } from '@nestjs/graphql';
/**
* Represents the different roles in a chat conversation
*/
export enum MessageRole {
/**
* Represents the end user who sends queries or requests to the model.
* Contains questions, instructions, or any input that requires a response.
*/
User = 'user',
/**
* Represents the AI model's responses in the conversation.
* Contains generated answers, explanations, or any output based on user input.
*/
Assistant = 'assistant',
/**
* Represents system-level instructions that define the behavior and context.
* Used to set the model's personality, constraints, and background information.
* Typically appears at the start of a conversation.
*/
System = 'system',
}
registerEnumType(MessageRole, {
name: 'Role',
});
@ObjectType()
export class Message {
@Field(() => ID)
id: string;
@Field()
content: string;
@Field(() => MessageRole)
role: MessageRole;
@Field(() => Date)
createdAt: Date;
@Field(() => Date)
updatedAt: Date;
@Field()
isActive: boolean;
@Field()
isDeleted: boolean;
@Field({ nullable: true })
modelId?: string;
}