Skip to main content

Class: AiAgentClient

Hierarchy

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?AskOptionsWithoutVoiceThe 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.


askInternal

askInternal<T>(profileId, prompt, isVoiceResponse, options?): Promise<T>

Type parameters

Name
T

Parameters

NameType
profileIdstring
promptstring | File
isVoiceResponseboolean
options?Omit<AiChatbotChatOptions, "smoothTyping">

Returns

Promise<T>


askWithVoiceResponse

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

Parameters

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

Returns

Promise<AskWithVoiceResponse>


chat

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

Sends a prompt to the specified profile id.

Parameters

NameTypeDescription
profileIdstringThe profile id.
promptstringThe prompt.
options?ChatOptionsWithoutVoiceThe 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): AiAgentReference

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

AiAgentReference

The profile reference.


search(agentId, options): Promise<AiSearchResponse>

Parameters

NameType
agentIdstring
optionsAiSearchOptions

Returns

Promise<AiSearchResponse>


transcribeAndAsk

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

Parameters

NameType
profileIdstring
fileToTranscribeFile
options?AskOptionsWithoutVoice

Returns

Promise<AiTranscribeAndAskResponse>


transcribeAndAskWithVoiceResponse

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

Parameters

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

Returns

Promise<TranscribeAndAskWithVoiceResponse>


transcribeAndChat

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

Parameters

NameType
profileIdstring
fileToTranscribeFile
options?ChatOptionsWithoutVoice

Returns

Promise<TranscribeAndChatResponse>