Skip to main content

Class: AiChatbotClient

Methods

ask

ask(profileId, prompt, options?): Promise<string>

Sends a prompt to the specified profile id and returns the response as a Promise of string.

Parameters

NameTypeDescription
profileIdstringThe profile id.
promptstringThe prompt.
options?Omit<AiChatbotChatOptions, "smoothTyping">The options to send to the chat model.

Returns

Promise<string>

A promise that resolves when the chat is complete. The resolved value is the entire response.


chat

chat(profileId, prompt, options?): Observable<string>

Sends a prompt to the specified profile id.

Parameters

NameTypeDescription
profileIdstringThe profile id.
promptstringThe prompt.
options?AiChatbotChatOptionsThe options to send to the chat model.

Returns

Observable<string>

An observable that emits when a new response token is received. The emitted value is the entire response that has been received so far.


profile

profile(id): AiChatbotProfileReference

Retrieves a profile reference for the provided id. A profile reference can be used to create and update profiles, add instructions and context and start chats.

Parameters

NameTypeDescription
idstringThe id of the profile.

Returns

AiChatbotProfileReference

The profile reference.