recallrai
Version:
Official Node.js SDK for RecallrAI - Revolutionary contextual memory system that enables AI assistants to form meaningful connections between conversations, just like human memory.
141 lines (140 loc) • 2.96 kB
TypeScript
/**
* Message role in a conversation.
*/
export declare enum MessageRole {
USER = "user",
ASSISTANT = "assistant"
}
/**
* Status of a session.
*/
export declare enum SessionStatus {
PENDING = "pending",
PROCESSING = "processing",
PROCESSED = "processed"
}
/**
* Represents a message in a conversation session.
*/
export declare class Message {
/**
* Role of the message sender (user or assistant)
*/
role: MessageRole;
/**
* Content of the message
*/
content: string;
/**
* When the message was sent
*/
timestamp: Date;
/**
* Creates a new Message instance
*
* @param data - Message data
*/
constructor(data: {
role: MessageRole | string;
content: string;
timestamp: string | Date;
});
}
/**
* Represents a conversation session.
*/
export declare class Session {
/**
* Unique identifier for the session
*/
sessionId: string;
/**
* Current status of the session
*/
status: SessionStatus;
/**
* When the session was created
*/
createdAt: Date;
/**
* Creates a new Session instance
*
* @param data - Session data
*/
constructor(data: {
sessionId: string;
status: SessionStatus | string;
createdAt: string | Date;
});
private mapStatusStringToEnum;
/**
* Create a Session instance from an API response
*
* @param data - API response data
* @returns A Session instance
*/
static fromApiResponse(data: any): Session;
}
/**
* Represents a paginated list of sessions.
*/
export declare class SessionList {
/**
* List of sessions
*/
sessions: Session[];
/**
* Total number of sessions
*/
total: number;
/**
* Whether there are more sessions to fetch
*/
hasMore: boolean;
/**
* Creates a new SessionList instance
*
* @param data - Session list data
*/
constructor(data: {
sessions: Session[];
total: number;
hasMore: boolean;
});
/**
* Create a SessionList instance from an API response
*
* @param data - API response data
* @returns A SessionList instance
*/
static fromApiResponse(data: any): SessionList;
}
/**
* Represents the context for a session.
*/
export declare class Context {
/**
* Whether memory was used to generate the context
*/
memoryUsed: boolean;
/**
* The context for the session
*/
context: string;
/**
* Creates a new Context instance
*
* @param data - Context data
*/
constructor(data: {
memoryUsed: boolean;
context: string;
});
/**
* Create a Context instance from an API response
*
* @param data - API response data
* @returns A Context instance
*/
static fromApiResponse(data: any): Context;
}