Conversation\<TInput, TOutput>
A conversation between an Application and its conversational partner.
Extends
EventEmitter<{debugLog: [unknown];dslLog: [string,string];transcription: [Transcription]; }>
Type Parameters
• TInput extends Record<string, unknown> = Record<string, unknown>
• TOutput extends Record<string, unknown> = Record<string, unknown>
Properties
audio
audio:
AudioConfig
input
input:
TInput
The input data to be passed as the input context of a DashaScript application.
jobId
readonlyjobId:string
jobKey
readonlyjobKey:string
log
readonlylog:Logger
sip
sip:
SipConfig
Methods
execute()
execute(
options?):Promise<ConversationResult<TOutput>>
Start a conversation, i.e. run the DashaScript code on a specified input.
Returns a promise that settles when the conversation has finished. It rejects on errors, and resolves on successful completion.
Parameters
options?
cancelToken
channel
"text" | "audio"
Default
"audio"
emulation
Emulation configuration for test runs. When present, the emulation
config is serialized and sent to the server alongside test_mode: "true"
via the experimental job map.
experimental
Record<string, string>
retention
Partial<ConversationRetentionPolicy>
Conversation-scope retention policy. Per-field override over the
application-scope policy stored at register-time. Captured by value
at the start of execute(); mutations to this object after the call
are not applied. application is intentionally absent at this scope
(deploy-time decision only).
verboseDevlog
boolean
Opt into the full developer-log stream. When unset (default), the
runtime omits internal interpreter state-switch, GPT request/response,
and recognition messages from the live debug stream to reduce
bandwidth. The persisted devlog (downloadable via getDebugLog) is
unaffected.
Returns
Promise<ConversationResult<TOutput>>
sendEvent()
sendEvent(
eventName,eventValue):Promise<void>
Parameters
eventName
string
eventValue
Record<string, string>
Returns
Promise<void>
setDynamicTool()
setDynamicTool<
T>(options,handler):void
Type Parameters
• T extends TSchema
Parameters
options
DynamicToolScheme<T>
handler
(args, conv) => unknown
Returns
void
setDynamicToolRaw()
setDynamicToolRaw(
options,handler):void
Parameters
options
DynamicToolDescription
handler
(args, conv) => unknown
Returns
void