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
Name | Type | Description |
---|---|---|
profileId | string | The profile id. |
prompt | string | The 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
Name | Type | Description |
---|---|---|
profileId | string | The profile id. |
prompt | string | The prompt. |
options? | AiChatbotChatOptions | The 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
Name | Type | Description |
---|---|---|
id | string | The id of the profile. |
Returns
The profile reference.