UNPKG

@monsoft/davinci-ai

Version:

Davinci AI Client

35 lines (34 loc) 1.17 kB
import { Config } from '../../shared/types/init-config'; import { ChatMessage, Route } from '../../shared/types'; import { ZodType } from 'zod'; export declare class DavinciClient { private readonly config; HOST_ADDRESS: string; private readonly headers; constructor(config: Config); request<I, O>(route: Route<I, O>, payload: I): Promise<O>; requestGet<I, O>(route: Route<I, O>, params: Record<string, string>): Promise<O>; generateSuggestionForReply(payload: ChatMessage): Promise<{ messages: { content: string; uuid: string; }[]; parentMessageId: string; }>; logMessageOut(payload: ChatMessage): Promise<void>; conversationAnalyze({ contactId }: { contactId: string; }): Promise<unknown>; conversationAnalyzeCustomData<T>({ contactId, dataSchema, }: { dataSchema: ZodType<T>; contactId: string; }): Promise<T | undefined>; retrieveMessageSuggestions(messageId: string): Promise<{ messages: { content: string; uuid: string; }[]; parentMessageId: string; }>; private retryRequest; }