UNPKG

@butlerbot/sdk

Version:

The official ButlerBot SDK

29 lines (28 loc) 1.22 kB
import { Conversation, ConversationOptions } from "./modules/conversation"; import { UsagePolicyDataOptions } from "./modules/usage"; type OptionalApiKey<T> = Omit<T, "apiKey"> & { /** Optional API key, defaults to API key specified in client */ apiKey?: string; }; export type ButlerBotClientOptions = { /** The server endpoint, API calls are sent here */ serverUrl?: string; /** The API key to use with ButlerBot */ apiKey: string; /** Whether to enable debug logs */ debug?: boolean; }; export declare class ButlerBotClient { private apiKey; private serverUrl; private debug; constructor(config: ButlerBotClientOptions); /** Checks the health of the server returning true if server is alive */ healthCheck(healthCheckPath?: string): Promise<boolean>; /** Spawns a new Conversation, inherits api key and server URL */ createConversation(config?: OptionalApiKey<ConversationOptions>): Conversation; /** Get current usage policy data */ getUsagePolicyData(config: OptionalApiKey<UsagePolicyDataOptions>): Promise<import("./types/usage/policy").UsagePolicyData>; } export * from "./types/type_registry"; export { Conversation, ConversationOptions };