UNPKG

@charisma-ai/sdk

Version:

Charisma.ai SDK for Javascript (browser)

31 lines (30 loc) 1.93 kB
import { Emotion, Impact, Memory, Message } from "./types"; export declare const getGlobalBaseUrl: () => string; export declare const setGlobalBaseUrl: (newBaseUrl: string) => void; export declare type CommonApiOptions = { baseUrl?: string; }; export declare type CreatePlaythroughTokenOptions = { storyId: number; version?: number; userToken?: string; apiKey?: string; }; export declare type CreatePlaythroughTokenResult = string; export declare function createPlaythroughToken(options: CreatePlaythroughTokenOptions, apiOptions?: CommonApiOptions): Promise<CreatePlaythroughTokenResult>; export declare function createConversation(token: string, apiOptions?: CommonApiOptions): Promise<number>; export declare function createCharacterConversation(token: string, characterId: number, apiOptions?: CommonApiOptions): Promise<number>; export interface GetMessageHistoryResult { messages: Message[]; } export declare function getMessageHistory(token: string, conversationId?: number | undefined, minEventId?: string | undefined, apiOptions?: CommonApiOptions): Promise<GetMessageHistoryResult>; export interface GetPlaythroughInfoResult { emotions: Emotion[]; memories: Memory[]; impacts: Impact[]; } export declare function getPlaythroughInfo(token: string, apiOptions?: CommonApiOptions): Promise<GetPlaythroughInfoResult>; export declare function setMemory(token: string, memoryIdOrRecallValue: number | string, saveValue: string | null, apiOptions?: CommonApiOptions): Promise<void>; export declare function restartFromEpisodeId(token: string, episodeId: number, apiOptions?: CommonApiOptions): Promise<void>; export declare function restartFromEpisodeIndex(token: string, episodeIndex: number, apiOptions?: CommonApiOptions): Promise<void>; export declare function restartFromEventId(token: string, eventId: string, apiOptions?: CommonApiOptions): Promise<void>;