Skip to main content

Class: AiChatbotProfileReference

Hierarchy

Methods

ask

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

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

Parameters

NameTypeDescription
promptstringThe prompt.
options?Omit<AiChatbotChatOptions, "smoothTyping">The chat options.

Returns

Promise<string>

Inherited from

AiAgentReference.ask


askWithVoiceResponse

askWithVoiceResponse(prompt, options?): Promise<AskWithVoiceResponse>

Parameters

NameType
promptstring
options?Omit<AiChatbotChatOptions, "smoothTyping">

Returns

Promise<AskWithVoiceResponse>

Inherited from

AiAgentReference.askWithVoiceResponse


chat

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

Sends a prompt to the current profile.

Parameters

NameTypeDescription
promptstringThe prompt.
options?AiChatbotChatOptionsThe chat options.

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.

Inherited from

AiAgentReference.chat


context

context(id?): AiAgentContextReference

Retrieves a context reference for the current profile. A context reference can be used to add a new context entry to the profile, or update/delete an existing entry context.

Parameters

NameTypeDescription
id?stringThe id of the context entry. If no id is passed, an id will be generated and the reference will point to a new context entry.

Returns

AiAgentContextReference

The context reference.

Inherited from

AiAgentReference.context


delete

delete(): Promise<void>

Deletes an existing chatbot profile. This will result in an error if a profile has not yet been created for the current profile id.

Returns

Promise<void>

A promise that resolves when the profile is successfully deleted.

Inherited from

AiAgentReference.delete


insert

insert(data): Promise<void>

Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.

Parameters

NameTypeDescription
dataProfileDataAn object containing options for creating the profile.

Returns

Promise<void>

A promise that resolves when the profile is successfully created.

Inherited from

AiAgentReference.insert


instruction

instruction(id?): AiAgentInstructionReference

Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new instruction entry to the profile, or update/delete an existing instruction entry.

Parameters

NameTypeDescription
id?stringThe id of the instruction entry. If no id is passed, an id will be generated and the reference will point to a new instruction entry.

Returns

AiAgentInstructionReference

The instruction reference.

Inherited from

AiAgentReference.instruction


search(options): Promise<AiSearchResponse>

Parameters

NameType
optionsAiSearchOptions

Returns

Promise<AiSearchResponse>

Inherited from

AiAgentReference.search


transcribeAndAsk

transcribeAndAsk(fileToTranscribe, options?): Promise<AiTranscribeAndAskResponse>

Parameters

NameType
fileToTranscribeFile
options?AskOptionsWithoutVoice

Returns

Promise<AiTranscribeAndAskResponse>

Inherited from

AiAgentReference.transcribeAndAsk


transcribeAndAskWithVoiceResponse

transcribeAndAskWithVoiceResponse(fileToTranscribe, options?): Promise<TranscribeAndAskWithVoiceResponse>

Parameters

NameType
fileToTranscribeFile
options?Omit<AiChatbotChatOptions, "smoothTyping">

Returns

Promise<TranscribeAndAskWithVoiceResponse>

Inherited from

AiAgentReference.transcribeAndAskWithVoiceResponse


transcribeAndChat

transcribeAndChat(fileToTranscribe, options?): Promise<TranscribeAndChatResponse>

Parameters

NameType
fileToTranscribeFile
options?AiChatbotChatOptions

Returns

Promise<TranscribeAndChatResponse>

Inherited from

AiAgentReference.transcribeAndChat


update

update(data): Promise<void>

Updates an existing chatbot profile. This will result in an error if a profile has not yet been created for the current profile id.

Parameters

NameTypeDescription
dataPartial<ProfileData>An object containing options for updating the profile.

Returns

Promise<void>

A promise that resolves when the profile is successfully updated.

Inherited from

AiAgentReference.update