mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
24 lines
No EOL
715 B
TypeScript
24 lines
No EOL
715 B
TypeScript
export class ConversationContent {
|
|
role: string;
|
|
content: string
|
|
timestamp: Date;
|
|
|
|
public static isConversationContentData(data: unknown): data is { role: string; content: string; timestamp: string } {
|
|
return (
|
|
typeof data === 'object' &&
|
|
data !== null &&
|
|
'role' in data &&
|
|
'content' in data &&
|
|
'timestamp' in data &&
|
|
typeof data.role === 'string' &&
|
|
typeof data.content === 'string' &&
|
|
typeof data.timestamp === 'string'
|
|
);
|
|
}
|
|
|
|
constructor(role: string, content: string) {
|
|
this.role = role;
|
|
this.content = content;
|
|
this.timestamp = new Date();
|
|
}
|
|
} |