lexica-dialog-core
Version:
Core server for Lexica dialog agent.
35 lines (34 loc) • 1.31 kB
TypeScript
import { Map, List } from 'immutable';
import { SessionRepository, SessionOption, SessionService } from '../Api';
import { Intent } from 'lexica-dialog-model/dist/Intent';
declare class DefaultSessionService implements SessionService {
private sessionRepository;
private uni;
private senderId;
private expireInMs;
private session;
constructor(sessionRepository: SessionRepository, uni: string, senderId: string, expireInMs: number);
init(): Promise<void>;
save(): Promise<void>;
getSessionId(): string;
addMemory(intent: Intent, features: Map<string, string>): void;
getMemoriesFeatures(): Map<string, string>;
getIntentMemoryFeatures(): List<{
command: string;
features: {
[key: string]: string;
};
}>;
startConversation(intent: Intent, features: Map<string, string>): void;
hasConversation(): boolean;
getConversationIntent(): Intent;
getConversationFeatures(): Map<string, string>;
updateConversationFeatures(features: Map<string, string>): void;
endConversation(): void;
setOptions(options: SessionOption[]): void;
hasOptions(): boolean;
getOptions(): SessionOption[];
removeOptions(): void;
protected findOrCreate(): Promise<void>;
}
export default DefaultSessionService;