mirror of
https://github.com/zadam/trilium.git
synced 2025-12-29 02:34:25 +01:00
38 lines
738 B
TypeScript
38 lines
738 B
TypeScript
/**
|
|
* Interfaces for chat sessions and related data
|
|
*/
|
|
import type { Message } from "../ai_interface.js";
|
|
|
|
/**
|
|
* Represents a source note from which context is drawn
|
|
*/
|
|
export interface NoteSource {
|
|
noteId: string;
|
|
title: string;
|
|
content?: string;
|
|
similarity?: number;
|
|
branchId?: string;
|
|
}
|
|
|
|
/**
|
|
* Represents a chat session with message history
|
|
*/
|
|
export interface ChatSession {
|
|
id: string;
|
|
title: string;
|
|
messages: ChatMessage[];
|
|
createdAt: Date;
|
|
lastActive: Date;
|
|
noteContext?: string;
|
|
metadata: Record<string, any>;
|
|
}
|
|
|
|
/**
|
|
* Represents a single chat message
|
|
*/
|
|
export interface ChatMessage {
|
|
role: 'user' | 'assistant' | 'system';
|
|
content: string;
|
|
timestamp?: Date;
|
|
}
|