retell-sdk 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent.d.mts +3222 -526
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +3222 -526
- package/resources/agent.d.ts.map +1 -1
- package/resources/app.d.mts +122 -5
- package/resources/app.d.mts.map +1 -1
- package/resources/app.d.ts +122 -5
- package/resources/app.d.ts.map +1 -1
- package/resources/app.js +17 -1
- package/resources/app.js.map +1 -1
- package/resources/app.mjs +17 -1
- package/resources/app.mjs.map +1 -1
- package/resources/batch-call.d.mts +912 -13
- package/resources/batch-call.d.mts.map +1 -1
- package/resources/batch-call.d.ts +912 -13
- package/resources/batch-call.d.ts.map +1 -1
- package/resources/call.d.mts +7843 -3792
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +7843 -3792
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +1 -1
- package/resources/call.mjs +1 -1
- package/resources/chat-agent.d.mts +3125 -453
- package/resources/chat-agent.d.mts.map +1 -1
- package/resources/chat-agent.d.ts +3125 -453
- package/resources/chat-agent.d.ts.map +1 -1
- package/resources/chat.d.mts +892 -26
- package/resources/chat.d.mts.map +1 -1
- package/resources/chat.d.ts +892 -26
- package/resources/chat.d.ts.map +1 -1
- package/resources/contact.d.mts +162 -20
- package/resources/contact.d.mts.map +1 -1
- package/resources/contact.d.ts +162 -20
- package/resources/contact.d.ts.map +1 -1
- package/resources/contact.js +98 -4
- package/resources/contact.js.map +1 -1
- package/resources/contact.mjs +98 -4
- package/resources/contact.mjs.map +1 -1
- package/resources/conversation-flow-component.d.mts +3282 -243
- package/resources/conversation-flow-component.d.mts.map +1 -1
- package/resources/conversation-flow-component.d.ts +3282 -243
- package/resources/conversation-flow-component.d.ts.map +1 -1
- package/resources/conversation-flow.d.mts +7347 -1269
- package/resources/conversation-flow.d.mts.map +1 -1
- package/resources/conversation-flow.d.ts +7347 -1269
- package/resources/conversation-flow.d.ts.map +1 -1
- package/resources/crm.d.mts +37 -5
- package/resources/crm.d.mts.map +1 -1
- package/resources/crm.d.ts +37 -5
- package/resources/crm.d.ts.map +1 -1
- package/resources/identity.d.mts +4 -0
- package/resources/identity.d.mts.map +1 -1
- package/resources/identity.d.ts +4 -0
- package/resources/identity.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/llm.d.mts +867 -9
- package/resources/llm.d.mts.map +1 -1
- package/resources/llm.d.ts +867 -9
- package/resources/llm.d.ts.map +1 -1
- package/resources/tests.d.mts +3 -3
- package/resources/tests.d.mts.map +1 -1
- package/resources/tests.d.ts +3 -3
- package/resources/tests.d.ts.map +1 -1
- package/src/client.ts +4 -0
- package/src/resources/agent.ts +4786 -1504
- package/src/resources/app.ts +144 -4
- package/src/resources/batch-call.ts +1115 -10
- package/src/resources/call.ts +9825 -4806
- package/src/resources/chat-agent.ts +3958 -698
- package/src/resources/chat.ts +1133 -50
- package/src/resources/contact.ts +168 -20
- package/src/resources/conversation-flow-component.ts +4466 -191
- package/src/resources/conversation-flow.ts +9084 -525
- package/src/resources/crm.ts +44 -5
- package/src/resources/identity.ts +5 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/llm.ts +1045 -46
- package/src/resources/tests.ts +21 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/agent.d.ts
CHANGED
|
@@ -239,6 +239,14 @@ export interface AgentResponse {
|
|
|
239
239
|
* disable call screen prompt instructions.
|
|
240
240
|
*/
|
|
241
241
|
call_screening_option?: AgentResponse.CallScreeningOption | null;
|
|
242
|
+
/**
|
|
243
|
+
* Contact memory settings for phone calls and SMS chats. Creating an agent
|
|
244
|
+
* defaults enable_update to false and enable_read to true. Updates only change the
|
|
245
|
+
* supplied flags; omitted flags stay unchanged and an empty object has no effect.
|
|
246
|
+
* Set a flag to false to disable it. The configuration cannot be cleared. Existing
|
|
247
|
+
* agents without this configuration have both disabled.
|
|
248
|
+
*/
|
|
249
|
+
contact_memory_config?: AgentResponse.ContactMemoryConfig;
|
|
242
250
|
/**
|
|
243
251
|
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
244
252
|
*/
|
|
@@ -273,6 +281,13 @@ export interface AgentResponse {
|
|
|
273
281
|
* will not backchannel.
|
|
274
282
|
*/
|
|
275
283
|
enable_backchannel?: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* If set to true, the agent recognizes requests to stop calling or contacting the
|
|
286
|
+
* user, confirms once, and on a clear yes ends the call with disconnection reason
|
|
287
|
+
* user_requested_dnc and sets do_not_call to true on the contact for the user's
|
|
288
|
+
* phone number. If unset, default value false will apply.
|
|
289
|
+
*/
|
|
290
|
+
enable_dnc_detection?: boolean;
|
|
276
291
|
/**
|
|
277
292
|
* If set to true, the agent will dynamically adjust how quickly it responds based
|
|
278
293
|
* on the user's speech rate and past turn-taking behavior in the call. If unset,
|
|
@@ -377,7 +392,23 @@ export interface AgentResponse {
|
|
|
377
392
|
/**
|
|
378
393
|
* The model to use for post call analysis. Default to gpt-5.6-terra.
|
|
379
394
|
*/
|
|
380
|
-
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
395
|
+
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
396
|
+
/**
|
|
397
|
+
* Integration (Agent Functions) tools run as a dependency graph during teardown,
|
|
398
|
+
* after post-call analysis. Each tool can be gated by a condition. On calls the
|
|
399
|
+
* graph is stopped after five minutes so teardown can finish. Set to null to
|
|
400
|
+
* clear.
|
|
401
|
+
*/
|
|
402
|
+
post_session_tools?: Array<AgentResponse.AppTool | AgentResponse.CustomTool | AgentResponse.CodeTool | AgentResponse.SendSMSTool> | null;
|
|
403
|
+
/**
|
|
404
|
+
* Integration (Agent Functions) tools run as a dependency graph during session
|
|
405
|
+
* setup, before the agent's first message. Outputs are injected as dynamic
|
|
406
|
+
* variables. On calls the graph gets one minute unless an outbound caller will be
|
|
407
|
+
* dialed after setup, in which case it gets five minutes. Past that session
|
|
408
|
+
* initialization continues and any remaining tools finish in the background, so
|
|
409
|
+
* their outputs no longer reach the agent's prompt. Set to null to clear.
|
|
410
|
+
*/
|
|
411
|
+
pre_session_tools?: Array<AgentResponse.AppTool | AgentResponse.CustomTool | AgentResponse.CodeTool> | null;
|
|
381
412
|
/**
|
|
382
413
|
* A list of words / phrases and their pronunciation to be used to guide the audio
|
|
383
414
|
* synthesize for consistent pronunciation. Check the dashboard to see what
|
|
@@ -442,17 +473,12 @@ export interface AgentResponse {
|
|
|
442
473
|
* Default to general.
|
|
443
474
|
*/
|
|
444
475
|
vocab_specialization?: 'general' | 'medical';
|
|
445
|
-
/**
|
|
446
|
-
* Controls the emotional tone of the agent's voice. Currently supported for
|
|
447
|
-
* Cartesia and Minimax TTS providers. If unset, no emotion will be used.
|
|
448
|
-
*/
|
|
449
|
-
voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
|
|
450
476
|
/**
|
|
451
477
|
* Select the voice model used for the selected voice. Each provider has a set of
|
|
452
478
|
* available voice models. Set to null to remove voice model selection, and default
|
|
453
479
|
* ones will apply. Check out dashboard for more details of each voice model.
|
|
454
480
|
*/
|
|
455
|
-
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
481
|
+
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
456
482
|
/**
|
|
457
483
|
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
|
|
458
484
|
* speech, while higher value means faster speech rate. If unset, default value 1
|
|
@@ -553,21 +579,43 @@ export declare namespace AgentResponse {
|
|
|
553
579
|
*/
|
|
554
580
|
call_purpose: string;
|
|
555
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Contact memory settings for phone calls and SMS chats. Creating an agent
|
|
584
|
+
* defaults enable_update to false and enable_read to true. Updates only change the
|
|
585
|
+
* supplied flags; omitted flags stay unchanged and an empty object has no effect.
|
|
586
|
+
* Set a flag to false to disable it. The configuration cannot be cleared. Existing
|
|
587
|
+
* agents without this configuration have both disabled.
|
|
588
|
+
*/
|
|
589
|
+
interface ContactMemoryConfig {
|
|
590
|
+
/**
|
|
591
|
+
* Automatically add saved contact memory to the agent prompt. Skippable nodes can
|
|
592
|
+
* use answers from the current conversation even when this setting is disabled.
|
|
593
|
+
* Contact dynamic variables, including contact_memory, remain available regardless
|
|
594
|
+
* of this setting.
|
|
595
|
+
*/
|
|
596
|
+
enable_read?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Rewrite the contact memory after each conversation. Requires storing
|
|
599
|
+
* conversation data. Chat agents must also have end_chat_after_silence_ms set.
|
|
600
|
+
*/
|
|
601
|
+
enable_update?: boolean;
|
|
602
|
+
}
|
|
556
603
|
/**
|
|
557
604
|
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
558
605
|
*/
|
|
559
606
|
interface CustomSttConfig {
|
|
560
607
|
/**
|
|
561
608
|
* Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram,
|
|
562
|
-
* 500 for Soniox, 100 for AssemblyAI. For AssemblyAI, this sets
|
|
563
|
-
* (100-3000 ms). max_turn_silence adds half of this value,
|
|
564
|
-
* millisecond and bounded to 500-1000 ms, with a total cap
|
|
609
|
+
* 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets
|
|
610
|
+
* min_turn_silence (100-3000 ms). max_turn_silence adds half of this value,
|
|
611
|
+
* rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap
|
|
612
|
+
* of 3000 ms. Muse detects turn ends itself and ignores this value.
|
|
565
613
|
*/
|
|
566
614
|
endpointing_ms: number;
|
|
567
615
|
/**
|
|
568
616
|
* ASR provider name.
|
|
569
617
|
*/
|
|
570
|
-
provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai';
|
|
618
|
+
provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse';
|
|
571
619
|
}
|
|
572
620
|
/**
|
|
573
621
|
* Configuration for guardrail checks to detect and prevent prohibited topics in
|
|
@@ -804,179 +852,1030 @@ export declare namespace AgentResponse {
|
|
|
804
852
|
*/
|
|
805
853
|
required?: boolean;
|
|
806
854
|
}
|
|
807
|
-
interface
|
|
855
|
+
interface AppTool {
|
|
808
856
|
/**
|
|
809
|
-
* The
|
|
810
|
-
*
|
|
811
|
-
* depends on the selected voice provider and model.
|
|
857
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
858
|
+
* organization whose provider matches this tool's provider.
|
|
812
859
|
*/
|
|
813
|
-
|
|
860
|
+
app_id: string;
|
|
814
861
|
/**
|
|
815
|
-
*
|
|
862
|
+
* Name of the catalog template within the provider, as listed by
|
|
863
|
+
* list-app-templates.
|
|
816
864
|
*/
|
|
817
|
-
|
|
865
|
+
app_tool_template_name: string;
|
|
818
866
|
/**
|
|
819
|
-
*
|
|
867
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
868
|
+
* depends_on.
|
|
820
869
|
*/
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
interface UserDtmfOptions {
|
|
870
|
+
name: string;
|
|
824
871
|
/**
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
* considered complete and a response will be generated immediately.
|
|
872
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
873
|
+
* providers are listed by list-app-templates.
|
|
828
874
|
*/
|
|
829
|
-
|
|
875
|
+
provider: string;
|
|
876
|
+
type: 'integration_app';
|
|
830
877
|
/**
|
|
831
|
-
*
|
|
832
|
-
*
|
|
878
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
879
|
+
* running.
|
|
833
880
|
*/
|
|
834
|
-
|
|
881
|
+
condition?: AppTool.Condition;
|
|
835
882
|
/**
|
|
836
|
-
*
|
|
837
|
-
* timer resets with each digit received.
|
|
883
|
+
* Names of tools that must run before this one.
|
|
838
884
|
*/
|
|
839
|
-
|
|
840
|
-
}
|
|
841
|
-
/**
|
|
842
|
-
* If this option is set, the call will try to detect voicemail in the first 3
|
|
843
|
-
* minutes of the call. Actions defined (hangup, or leave a message) will be
|
|
844
|
-
* applied when the voicemail is detected. Set this to null to disable voicemail
|
|
845
|
-
* detection.
|
|
846
|
-
*/
|
|
847
|
-
interface VoicemailOption {
|
|
848
|
-
action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer;
|
|
885
|
+
depends_on?: Array<string>;
|
|
849
886
|
/**
|
|
850
|
-
*
|
|
851
|
-
* the
|
|
887
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
888
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
852
889
|
*/
|
|
853
|
-
|
|
890
|
+
description?: string;
|
|
891
|
+
/**
|
|
892
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
893
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
894
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
895
|
+
* prevent silence on the call.
|
|
896
|
+
*/
|
|
897
|
+
enable_typing_sound?: boolean;
|
|
898
|
+
/**
|
|
899
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
900
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
901
|
+
* applicable when speak_during_execution is true.
|
|
902
|
+
*/
|
|
903
|
+
execution_message_description?: string;
|
|
904
|
+
/**
|
|
905
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
906
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
907
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
908
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
909
|
+
* to "prompt".
|
|
910
|
+
*/
|
|
911
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
912
|
+
/**
|
|
913
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
914
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
915
|
+
* from the raw response.
|
|
916
|
+
*/
|
|
917
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
918
|
+
/**
|
|
919
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
920
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
921
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
922
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
923
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
924
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
925
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
926
|
+
* Each parameter's required list must match the schema returned by the
|
|
927
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
928
|
+
*/
|
|
929
|
+
parameters?: Array<AppTool.Parameter>;
|
|
930
|
+
/**
|
|
931
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
932
|
+
* populated from. Missing paths are ignored.
|
|
933
|
+
*/
|
|
934
|
+
response_variables?: {
|
|
935
|
+
[key: string]: string;
|
|
936
|
+
};
|
|
937
|
+
/**
|
|
938
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
939
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
940
|
+
* when the result of the tool is obtained.
|
|
941
|
+
*/
|
|
942
|
+
speak_after_execution?: boolean;
|
|
943
|
+
/**
|
|
944
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
945
|
+
* conversation. If true, will speak during execution.
|
|
946
|
+
*/
|
|
947
|
+
speak_during_execution?: boolean;
|
|
854
948
|
}
|
|
855
|
-
namespace
|
|
856
|
-
|
|
949
|
+
namespace AppTool {
|
|
950
|
+
/**
|
|
951
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
952
|
+
* running.
|
|
953
|
+
*/
|
|
954
|
+
interface Condition {
|
|
955
|
+
equations: Array<Condition.Equation>;
|
|
956
|
+
operator: '||' | '&&';
|
|
957
|
+
type: 'equation';
|
|
958
|
+
}
|
|
959
|
+
namespace Condition {
|
|
960
|
+
interface Equation {
|
|
961
|
+
/**
|
|
962
|
+
* Left side of the equation
|
|
963
|
+
*/
|
|
964
|
+
left: string;
|
|
965
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
966
|
+
/**
|
|
967
|
+
* Right side of the equation. The right side of the equation not required when
|
|
968
|
+
* "exists" or "not_exist" are selected.
|
|
969
|
+
*/
|
|
970
|
+
right?: string;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
interface UnionMember0 {
|
|
974
|
+
mode: 'all';
|
|
857
975
|
/**
|
|
858
|
-
*
|
|
859
|
-
* be in voicemail.
|
|
976
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
860
977
|
*/
|
|
861
|
-
|
|
862
|
-
type: 'prompt';
|
|
978
|
+
fields?: Array<string>;
|
|
863
979
|
}
|
|
864
|
-
interface
|
|
980
|
+
interface UnionMember1 {
|
|
865
981
|
/**
|
|
866
|
-
* The
|
|
982
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
983
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
984
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
985
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
986
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
987
|
+
* that match nothing contribute nothing.
|
|
867
988
|
*/
|
|
868
|
-
|
|
869
|
-
|
|
989
|
+
fields: Array<string>;
|
|
990
|
+
mode: 'subset';
|
|
870
991
|
}
|
|
871
|
-
|
|
872
|
-
|
|
992
|
+
/**
|
|
993
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
994
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
995
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
996
|
+
* empty parameter list.
|
|
997
|
+
*/
|
|
998
|
+
interface Parameter {
|
|
999
|
+
/**
|
|
1000
|
+
* The value of properties is an object, where each key is the name of a property
|
|
1001
|
+
* and each value is a schema used to validate that property.
|
|
1002
|
+
*/
|
|
1003
|
+
properties: unknown;
|
|
1004
|
+
/**
|
|
1005
|
+
* Type must be "object" for a JSON Schema object.
|
|
1006
|
+
*/
|
|
1007
|
+
type: 'object';
|
|
1008
|
+
/**
|
|
1009
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
1010
|
+
* its best to generate the required properties in its function arguments. Property
|
|
1011
|
+
* must exist in properties.
|
|
1012
|
+
*/
|
|
1013
|
+
required?: Array<string>;
|
|
873
1014
|
}
|
|
874
|
-
|
|
875
|
-
|
|
1015
|
+
}
|
|
1016
|
+
interface CustomTool {
|
|
1017
|
+
/**
|
|
1018
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
1019
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
1020
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
1021
|
+
* allowed).
|
|
1022
|
+
*/
|
|
1023
|
+
name: string;
|
|
1024
|
+
type: 'custom';
|
|
1025
|
+
/**
|
|
1026
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
1027
|
+
* to call the tool.
|
|
1028
|
+
*/
|
|
1029
|
+
url: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
1032
|
+
* of nested under "args".
|
|
1033
|
+
*/
|
|
1034
|
+
args_at_root?: boolean;
|
|
1035
|
+
/**
|
|
1036
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1037
|
+
* running.
|
|
1038
|
+
*/
|
|
1039
|
+
condition?: CustomTool.Condition;
|
|
1040
|
+
/**
|
|
1041
|
+
* Names of tools that must run before this one.
|
|
1042
|
+
*/
|
|
1043
|
+
depends_on?: Array<string>;
|
|
1044
|
+
/**
|
|
1045
|
+
* Describes what this tool does and when to call this tool.
|
|
1046
|
+
*/
|
|
1047
|
+
description?: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
1050
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
1051
|
+
* silence on the call.
|
|
1052
|
+
*/
|
|
1053
|
+
enable_typing_sound?: boolean;
|
|
1054
|
+
/**
|
|
1055
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
1056
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
1057
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
1058
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
1059
|
+
*/
|
|
1060
|
+
execution_message_description?: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* Type of execution message. "prompt" means the agent will use
|
|
1063
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1064
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1065
|
+
* to "prompt".
|
|
1066
|
+
*/
|
|
1067
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1068
|
+
/**
|
|
1069
|
+
* Headers to add to the request.
|
|
1070
|
+
*/
|
|
1071
|
+
headers?: {
|
|
1072
|
+
[key: string]: string;
|
|
1073
|
+
};
|
|
1074
|
+
/**
|
|
1075
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
1076
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
1077
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
1078
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
1079
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
1080
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
1081
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
1082
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
1083
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
1084
|
+
* than once. Defaults to 0 (no retry).
|
|
1085
|
+
*/
|
|
1086
|
+
max_retry?: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* Method to use for the request, default to POST.
|
|
1089
|
+
*/
|
|
1090
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1091
|
+
/**
|
|
1092
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
1093
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
1094
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
1095
|
+
* is encoded (see `args_at_root`).
|
|
1096
|
+
*/
|
|
1097
|
+
parameter_type?: 'json' | 'form';
|
|
1098
|
+
/**
|
|
1099
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
1100
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
1101
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
1102
|
+
* empty parameter list.
|
|
1103
|
+
*/
|
|
1104
|
+
parameters?: CustomTool.Parameters;
|
|
1105
|
+
/**
|
|
1106
|
+
* Query parameters to append to the request URL.
|
|
1107
|
+
*/
|
|
1108
|
+
query_params?: {
|
|
1109
|
+
[key: string]: string;
|
|
1110
|
+
};
|
|
1111
|
+
/**
|
|
1112
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
1113
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
1114
|
+
* use.
|
|
1115
|
+
*/
|
|
1116
|
+
response_variables?: {
|
|
1117
|
+
[key: string]: string;
|
|
1118
|
+
};
|
|
1119
|
+
/**
|
|
1120
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
1121
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
1122
|
+
* get update for the function call.
|
|
1123
|
+
*/
|
|
1124
|
+
speak_after_execution?: boolean;
|
|
1125
|
+
/**
|
|
1126
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
1127
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
1128
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
1129
|
+
* responsive.
|
|
1130
|
+
*/
|
|
1131
|
+
speak_during_execution?: boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
1134
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
1135
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
1136
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
1137
|
+
*/
|
|
1138
|
+
timeout_ms?: number;
|
|
1139
|
+
}
|
|
1140
|
+
namespace CustomTool {
|
|
1141
|
+
/**
|
|
1142
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1143
|
+
* running.
|
|
1144
|
+
*/
|
|
1145
|
+
interface Condition {
|
|
1146
|
+
equations: Array<Condition.Equation>;
|
|
1147
|
+
operator: '||' | '&&';
|
|
1148
|
+
type: 'equation';
|
|
1149
|
+
}
|
|
1150
|
+
namespace Condition {
|
|
1151
|
+
interface Equation {
|
|
1152
|
+
/**
|
|
1153
|
+
* Left side of the equation
|
|
1154
|
+
*/
|
|
1155
|
+
left: string;
|
|
1156
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
1157
|
+
/**
|
|
1158
|
+
* Right side of the equation. The right side of the equation not required when
|
|
1159
|
+
* "exists" or "not_exist" are selected.
|
|
1160
|
+
*/
|
|
1161
|
+
right?: string;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
1166
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
1167
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
1168
|
+
* empty parameter list.
|
|
1169
|
+
*/
|
|
1170
|
+
interface Parameters {
|
|
1171
|
+
/**
|
|
1172
|
+
* The value of properties is an object, where each key is the name of a property
|
|
1173
|
+
* and each value is a schema used to validate that property.
|
|
1174
|
+
*/
|
|
1175
|
+
properties: unknown;
|
|
1176
|
+
/**
|
|
1177
|
+
* Type must be "object" for a JSON Schema object.
|
|
1178
|
+
*/
|
|
1179
|
+
type: 'object';
|
|
1180
|
+
/**
|
|
1181
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
1182
|
+
* its best to generate the required properties in its function arguments. Property
|
|
1183
|
+
* must exist in properties.
|
|
1184
|
+
*/
|
|
1185
|
+
required?: Array<string>;
|
|
876
1186
|
}
|
|
877
1187
|
}
|
|
878
|
-
|
|
879
|
-
export interface AgentListResponse {
|
|
880
|
-
/**
|
|
881
|
-
* Whether more results are available.
|
|
882
|
-
*/
|
|
883
|
-
has_more: boolean;
|
|
884
|
-
items: Array<AgentListResponse.Item>;
|
|
885
|
-
/**
|
|
886
|
-
* Pagination key for the next page.
|
|
887
|
-
*/
|
|
888
|
-
pagination_key?: string;
|
|
889
|
-
}
|
|
890
|
-
export declare namespace AgentListResponse {
|
|
891
|
-
interface Item {
|
|
1188
|
+
interface CodeTool {
|
|
892
1189
|
/**
|
|
893
|
-
*
|
|
1190
|
+
* JavaScript code to execute in the sandbox.
|
|
894
1191
|
*/
|
|
895
|
-
|
|
1192
|
+
code: string;
|
|
896
1193
|
/**
|
|
897
|
-
*
|
|
1194
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
1195
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
1196
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
1197
|
+
* allowed).
|
|
898
1198
|
*/
|
|
899
|
-
|
|
900
|
-
|
|
1199
|
+
name: string;
|
|
1200
|
+
type: 'code';
|
|
901
1201
|
/**
|
|
902
|
-
*
|
|
1202
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1203
|
+
* running.
|
|
903
1204
|
*/
|
|
904
|
-
|
|
905
|
-
|
|
1205
|
+
condition?: CodeTool.Condition;
|
|
1206
|
+
/**
|
|
1207
|
+
* Names of tools that must run before this one.
|
|
1208
|
+
*/
|
|
1209
|
+
depends_on?: Array<string>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Describes what this tool does and when to call this tool.
|
|
1212
|
+
*/
|
|
1213
|
+
description?: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
1216
|
+
* executing.
|
|
1217
|
+
*/
|
|
1218
|
+
enable_typing_sound?: boolean;
|
|
1219
|
+
/**
|
|
1220
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
1221
|
+
* when speak_during_execution is true.
|
|
1222
|
+
*/
|
|
1223
|
+
execution_message_description?: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* Type of execution message. "prompt" means the agent will use
|
|
1226
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1227
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1228
|
+
* to "prompt".
|
|
1229
|
+
*/
|
|
1230
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1231
|
+
/**
|
|
1232
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
1233
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
1234
|
+
*/
|
|
1235
|
+
response_variables?: {
|
|
1236
|
+
[key: string]: string;
|
|
906
1237
|
};
|
|
907
1238
|
/**
|
|
908
|
-
*
|
|
909
|
-
*
|
|
1239
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
1240
|
+
* result of function is obtained.
|
|
910
1241
|
*/
|
|
911
|
-
|
|
1242
|
+
speak_after_execution?: boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
1245
|
+
* that." when executing the tool.
|
|
1246
|
+
*/
|
|
1247
|
+
speak_during_execution?: boolean;
|
|
1248
|
+
/**
|
|
1249
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
1250
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
1251
|
+
*/
|
|
1252
|
+
timeout_ms?: number;
|
|
912
1253
|
}
|
|
913
|
-
namespace
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1254
|
+
namespace CodeTool {
|
|
1255
|
+
/**
|
|
1256
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1257
|
+
* running.
|
|
1258
|
+
*/
|
|
1259
|
+
interface Condition {
|
|
1260
|
+
equations: Array<Condition.Equation>;
|
|
1261
|
+
operator: '||' | '&&';
|
|
1262
|
+
type: 'equation';
|
|
1263
|
+
}
|
|
1264
|
+
namespace Condition {
|
|
1265
|
+
interface Equation {
|
|
1266
|
+
/**
|
|
1267
|
+
* Left side of the equation
|
|
1268
|
+
*/
|
|
1269
|
+
left: string;
|
|
1270
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
1271
|
+
/**
|
|
1272
|
+
* Right side of the equation. The right side of the equation not required when
|
|
1273
|
+
* "exists" or "not_exist" are selected.
|
|
1274
|
+
*/
|
|
1275
|
+
right?: string;
|
|
1276
|
+
}
|
|
919
1277
|
}
|
|
920
1278
|
}
|
|
921
|
-
|
|
922
|
-
export type AgentCreateVersionResponse = AgentResponse | ChatAgentAPI.ChatAgentResponse;
|
|
923
|
-
export interface AgentListVersionsResponse {
|
|
924
|
-
/**
|
|
925
|
-
* Whether more results are available.
|
|
926
|
-
*/
|
|
927
|
-
has_more: boolean;
|
|
928
|
-
items: Array<AgentListVersionsResponse.Item>;
|
|
929
|
-
/**
|
|
930
|
-
* Pagination key for the next page.
|
|
931
|
-
*/
|
|
932
|
-
pagination_key?: string;
|
|
933
|
-
}
|
|
934
|
-
export declare namespace AgentListVersionsResponse {
|
|
935
|
-
interface Item {
|
|
1279
|
+
interface SendSMSTool {
|
|
936
1280
|
/**
|
|
937
|
-
*
|
|
1281
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
1282
|
+
* time (general tools + state tools + state edges).
|
|
938
1283
|
*/
|
|
939
|
-
|
|
1284
|
+
name: string;
|
|
1285
|
+
sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
|
|
1286
|
+
type: 'send_sms';
|
|
940
1287
|
/**
|
|
941
|
-
*
|
|
1288
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1289
|
+
* running.
|
|
942
1290
|
*/
|
|
943
|
-
|
|
1291
|
+
condition?: SendSMSTool.Condition;
|
|
944
1292
|
/**
|
|
945
|
-
*
|
|
1293
|
+
* Names of tools that must run before this one.
|
|
946
1294
|
*/
|
|
947
|
-
|
|
1295
|
+
depends_on?: Array<string>;
|
|
948
1296
|
/**
|
|
949
|
-
*
|
|
1297
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
1298
|
+
* to call the tool.
|
|
950
1299
|
*/
|
|
951
|
-
|
|
1300
|
+
description?: string;
|
|
952
1301
|
/**
|
|
953
|
-
*
|
|
1302
|
+
* Describes what to say before sending the SMS. Only applicable when
|
|
1303
|
+
* speak_during_execution is true.
|
|
954
1304
|
*/
|
|
955
|
-
|
|
1305
|
+
execution_message_description?: string;
|
|
956
1306
|
/**
|
|
957
|
-
*
|
|
1307
|
+
* Type of execution message. "prompt" means the agent will use
|
|
1308
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1309
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1310
|
+
* to "prompt".
|
|
958
1311
|
*/
|
|
959
|
-
|
|
1312
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1313
|
+
/**
|
|
1314
|
+
* If true, the agent will speak a short line before sending the SMS. If omitted,
|
|
1315
|
+
* defaults to true (same as end_call / transfer_call tools).
|
|
1316
|
+
*/
|
|
1317
|
+
speak_during_execution?: boolean;
|
|
960
1318
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1319
|
+
namespace SendSMSTool {
|
|
1320
|
+
interface SMSContentPredefined {
|
|
1321
|
+
/**
|
|
1322
|
+
* The static message to be sent in the SMS. Can contain dynamic variables.
|
|
1323
|
+
*/
|
|
1324
|
+
text?: string;
|
|
1325
|
+
type?: 'predefined';
|
|
1326
|
+
}
|
|
1327
|
+
interface SMSContentInferred {
|
|
1328
|
+
/**
|
|
1329
|
+
* The prompt to be used to help infer the SMS content. The model will take the
|
|
1330
|
+
* global prompt, the call transcript, and this prompt together to deduce the right
|
|
1331
|
+
* message to send. Can contain dynamic variables.
|
|
1332
|
+
*/
|
|
1333
|
+
prompt?: string;
|
|
1334
|
+
type?: 'inferred';
|
|
1335
|
+
}
|
|
1336
|
+
interface SMSContentTemplate {
|
|
1337
|
+
/**
|
|
1338
|
+
* The template to use for the SMS content. "info_collection" sends a predefined
|
|
1339
|
+
* message requesting information from the user.
|
|
1340
|
+
*/
|
|
1341
|
+
template: 'info_collection';
|
|
1342
|
+
type: 'template';
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
1346
|
+
* running.
|
|
1347
|
+
*/
|
|
1348
|
+
interface Condition {
|
|
1349
|
+
equations: Array<Condition.Equation>;
|
|
1350
|
+
operator: '||' | '&&';
|
|
1351
|
+
type: 'equation';
|
|
1352
|
+
}
|
|
1353
|
+
namespace Condition {
|
|
1354
|
+
interface Equation {
|
|
1355
|
+
/**
|
|
1356
|
+
* Left side of the equation
|
|
1357
|
+
*/
|
|
1358
|
+
left: string;
|
|
1359
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
1360
|
+
/**
|
|
1361
|
+
* Right side of the equation. The right side of the equation not required when
|
|
1362
|
+
* "exists" or "not_exist" are selected.
|
|
1363
|
+
*/
|
|
1364
|
+
right?: string;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
interface AppTool {
|
|
1369
|
+
/**
|
|
1370
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
1371
|
+
* organization whose provider matches this tool's provider.
|
|
1372
|
+
*/
|
|
1373
|
+
app_id: string;
|
|
1374
|
+
/**
|
|
1375
|
+
* Name of the catalog template within the provider, as listed by
|
|
1376
|
+
* list-app-templates.
|
|
1377
|
+
*/
|
|
1378
|
+
app_tool_template_name: string;
|
|
1379
|
+
/**
|
|
1380
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
1381
|
+
* depends_on.
|
|
1382
|
+
*/
|
|
1383
|
+
name: string;
|
|
1384
|
+
/**
|
|
1385
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
1386
|
+
* providers are listed by list-app-templates.
|
|
1387
|
+
*/
|
|
1388
|
+
provider: string;
|
|
1389
|
+
type: 'integration_app';
|
|
1390
|
+
/**
|
|
1391
|
+
* Names of tools that must run before this one.
|
|
1392
|
+
*/
|
|
1393
|
+
depends_on?: Array<string>;
|
|
1394
|
+
/**
|
|
1395
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1396
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
1397
|
+
*/
|
|
1398
|
+
description?: string;
|
|
1399
|
+
/**
|
|
1400
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1401
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
1402
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
1403
|
+
* prevent silence on the call.
|
|
1404
|
+
*/
|
|
1405
|
+
enable_typing_sound?: boolean;
|
|
1406
|
+
/**
|
|
1407
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1408
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
1409
|
+
* applicable when speak_during_execution is true.
|
|
1410
|
+
*/
|
|
1411
|
+
execution_message_description?: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1414
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
1415
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1416
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1417
|
+
* to "prompt".
|
|
1418
|
+
*/
|
|
1419
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1420
|
+
/**
|
|
1421
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
1422
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
1423
|
+
* from the raw response.
|
|
1424
|
+
*/
|
|
1425
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
1426
|
+
/**
|
|
1427
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
1428
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
1429
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
1430
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
1431
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
1432
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
1433
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
1434
|
+
* Each parameter's required list must match the schema returned by the
|
|
1435
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
1436
|
+
*/
|
|
1437
|
+
parameters?: Array<AppTool.Parameter>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
1440
|
+
* populated from. Missing paths are ignored.
|
|
1441
|
+
*/
|
|
1442
|
+
response_variables?: {
|
|
1443
|
+
[key: string]: string;
|
|
1444
|
+
};
|
|
1445
|
+
/**
|
|
1446
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1447
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
1448
|
+
* when the result of the tool is obtained.
|
|
1449
|
+
*/
|
|
1450
|
+
speak_after_execution?: boolean;
|
|
1451
|
+
/**
|
|
1452
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
1453
|
+
* conversation. If true, will speak during execution.
|
|
1454
|
+
*/
|
|
1455
|
+
speak_during_execution?: boolean;
|
|
1456
|
+
}
|
|
1457
|
+
namespace AppTool {
|
|
1458
|
+
interface UnionMember0 {
|
|
1459
|
+
mode: 'all';
|
|
1460
|
+
/**
|
|
1461
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
1462
|
+
*/
|
|
1463
|
+
fields?: Array<string>;
|
|
1464
|
+
}
|
|
1465
|
+
interface UnionMember1 {
|
|
1466
|
+
/**
|
|
1467
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
1468
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
1469
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
1470
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
1471
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
1472
|
+
* that match nothing contribute nothing.
|
|
1473
|
+
*/
|
|
1474
|
+
fields: Array<string>;
|
|
1475
|
+
mode: 'subset';
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
1479
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
1480
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
1481
|
+
* empty parameter list.
|
|
1482
|
+
*/
|
|
1483
|
+
interface Parameter {
|
|
1484
|
+
/**
|
|
1485
|
+
* The value of properties is an object, where each key is the name of a property
|
|
1486
|
+
* and each value is a schema used to validate that property.
|
|
1487
|
+
*/
|
|
1488
|
+
properties: unknown;
|
|
1489
|
+
/**
|
|
1490
|
+
* Type must be "object" for a JSON Schema object.
|
|
1491
|
+
*/
|
|
1492
|
+
type: 'object';
|
|
1493
|
+
/**
|
|
1494
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
1495
|
+
* its best to generate the required properties in its function arguments. Property
|
|
1496
|
+
* must exist in properties.
|
|
1497
|
+
*/
|
|
1498
|
+
required?: Array<string>;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
interface CustomTool {
|
|
1502
|
+
/**
|
|
1503
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
1504
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
1505
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
1506
|
+
* allowed).
|
|
1507
|
+
*/
|
|
1508
|
+
name: string;
|
|
1509
|
+
type: 'custom';
|
|
1510
|
+
/**
|
|
1511
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
1512
|
+
* to call the tool.
|
|
1513
|
+
*/
|
|
1514
|
+
url: string;
|
|
1515
|
+
/**
|
|
1516
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
1517
|
+
* of nested under "args".
|
|
1518
|
+
*/
|
|
1519
|
+
args_at_root?: boolean;
|
|
1520
|
+
/**
|
|
1521
|
+
* Names of tools that must run before this one.
|
|
1522
|
+
*/
|
|
1523
|
+
depends_on?: Array<string>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Describes what this tool does and when to call this tool.
|
|
1526
|
+
*/
|
|
1527
|
+
description?: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
1530
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
1531
|
+
* silence on the call.
|
|
1532
|
+
*/
|
|
1533
|
+
enable_typing_sound?: boolean;
|
|
1534
|
+
/**
|
|
1535
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
1536
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
1537
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
1538
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
1539
|
+
*/
|
|
1540
|
+
execution_message_description?: string;
|
|
1541
|
+
/**
|
|
1542
|
+
* Type of execution message. "prompt" means the agent will use
|
|
1543
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1544
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1545
|
+
* to "prompt".
|
|
1546
|
+
*/
|
|
1547
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1548
|
+
/**
|
|
1549
|
+
* Headers to add to the request.
|
|
1550
|
+
*/
|
|
1551
|
+
headers?: {
|
|
1552
|
+
[key: string]: string;
|
|
1553
|
+
};
|
|
1554
|
+
/**
|
|
1555
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
1556
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
1557
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
1558
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
1559
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
1560
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
1561
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
1562
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
1563
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
1564
|
+
* than once. Defaults to 0 (no retry).
|
|
1565
|
+
*/
|
|
1566
|
+
max_retry?: number;
|
|
1567
|
+
/**
|
|
1568
|
+
* Method to use for the request, default to POST.
|
|
1569
|
+
*/
|
|
1570
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1571
|
+
/**
|
|
1572
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
1573
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
1574
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
1575
|
+
* is encoded (see `args_at_root`).
|
|
1576
|
+
*/
|
|
1577
|
+
parameter_type?: 'json' | 'form';
|
|
1578
|
+
/**
|
|
1579
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
1580
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
1581
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
1582
|
+
* empty parameter list.
|
|
1583
|
+
*/
|
|
1584
|
+
parameters?: CustomTool.Parameters;
|
|
1585
|
+
/**
|
|
1586
|
+
* Query parameters to append to the request URL.
|
|
1587
|
+
*/
|
|
1588
|
+
query_params?: {
|
|
1589
|
+
[key: string]: string;
|
|
1590
|
+
};
|
|
1591
|
+
/**
|
|
1592
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
1593
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
1594
|
+
* use.
|
|
1595
|
+
*/
|
|
1596
|
+
response_variables?: {
|
|
1597
|
+
[key: string]: string;
|
|
1598
|
+
};
|
|
1599
|
+
/**
|
|
1600
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
1601
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
1602
|
+
* get update for the function call.
|
|
1603
|
+
*/
|
|
1604
|
+
speak_after_execution?: boolean;
|
|
1605
|
+
/**
|
|
1606
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
1607
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
1608
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
1609
|
+
* responsive.
|
|
1610
|
+
*/
|
|
1611
|
+
speak_during_execution?: boolean;
|
|
1612
|
+
/**
|
|
1613
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
1614
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
1615
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
1616
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
1617
|
+
*/
|
|
1618
|
+
timeout_ms?: number;
|
|
1619
|
+
}
|
|
1620
|
+
namespace CustomTool {
|
|
1621
|
+
/**
|
|
1622
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
1623
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
1624
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
1625
|
+
* empty parameter list.
|
|
1626
|
+
*/
|
|
1627
|
+
interface Parameters {
|
|
1628
|
+
/**
|
|
1629
|
+
* The value of properties is an object, where each key is the name of a property
|
|
1630
|
+
* and each value is a schema used to validate that property.
|
|
1631
|
+
*/
|
|
1632
|
+
properties: unknown;
|
|
1633
|
+
/**
|
|
1634
|
+
* Type must be "object" for a JSON Schema object.
|
|
1635
|
+
*/
|
|
1636
|
+
type: 'object';
|
|
1637
|
+
/**
|
|
1638
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
1639
|
+
* its best to generate the required properties in its function arguments. Property
|
|
1640
|
+
* must exist in properties.
|
|
1641
|
+
*/
|
|
1642
|
+
required?: Array<string>;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
interface CodeTool {
|
|
1646
|
+
/**
|
|
1647
|
+
* JavaScript code to execute in the sandbox.
|
|
1648
|
+
*/
|
|
1649
|
+
code: string;
|
|
1650
|
+
/**
|
|
1651
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
1652
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
1653
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
1654
|
+
* allowed).
|
|
1655
|
+
*/
|
|
1656
|
+
name: string;
|
|
1657
|
+
type: 'code';
|
|
1658
|
+
/**
|
|
1659
|
+
* Names of tools that must run before this one.
|
|
1660
|
+
*/
|
|
1661
|
+
depends_on?: Array<string>;
|
|
1662
|
+
/**
|
|
1663
|
+
* Describes what this tool does and when to call this tool.
|
|
1664
|
+
*/
|
|
1665
|
+
description?: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
1668
|
+
* executing.
|
|
1669
|
+
*/
|
|
1670
|
+
enable_typing_sound?: boolean;
|
|
1671
|
+
/**
|
|
1672
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
1673
|
+
* when speak_during_execution is true.
|
|
1674
|
+
*/
|
|
1675
|
+
execution_message_description?: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* Type of execution message. "prompt" means the agent will use
|
|
1678
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
1679
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
1680
|
+
* to "prompt".
|
|
1681
|
+
*/
|
|
1682
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1683
|
+
/**
|
|
1684
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
1685
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
1686
|
+
*/
|
|
1687
|
+
response_variables?: {
|
|
1688
|
+
[key: string]: string;
|
|
1689
|
+
};
|
|
1690
|
+
/**
|
|
1691
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
1692
|
+
* result of function is obtained.
|
|
1693
|
+
*/
|
|
1694
|
+
speak_after_execution?: boolean;
|
|
1695
|
+
/**
|
|
1696
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
1697
|
+
* that." when executing the tool.
|
|
1698
|
+
*/
|
|
1699
|
+
speak_during_execution?: boolean;
|
|
1700
|
+
/**
|
|
1701
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
1702
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
1703
|
+
*/
|
|
1704
|
+
timeout_ms?: number;
|
|
1705
|
+
}
|
|
1706
|
+
interface PronunciationDictionary {
|
|
1707
|
+
/**
|
|
1708
|
+
* The phonetic alphabet to use. MiniMax speech-02-turbo supports IPA and Pinyin.
|
|
1709
|
+
* MiniMax speech-2.8-turbo also supports Jyutping. Support for other alphabets
|
|
1710
|
+
* depends on the selected voice provider and model.
|
|
1711
|
+
*/
|
|
1712
|
+
alphabet: 'ipa' | 'cmu' | 'pinyin' | 'jyutping';
|
|
1713
|
+
/**
|
|
1714
|
+
* Pronunciation of the word in the format of the selected phonetic alphabet.
|
|
1715
|
+
*/
|
|
1716
|
+
phoneme: string;
|
|
1717
|
+
/**
|
|
1718
|
+
* The string of word / phrase to be annotated with pronunciation.
|
|
1719
|
+
*/
|
|
1720
|
+
word: string;
|
|
1721
|
+
}
|
|
1722
|
+
interface UserDtmfOptions {
|
|
1723
|
+
/**
|
|
1724
|
+
* The maximum number of digits allowed in the user's DTMF (Dual-Tone
|
|
1725
|
+
* Multi-Frequency) input per turn. Once this limit is reached, the input is
|
|
1726
|
+
* considered complete and a response will be generated immediately.
|
|
1727
|
+
*/
|
|
1728
|
+
digit_limit?: number | null;
|
|
1729
|
+
/**
|
|
1730
|
+
* A single key that signals the end of DTMF input. Acceptable values include any
|
|
1731
|
+
* digit (0-9), the pound/hash symbol (#), or the asterisk (\*).
|
|
1732
|
+
*/
|
|
1733
|
+
termination_key?: string | null;
|
|
1734
|
+
/**
|
|
1735
|
+
* The time (in milliseconds) to wait for user DTMF input before timing out. The
|
|
1736
|
+
* timer resets with each digit received.
|
|
1737
|
+
*/
|
|
1738
|
+
timeout_ms?: number;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* If this option is set, the call will try to detect voicemail in the first 3
|
|
1742
|
+
* minutes of the call. Actions defined (hangup, or leave a message) will be
|
|
1743
|
+
* applied when the voicemail is detected. Set this to null to disable voicemail
|
|
1744
|
+
* detection.
|
|
1745
|
+
*/
|
|
1746
|
+
interface VoicemailOption {
|
|
1747
|
+
action: VoicemailOption.VoicemailActionPrompt | VoicemailOption.VoicemailActionStaticText | VoicemailOption.VoicemailActionHangup | VoicemailOption.VoicemailActionBridgeTransfer;
|
|
1748
|
+
/**
|
|
1749
|
+
* Optionally describe what should be treated as voicemail. Leave as null to use
|
|
1750
|
+
* the default definition.
|
|
1751
|
+
*/
|
|
1752
|
+
detection_prompt?: string | null;
|
|
1753
|
+
}
|
|
1754
|
+
namespace VoicemailOption {
|
|
1755
|
+
interface VoicemailActionPrompt {
|
|
1756
|
+
/**
|
|
1757
|
+
* The prompt used to generate the text to be spoken when the call is detected to
|
|
1758
|
+
* be in voicemail.
|
|
1759
|
+
*/
|
|
1760
|
+
text: string;
|
|
1761
|
+
type: 'prompt';
|
|
1762
|
+
}
|
|
1763
|
+
interface VoicemailActionStaticText {
|
|
1764
|
+
/**
|
|
1765
|
+
* The text to be spoken when the call is detected to be in voicemail.
|
|
1766
|
+
*/
|
|
1767
|
+
text: string;
|
|
1768
|
+
type: 'static_text';
|
|
1769
|
+
}
|
|
1770
|
+
interface VoicemailActionHangup {
|
|
1771
|
+
type: 'hangup';
|
|
1772
|
+
}
|
|
1773
|
+
interface VoicemailActionBridgeTransfer {
|
|
1774
|
+
type: 'bridge_transfer';
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
export interface AgentListResponse {
|
|
1779
|
+
/**
|
|
1780
|
+
* Whether more results are available.
|
|
1781
|
+
*/
|
|
1782
|
+
has_more: boolean;
|
|
1783
|
+
items: Array<AgentListResponse.Item>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Pagination key for the next page.
|
|
1786
|
+
*/
|
|
1787
|
+
pagination_key?: string;
|
|
1788
|
+
}
|
|
1789
|
+
export declare namespace AgentListResponse {
|
|
1790
|
+
interface Item {
|
|
1791
|
+
/**
|
|
1792
|
+
* Unique id of agent.
|
|
1793
|
+
*/
|
|
1794
|
+
agent_id: string;
|
|
1795
|
+
/**
|
|
1796
|
+
* The name of the agent. Only used for your own reference.
|
|
1797
|
+
*/
|
|
1798
|
+
agent_name: string;
|
|
1799
|
+
channel: 'voice' | 'chat';
|
|
1800
|
+
/**
|
|
1801
|
+
* Authoritative root tags for this agent, keyed by tag name.
|
|
1802
|
+
*/
|
|
1803
|
+
tags: {
|
|
1804
|
+
[key: string]: Item.Tags;
|
|
1805
|
+
};
|
|
1806
|
+
/**
|
|
1807
|
+
* User modification timestamp (milliseconds since epoch). Either the time of last
|
|
1808
|
+
* update or creation if no updates available.
|
|
1809
|
+
*/
|
|
1810
|
+
user_modified_timestamp: number;
|
|
1811
|
+
}
|
|
1812
|
+
namespace Item {
|
|
1813
|
+
interface Tags {
|
|
1814
|
+
dynamic_variables?: {
|
|
1815
|
+
[key: string]: string;
|
|
1816
|
+
};
|
|
1817
|
+
version?: number;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
export type AgentCreateVersionResponse = AgentResponse | ChatAgentAPI.ChatAgentResponse;
|
|
1822
|
+
export interface AgentListVersionsResponse {
|
|
1823
|
+
/**
|
|
1824
|
+
* Whether more results are available.
|
|
1825
|
+
*/
|
|
1826
|
+
has_more: boolean;
|
|
1827
|
+
items: Array<AgentListVersionsResponse.Item>;
|
|
1828
|
+
/**
|
|
1829
|
+
* Pagination key for the next page.
|
|
1830
|
+
*/
|
|
1831
|
+
pagination_key?: string;
|
|
1832
|
+
}
|
|
1833
|
+
export declare namespace AgentListVersionsResponse {
|
|
1834
|
+
interface Item {
|
|
1835
|
+
/**
|
|
1836
|
+
* Whether the agent version is published.
|
|
1837
|
+
*/
|
|
1838
|
+
is_published: boolean;
|
|
1839
|
+
/**
|
|
1840
|
+
* Last modification timestamp in milliseconds since epoch.
|
|
1841
|
+
*/
|
|
1842
|
+
last_modification_timestamp: number;
|
|
1843
|
+
/**
|
|
1844
|
+
* Version number of the agent.
|
|
1845
|
+
*/
|
|
1846
|
+
version: number;
|
|
1847
|
+
/**
|
|
1848
|
+
* Version that this agent version was based on.
|
|
1849
|
+
*/
|
|
1850
|
+
base_version?: number;
|
|
1851
|
+
/**
|
|
1852
|
+
* Optional description of the agent version.
|
|
1853
|
+
*/
|
|
1854
|
+
version_description?: string;
|
|
1855
|
+
/**
|
|
1856
|
+
* Optional title of the agent version.
|
|
1857
|
+
*/
|
|
1858
|
+
version_title?: string;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
export type AgentRepairResponse = AgentResponse | ChatAgentAPI.ChatAgentResponse;
|
|
1862
|
+
export interface AgentCreateParams {
|
|
1863
|
+
/**
|
|
1864
|
+
* The Response Engine to attach to the agent. It is used to generate responses for
|
|
1865
|
+
* the agent. You need to create a Response Engine first before attaching it to an
|
|
1866
|
+
* agent.
|
|
1867
|
+
*/
|
|
1868
|
+
response_engine: AgentCreateParams.ResponseEngineRetellLm | AgentCreateParams.ResponseEngineCustomLm | AgentCreateParams.ResponseEngineConversationFlow;
|
|
1869
|
+
/**
|
|
1870
|
+
* Unique voice id used for the agent. Find list of available voices and their
|
|
1871
|
+
* preview in Dashboard.
|
|
1872
|
+
*/
|
|
1873
|
+
voice_id: string;
|
|
1874
|
+
/**
|
|
1875
|
+
* The name of the agent. Only used for your own reference.
|
|
1876
|
+
*/
|
|
1877
|
+
agent_name?: string | null;
|
|
1878
|
+
/**
|
|
980
1879
|
* If set to true, DTMF input will interrupt the agent even when
|
|
981
1880
|
* interruption_sensitivity is 0. Can be overridden per conversation or subagent
|
|
982
1881
|
* node. Default to false.
|
|
@@ -1048,6 +1947,14 @@ export interface AgentCreateParams {
|
|
|
1048
1947
|
* disable call screen prompt instructions.
|
|
1049
1948
|
*/
|
|
1050
1949
|
call_screening_option?: AgentCreateParams.CallScreeningOption | null;
|
|
1950
|
+
/**
|
|
1951
|
+
* Contact memory settings for phone calls and SMS chats. Creating an agent
|
|
1952
|
+
* defaults enable_update to false and enable_read to true. Updates only change the
|
|
1953
|
+
* supplied flags; omitted flags stay unchanged and an empty object has no effect.
|
|
1954
|
+
* Set a flag to false to disable it. The configuration cannot be cleared. Existing
|
|
1955
|
+
* agents without this configuration have both disabled.
|
|
1956
|
+
*/
|
|
1957
|
+
contact_memory_config?: AgentCreateParams.ContactMemoryConfig;
|
|
1051
1958
|
/**
|
|
1052
1959
|
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
1053
1960
|
*/
|
|
@@ -1082,6 +1989,13 @@ export interface AgentCreateParams {
|
|
|
1082
1989
|
* will not backchannel.
|
|
1083
1990
|
*/
|
|
1084
1991
|
enable_backchannel?: boolean;
|
|
1992
|
+
/**
|
|
1993
|
+
* If set to true, the agent recognizes requests to stop calling or contacting the
|
|
1994
|
+
* user, confirms once, and on a clear yes ends the call with disconnection reason
|
|
1995
|
+
* user_requested_dnc and sets do_not_call to true on the contact for the user's
|
|
1996
|
+
* phone number. If unset, default value false will apply.
|
|
1997
|
+
*/
|
|
1998
|
+
enable_dnc_detection?: boolean;
|
|
1085
1999
|
/**
|
|
1086
2000
|
* If set to true, the agent will dynamically adjust how quickly it responds based
|
|
1087
2001
|
* on the user's speech rate and past turn-taking behavior in the call. If unset,
|
|
@@ -1182,7 +2096,23 @@ export interface AgentCreateParams {
|
|
|
1182
2096
|
/**
|
|
1183
2097
|
* The model to use for post call analysis. Default to gpt-5.6-terra.
|
|
1184
2098
|
*/
|
|
1185
|
-
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
2099
|
+
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
2100
|
+
/**
|
|
2101
|
+
* Integration (Agent Functions) tools run as a dependency graph during teardown,
|
|
2102
|
+
* after post-call analysis. Each tool can be gated by a condition. On calls the
|
|
2103
|
+
* graph is stopped after five minutes so teardown can finish. Set to null to
|
|
2104
|
+
* clear.
|
|
2105
|
+
*/
|
|
2106
|
+
post_session_tools?: Array<AgentCreateParams.AppTool | AgentCreateParams.CustomTool | AgentCreateParams.CodeTool | AgentCreateParams.SendSMSTool> | null;
|
|
2107
|
+
/**
|
|
2108
|
+
* Integration (Agent Functions) tools run as a dependency graph during session
|
|
2109
|
+
* setup, before the agent's first message. Outputs are injected as dynamic
|
|
2110
|
+
* variables. On calls the graph gets one minute unless an outbound caller will be
|
|
2111
|
+
* dialed after setup, in which case it gets five minutes. Past that session
|
|
2112
|
+
* initialization continues and any remaining tools finish in the background, so
|
|
2113
|
+
* their outputs no longer reach the agent's prompt. Set to null to clear.
|
|
2114
|
+
*/
|
|
2115
|
+
pre_session_tools?: Array<AgentCreateParams.AppTool | AgentCreateParams.CustomTool | AgentCreateParams.CodeTool> | null;
|
|
1186
2116
|
/**
|
|
1187
2117
|
* A list of words / phrases and their pronunciation to be used to guide the audio
|
|
1188
2118
|
* synthesize for consistent pronunciation. Check the dashboard to see what
|
|
@@ -1247,367 +2177,1235 @@ export interface AgentCreateParams {
|
|
|
1247
2177
|
* Default to general.
|
|
1248
2178
|
*/
|
|
1249
2179
|
vocab_specialization?: 'general' | 'medical';
|
|
1250
|
-
/**
|
|
1251
|
-
* Controls the emotional tone of the agent's voice. Currently supported for
|
|
1252
|
-
* Cartesia and Minimax TTS providers. If unset, no emotion will be used.
|
|
1253
|
-
*/
|
|
1254
|
-
voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
|
|
1255
2180
|
/**
|
|
1256
2181
|
* Select the voice model used for the selected voice. Each provider has a set of
|
|
1257
2182
|
* available voice models. Set to null to remove voice model selection, and default
|
|
1258
2183
|
* ones will apply. Check out dashboard for more details of each voice model.
|
|
1259
2184
|
*/
|
|
1260
|
-
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
2185
|
+
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
2186
|
+
/**
|
|
2187
|
+
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
|
|
2188
|
+
* speech, while higher value means faster speech rate. If unset, default value 1
|
|
2189
|
+
* will apply.
|
|
2190
|
+
*/
|
|
2191
|
+
voice_speed?: number;
|
|
2192
|
+
/**
|
|
2193
|
+
* Controls how stable the voice is. Value ranging from [0,2]. Lower value means
|
|
2194
|
+
* more stable, and higher value means more variant speech generation. Check the
|
|
2195
|
+
* dashboard to see what provider supports this feature. If unset, default value 1
|
|
2196
|
+
* will apply.
|
|
2197
|
+
*/
|
|
2198
|
+
voice_temperature?: number;
|
|
2199
|
+
/**
|
|
2200
|
+
* If this option is set, the call will try to detect voicemail in the first 3
|
|
2201
|
+
* minutes of the call. Actions defined (hangup, or leave a message) will be
|
|
2202
|
+
* applied when the voicemail is detected. Set this to null to disable voicemail
|
|
2203
|
+
* detection.
|
|
2204
|
+
*/
|
|
2205
|
+
voicemail_option?: AgentCreateParams.VoicemailOption | null;
|
|
2206
|
+
/**
|
|
2207
|
+
* If set, will control the volume of the agent. Value ranging from [0,2]. Lower
|
|
2208
|
+
* value means quieter agent speech, while higher value means louder agent speech.
|
|
2209
|
+
* If unset, default value 1 will apply.
|
|
2210
|
+
*/
|
|
2211
|
+
volume?: number;
|
|
2212
|
+
/**
|
|
2213
|
+
* Which webhook events this agent should receive. If not set, defaults to
|
|
2214
|
+
* call_started, call_ended, call_analyzed.
|
|
2215
|
+
*/
|
|
2216
|
+
webhook_events?: Array<'call_started' | 'call_ended' | 'call_analyzed' | 'transcript_updated' | 'transfer_started' | 'transfer_bridged' | 'transfer_cancelled' | 'transfer_ended'> | null;
|
|
2217
|
+
/**
|
|
2218
|
+
* The timeout for the webhook in milliseconds. If not set, default value of 10000
|
|
2219
|
+
* will apply.
|
|
2220
|
+
*/
|
|
2221
|
+
webhook_timeout_ms?: number;
|
|
2222
|
+
/**
|
|
2223
|
+
* The webhook for agent to listen to call events. See what events it would get at
|
|
2224
|
+
* [webhook doc](/features/webhook). If set, will binds webhook events for this
|
|
2225
|
+
* agent to the specified url, and will ignore the account level webhook for this
|
|
2226
|
+
* agent. Set to `null` to remove webhook url from this agent.
|
|
2227
|
+
*/
|
|
2228
|
+
webhook_url?: string | null;
|
|
2229
|
+
}
|
|
2230
|
+
export declare namespace AgentCreateParams {
|
|
2231
|
+
interface ResponseEngineRetellLm {
|
|
2232
|
+
/**
|
|
2233
|
+
* id of the Retell LLM Response Engine.
|
|
2234
|
+
*/
|
|
2235
|
+
llm_id: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* type of the Response Engine.
|
|
2238
|
+
*/
|
|
2239
|
+
type: 'retell-llm';
|
|
2240
|
+
/**
|
|
2241
|
+
* Version of the Retell LLM Response Engine.
|
|
2242
|
+
*/
|
|
2243
|
+
version?: number | null;
|
|
2244
|
+
}
|
|
2245
|
+
interface ResponseEngineCustomLm {
|
|
2246
|
+
/**
|
|
2247
|
+
* LLM websocket url of the custom LLM.
|
|
2248
|
+
*/
|
|
2249
|
+
llm_websocket_url: string;
|
|
2250
|
+
/**
|
|
2251
|
+
* type of the Response Engine.
|
|
2252
|
+
*/
|
|
2253
|
+
type: 'custom-llm';
|
|
2254
|
+
}
|
|
2255
|
+
interface ResponseEngineConversationFlow {
|
|
2256
|
+
/**
|
|
2257
|
+
* ID of the Conversation Flow Response Engine.
|
|
2258
|
+
*/
|
|
2259
|
+
conversation_flow_id: string;
|
|
2260
|
+
/**
|
|
2261
|
+
* type of the Response Engine.
|
|
2262
|
+
*/
|
|
2263
|
+
type: 'conversation-flow';
|
|
2264
|
+
/**
|
|
2265
|
+
* Version of the Conversation Flow Response Engine.
|
|
2266
|
+
*/
|
|
2267
|
+
version?: number | null;
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* If this option is set, the agent prompt will include call screen handling
|
|
2271
|
+
* instructions for identity and call purpose questions. Set this to null to
|
|
2272
|
+
* disable call screen prompt instructions.
|
|
2273
|
+
*/
|
|
2274
|
+
interface CallScreeningOption {
|
|
2275
|
+
/**
|
|
2276
|
+
* Identity the agent should provide when a call screen asks who is calling.
|
|
2277
|
+
* Dynamic variables are supported.
|
|
2278
|
+
*/
|
|
2279
|
+
agent_identity: string;
|
|
2280
|
+
/**
|
|
2281
|
+
* Purpose the agent should provide when a call screen asks why it is calling.
|
|
2282
|
+
* Dynamic variables are supported.
|
|
2283
|
+
*/
|
|
2284
|
+
call_purpose: string;
|
|
2285
|
+
}
|
|
1261
2286
|
/**
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
2287
|
+
* Contact memory settings for phone calls and SMS chats. Creating an agent
|
|
2288
|
+
* defaults enable_update to false and enable_read to true. Updates only change the
|
|
2289
|
+
* supplied flags; omitted flags stay unchanged and an empty object has no effect.
|
|
2290
|
+
* Set a flag to false to disable it. The configuration cannot be cleared. Existing
|
|
2291
|
+
* agents without this configuration have both disabled.
|
|
1265
2292
|
*/
|
|
1266
|
-
|
|
2293
|
+
interface ContactMemoryConfig {
|
|
2294
|
+
/**
|
|
2295
|
+
* Automatically add saved contact memory to the agent prompt. Skippable nodes can
|
|
2296
|
+
* use answers from the current conversation even when this setting is disabled.
|
|
2297
|
+
* Contact dynamic variables, including contact_memory, remain available regardless
|
|
2298
|
+
* of this setting.
|
|
2299
|
+
*/
|
|
2300
|
+
enable_read?: boolean;
|
|
2301
|
+
/**
|
|
2302
|
+
* Rewrite the contact memory after each conversation. Requires storing
|
|
2303
|
+
* conversation data. Chat agents must also have end_chat_after_silence_ms set.
|
|
2304
|
+
*/
|
|
2305
|
+
enable_update?: boolean;
|
|
2306
|
+
}
|
|
1267
2307
|
/**
|
|
1268
|
-
*
|
|
1269
|
-
* more stable, and higher value means more variant speech generation. Check the
|
|
1270
|
-
* dashboard to see what provider supports this feature. If unset, default value 1
|
|
1271
|
-
* will apply.
|
|
2308
|
+
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
1272
2309
|
*/
|
|
1273
|
-
|
|
2310
|
+
interface CustomSttConfig {
|
|
2311
|
+
/**
|
|
2312
|
+
* Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram,
|
|
2313
|
+
* 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets
|
|
2314
|
+
* min_turn_silence (100-3000 ms). max_turn_silence adds half of this value,
|
|
2315
|
+
* rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap
|
|
2316
|
+
* of 3000 ms. Muse detects turn ends itself and ignores this value.
|
|
2317
|
+
*/
|
|
2318
|
+
endpointing_ms: number;
|
|
2319
|
+
/**
|
|
2320
|
+
* ASR provider name.
|
|
2321
|
+
*/
|
|
2322
|
+
provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse';
|
|
2323
|
+
}
|
|
1274
2324
|
/**
|
|
1275
|
-
*
|
|
1276
|
-
*
|
|
1277
|
-
* applied when the voicemail is detected. Set this to null to disable voicemail
|
|
1278
|
-
* detection.
|
|
2325
|
+
* Configuration for guardrail checks to detect and prevent prohibited topics in
|
|
2326
|
+
* agent output and user input.
|
|
1279
2327
|
*/
|
|
1280
|
-
|
|
2328
|
+
interface GuardrailConfig {
|
|
2329
|
+
/**
|
|
2330
|
+
* Selected prohibited user topic categories to check. When user messages contain
|
|
2331
|
+
* these topics, the agent will respond with a placeholder message instead of
|
|
2332
|
+
* processing the request.
|
|
2333
|
+
*/
|
|
2334
|
+
input_topics?: Array<'platform_integrity_jailbreaking'> | null;
|
|
2335
|
+
/**
|
|
2336
|
+
* Selected prohibited agent topic categories to check. When agent messages contain
|
|
2337
|
+
* these topics, they will be replaced with a placeholder message.
|
|
2338
|
+
*/
|
|
2339
|
+
output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null;
|
|
2340
|
+
}
|
|
1281
2341
|
/**
|
|
1282
|
-
*
|
|
1283
|
-
* value means quieter agent speech, while higher value means louder agent speech.
|
|
1284
|
-
* If unset, default value 1 will apply.
|
|
2342
|
+
* Toggle behavior presets on/off to influence agent response style and behaviors.
|
|
1285
2343
|
*/
|
|
1286
|
-
|
|
2344
|
+
interface HandbookConfig {
|
|
2345
|
+
/**
|
|
2346
|
+
* When asked, acknowledge being a virtual assistant.
|
|
2347
|
+
*/
|
|
2348
|
+
ai_disclosure?: boolean;
|
|
2349
|
+
/**
|
|
2350
|
+
* Enables Conversational Personality. When true, the agent uses the Conversational
|
|
2351
|
+
* Personality handbook preset, skips Professional Rep Personality during prompt
|
|
2352
|
+
* assembly, and enables internal colloquial rewrite behavior.
|
|
2353
|
+
*/
|
|
2354
|
+
conversational_personality?: boolean;
|
|
2355
|
+
/**
|
|
2356
|
+
* Professional call center rep baseline.
|
|
2357
|
+
*/
|
|
2358
|
+
default_personality?: boolean;
|
|
2359
|
+
/**
|
|
2360
|
+
* Repeat back and confirm important details (voice only).
|
|
2361
|
+
*/
|
|
2362
|
+
echo_verification?: boolean;
|
|
2363
|
+
/**
|
|
2364
|
+
* Warm acknowledgment of caller concerns.
|
|
2365
|
+
*/
|
|
2366
|
+
high_empathy?: boolean;
|
|
2367
|
+
/**
|
|
2368
|
+
* Spell using NATO phonetic alphabet style (voice only).
|
|
2369
|
+
*/
|
|
2370
|
+
nato_phonetic_alphabet?: boolean;
|
|
2371
|
+
/**
|
|
2372
|
+
* Sprinkle natural speech fillers like "um", "you know" for a more human,
|
|
2373
|
+
* conversational tone.
|
|
2374
|
+
*/
|
|
2375
|
+
natural_filler_words?: boolean;
|
|
2376
|
+
/**
|
|
2377
|
+
* Stay within prompt/context scope, don't invent details.
|
|
2378
|
+
*/
|
|
2379
|
+
scope_boundaries?: boolean;
|
|
2380
|
+
/**
|
|
2381
|
+
* Treat near-match similar words as same entity to reduce impact of transcription
|
|
2382
|
+
* error (voice only).
|
|
2383
|
+
*/
|
|
2384
|
+
smart_matching?: boolean;
|
|
2385
|
+
/**
|
|
2386
|
+
* Convert numbers/dates/currency to spoken forms (voice only).
|
|
2387
|
+
*/
|
|
2388
|
+
speech_normalization?: boolean;
|
|
2389
|
+
}
|
|
1287
2390
|
/**
|
|
1288
|
-
*
|
|
1289
|
-
*
|
|
2391
|
+
* If this option is set, the call will try to detect IVR in the first 3 minutes of
|
|
2392
|
+
* the call. Actions defined will be applied when the IVR is detected. Set this to
|
|
2393
|
+
* null to disable IVR detection.
|
|
1290
2394
|
*/
|
|
1291
|
-
|
|
2395
|
+
interface IvrOption {
|
|
2396
|
+
action: IvrOption.Action;
|
|
2397
|
+
/**
|
|
2398
|
+
* Optionally describe what should be treated as an IVR. Leave as null to use the
|
|
2399
|
+
* default definition.
|
|
2400
|
+
*/
|
|
2401
|
+
detection_prompt?: string | null;
|
|
2402
|
+
}
|
|
2403
|
+
namespace IvrOption {
|
|
2404
|
+
interface Action {
|
|
2405
|
+
type: 'hangup';
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
1292
2408
|
/**
|
|
1293
|
-
*
|
|
1294
|
-
* will apply.
|
|
2409
|
+
* Configuration for PII scrubbing from transcripts and recordings.
|
|
1295
2410
|
*/
|
|
1296
|
-
|
|
2411
|
+
interface PiiConfig {
|
|
2412
|
+
/**
|
|
2413
|
+
* List of PII categories to scrub from transcripts and recordings. PII redaction
|
|
2414
|
+
* is only active when this list is non-empty; an empty array means no PII
|
|
2415
|
+
* scrubbing is performed.
|
|
2416
|
+
*/
|
|
2417
|
+
categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>;
|
|
2418
|
+
/**
|
|
2419
|
+
* The processing mode for PII scrubbing. Currently only post-call is supported.
|
|
2420
|
+
*/
|
|
2421
|
+
mode: 'post_call';
|
|
2422
|
+
}
|
|
2423
|
+
interface StringAnalysisData {
|
|
2424
|
+
/**
|
|
2425
|
+
* Description of the variable.
|
|
2426
|
+
*/
|
|
2427
|
+
description: string;
|
|
2428
|
+
/**
|
|
2429
|
+
* Name of the variable.
|
|
2430
|
+
*/
|
|
2431
|
+
name: string;
|
|
2432
|
+
/**
|
|
2433
|
+
* Type of the variable to extract.
|
|
2434
|
+
*/
|
|
2435
|
+
type: 'string';
|
|
2436
|
+
/**
|
|
2437
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
2438
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
2439
|
+
* this is ignored.
|
|
2440
|
+
*/
|
|
2441
|
+
conditional_prompt?: string;
|
|
2442
|
+
/**
|
|
2443
|
+
* Examples of the variable value to teach model the style and syntax.
|
|
2444
|
+
*/
|
|
2445
|
+
examples?: Array<string>;
|
|
2446
|
+
/**
|
|
2447
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
2448
|
+
* will be marked as unsuccessful.
|
|
2449
|
+
*/
|
|
2450
|
+
required?: boolean;
|
|
2451
|
+
}
|
|
2452
|
+
interface EnumAnalysisData {
|
|
2453
|
+
/**
|
|
2454
|
+
* The possible values of the variable, must be non empty array.
|
|
2455
|
+
*/
|
|
2456
|
+
choices: Array<string>;
|
|
2457
|
+
/**
|
|
2458
|
+
* Description of the variable.
|
|
2459
|
+
*/
|
|
2460
|
+
description: string;
|
|
2461
|
+
/**
|
|
2462
|
+
* Name of the variable.
|
|
2463
|
+
*/
|
|
2464
|
+
name: string;
|
|
2465
|
+
/**
|
|
2466
|
+
* Type of the variable to extract.
|
|
2467
|
+
*/
|
|
2468
|
+
type: 'enum';
|
|
2469
|
+
/**
|
|
2470
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
2471
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
2472
|
+
* this is ignored.
|
|
2473
|
+
*/
|
|
2474
|
+
conditional_prompt?: string;
|
|
2475
|
+
/**
|
|
2476
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
2477
|
+
* will be marked as unsuccessful.
|
|
2478
|
+
*/
|
|
2479
|
+
required?: boolean;
|
|
2480
|
+
}
|
|
2481
|
+
interface BooleanAnalysisData {
|
|
2482
|
+
/**
|
|
2483
|
+
* Description of the variable.
|
|
2484
|
+
*/
|
|
2485
|
+
description: string;
|
|
2486
|
+
/**
|
|
2487
|
+
* Name of the variable.
|
|
2488
|
+
*/
|
|
2489
|
+
name: string;
|
|
2490
|
+
/**
|
|
2491
|
+
* Type of the variable to extract.
|
|
2492
|
+
*/
|
|
2493
|
+
type: 'boolean';
|
|
2494
|
+
/**
|
|
2495
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
2496
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
2497
|
+
* this is ignored.
|
|
2498
|
+
*/
|
|
2499
|
+
conditional_prompt?: string;
|
|
2500
|
+
/**
|
|
2501
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
2502
|
+
* will be marked as unsuccessful.
|
|
2503
|
+
*/
|
|
2504
|
+
required?: boolean;
|
|
2505
|
+
}
|
|
2506
|
+
interface NumberAnalysisData {
|
|
2507
|
+
/**
|
|
2508
|
+
* Description of the variable.
|
|
2509
|
+
*/
|
|
2510
|
+
description: string;
|
|
2511
|
+
/**
|
|
2512
|
+
* Name of the variable.
|
|
2513
|
+
*/
|
|
2514
|
+
name: string;
|
|
2515
|
+
/**
|
|
2516
|
+
* Type of the variable to extract.
|
|
2517
|
+
*/
|
|
2518
|
+
type: 'number';
|
|
2519
|
+
/**
|
|
2520
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
2521
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
2522
|
+
* this is ignored.
|
|
2523
|
+
*/
|
|
2524
|
+
conditional_prompt?: string;
|
|
2525
|
+
/**
|
|
2526
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
2527
|
+
* will be marked as unsuccessful.
|
|
2528
|
+
*/
|
|
2529
|
+
required?: boolean;
|
|
2530
|
+
}
|
|
1297
2531
|
/**
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
1300
|
-
* agent to the specified url, and will ignore the account level webhook for this
|
|
1301
|
-
* agent. Set to `null` to remove webhook url from this agent.
|
|
2532
|
+
* System preset for post-call analysis (voice agents). Use in
|
|
2533
|
+
* post_call_analysis_data to override prompts or mark fields optional.
|
|
1302
2534
|
*/
|
|
1303
|
-
|
|
1304
|
-
}
|
|
1305
|
-
export declare namespace AgentCreateParams {
|
|
1306
|
-
interface ResponseEngineRetellLm {
|
|
2535
|
+
interface CallPresetAnalysisData {
|
|
1307
2536
|
/**
|
|
1308
|
-
*
|
|
2537
|
+
* Preset identifier for voice agent analysis.
|
|
1309
2538
|
*/
|
|
1310
|
-
|
|
2539
|
+
name: 'call_summary' | 'call_successful' | 'user_sentiment';
|
|
1311
2540
|
/**
|
|
1312
|
-
*
|
|
2541
|
+
* Identifies this item as a system preset.
|
|
1313
2542
|
*/
|
|
1314
|
-
type: '
|
|
2543
|
+
type: 'system-presets';
|
|
1315
2544
|
/**
|
|
1316
|
-
*
|
|
2545
|
+
* Optional instruction to help decide whether this field needs to be populated. If
|
|
2546
|
+
* not set, the field is always included.
|
|
1317
2547
|
*/
|
|
1318
|
-
|
|
1319
|
-
}
|
|
1320
|
-
interface ResponseEngineCustomLm {
|
|
2548
|
+
conditional_prompt?: string;
|
|
1321
2549
|
/**
|
|
1322
|
-
*
|
|
2550
|
+
* Prompt or description for this preset.
|
|
1323
2551
|
*/
|
|
1324
|
-
|
|
2552
|
+
description?: string;
|
|
1325
2553
|
/**
|
|
1326
|
-
*
|
|
2554
|
+
* If false, this field is optional in the analysis. If true or unset, the field is
|
|
2555
|
+
* required.
|
|
1327
2556
|
*/
|
|
1328
|
-
|
|
2557
|
+
required?: boolean;
|
|
1329
2558
|
}
|
|
1330
|
-
interface
|
|
2559
|
+
interface AppTool {
|
|
1331
2560
|
/**
|
|
1332
|
-
*
|
|
2561
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
2562
|
+
* organization whose provider matches this tool's provider.
|
|
1333
2563
|
*/
|
|
1334
|
-
|
|
2564
|
+
app_id: string;
|
|
1335
2565
|
/**
|
|
1336
|
-
*
|
|
2566
|
+
* Name of the catalog template within the provider, as listed by
|
|
2567
|
+
* list-app-templates.
|
|
1337
2568
|
*/
|
|
1338
|
-
|
|
2569
|
+
app_tool_template_name: string;
|
|
1339
2570
|
/**
|
|
1340
|
-
*
|
|
2571
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
2572
|
+
* depends_on.
|
|
1341
2573
|
*/
|
|
1342
|
-
|
|
2574
|
+
name: string;
|
|
2575
|
+
/**
|
|
2576
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
2577
|
+
* providers are listed by list-app-templates.
|
|
2578
|
+
*/
|
|
2579
|
+
provider: string;
|
|
2580
|
+
type: 'integration_app';
|
|
2581
|
+
/**
|
|
2582
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2583
|
+
* running.
|
|
2584
|
+
*/
|
|
2585
|
+
condition?: AppTool.Condition;
|
|
2586
|
+
/**
|
|
2587
|
+
* Names of tools that must run before this one.
|
|
2588
|
+
*/
|
|
2589
|
+
depends_on?: Array<string>;
|
|
2590
|
+
/**
|
|
2591
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2592
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
2593
|
+
*/
|
|
2594
|
+
description?: string;
|
|
2595
|
+
/**
|
|
2596
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2597
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
2598
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
2599
|
+
* prevent silence on the call.
|
|
2600
|
+
*/
|
|
2601
|
+
enable_typing_sound?: boolean;
|
|
2602
|
+
/**
|
|
2603
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2604
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
2605
|
+
* applicable when speak_during_execution is true.
|
|
2606
|
+
*/
|
|
2607
|
+
execution_message_description?: string;
|
|
2608
|
+
/**
|
|
2609
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2610
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
2611
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
2612
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
2613
|
+
* to "prompt".
|
|
2614
|
+
*/
|
|
2615
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
2616
|
+
/**
|
|
2617
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
2618
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
2619
|
+
* from the raw response.
|
|
2620
|
+
*/
|
|
2621
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
2622
|
+
/**
|
|
2623
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
2624
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
2625
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
2626
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
2627
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
2628
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
2629
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
2630
|
+
* Each parameter's required list must match the schema returned by the
|
|
2631
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
2632
|
+
*/
|
|
2633
|
+
parameters?: Array<AppTool.Parameter>;
|
|
2634
|
+
/**
|
|
2635
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
2636
|
+
* populated from. Missing paths are ignored.
|
|
2637
|
+
*/
|
|
2638
|
+
response_variables?: {
|
|
2639
|
+
[key: string]: string;
|
|
2640
|
+
};
|
|
2641
|
+
/**
|
|
2642
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2643
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
2644
|
+
* when the result of the tool is obtained.
|
|
2645
|
+
*/
|
|
2646
|
+
speak_after_execution?: boolean;
|
|
2647
|
+
/**
|
|
2648
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
2649
|
+
* conversation. If true, will speak during execution.
|
|
2650
|
+
*/
|
|
2651
|
+
speak_during_execution?: boolean;
|
|
1343
2652
|
}
|
|
1344
|
-
|
|
1345
|
-
* If this option is set, the agent prompt will include call screen handling
|
|
1346
|
-
* instructions for identity and call purpose questions. Set this to null to
|
|
1347
|
-
* disable call screen prompt instructions.
|
|
1348
|
-
*/
|
|
1349
|
-
interface CallScreeningOption {
|
|
2653
|
+
namespace AppTool {
|
|
1350
2654
|
/**
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
2655
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2656
|
+
* running.
|
|
1353
2657
|
*/
|
|
1354
|
-
|
|
2658
|
+
interface Condition {
|
|
2659
|
+
equations: Array<Condition.Equation>;
|
|
2660
|
+
operator: '||' | '&&';
|
|
2661
|
+
type: 'equation';
|
|
2662
|
+
}
|
|
2663
|
+
namespace Condition {
|
|
2664
|
+
interface Equation {
|
|
2665
|
+
/**
|
|
2666
|
+
* Left side of the equation
|
|
2667
|
+
*/
|
|
2668
|
+
left: string;
|
|
2669
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
2670
|
+
/**
|
|
2671
|
+
* Right side of the equation. The right side of the equation not required when
|
|
2672
|
+
* "exists" or "not_exist" are selected.
|
|
2673
|
+
*/
|
|
2674
|
+
right?: string;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
interface UnionMember0 {
|
|
2678
|
+
mode: 'all';
|
|
2679
|
+
/**
|
|
2680
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
2681
|
+
*/
|
|
2682
|
+
fields?: Array<string>;
|
|
2683
|
+
}
|
|
2684
|
+
interface UnionMember1 {
|
|
2685
|
+
/**
|
|
2686
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
2687
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
2688
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
2689
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
2690
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
2691
|
+
* that match nothing contribute nothing.
|
|
2692
|
+
*/
|
|
2693
|
+
fields: Array<string>;
|
|
2694
|
+
mode: 'subset';
|
|
2695
|
+
}
|
|
1355
2696
|
/**
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
2697
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
2698
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
2699
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
2700
|
+
* empty parameter list.
|
|
1358
2701
|
*/
|
|
1359
|
-
|
|
2702
|
+
interface Parameter {
|
|
2703
|
+
/**
|
|
2704
|
+
* The value of properties is an object, where each key is the name of a property
|
|
2705
|
+
* and each value is a schema used to validate that property.
|
|
2706
|
+
*/
|
|
2707
|
+
properties: unknown;
|
|
2708
|
+
/**
|
|
2709
|
+
* Type must be "object" for a JSON Schema object.
|
|
2710
|
+
*/
|
|
2711
|
+
type: 'object';
|
|
2712
|
+
/**
|
|
2713
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
2714
|
+
* its best to generate the required properties in its function arguments. Property
|
|
2715
|
+
* must exist in properties.
|
|
2716
|
+
*/
|
|
2717
|
+
required?: Array<string>;
|
|
2718
|
+
}
|
|
1360
2719
|
}
|
|
1361
|
-
|
|
1362
|
-
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
1363
|
-
*/
|
|
1364
|
-
interface CustomSttConfig {
|
|
2720
|
+
interface CustomTool {
|
|
1365
2721
|
/**
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
2722
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
2723
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
2724
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
2725
|
+
* allowed).
|
|
1370
2726
|
*/
|
|
1371
|
-
|
|
2727
|
+
name: string;
|
|
2728
|
+
type: 'custom';
|
|
1372
2729
|
/**
|
|
1373
|
-
*
|
|
2730
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
2731
|
+
* to call the tool.
|
|
2732
|
+
*/
|
|
2733
|
+
url: string;
|
|
2734
|
+
/**
|
|
2735
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
2736
|
+
* of nested under "args".
|
|
2737
|
+
*/
|
|
2738
|
+
args_at_root?: boolean;
|
|
2739
|
+
/**
|
|
2740
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2741
|
+
* running.
|
|
2742
|
+
*/
|
|
2743
|
+
condition?: CustomTool.Condition;
|
|
2744
|
+
/**
|
|
2745
|
+
* Names of tools that must run before this one.
|
|
2746
|
+
*/
|
|
2747
|
+
depends_on?: Array<string>;
|
|
2748
|
+
/**
|
|
2749
|
+
* Describes what this tool does and when to call this tool.
|
|
2750
|
+
*/
|
|
2751
|
+
description?: string;
|
|
2752
|
+
/**
|
|
2753
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
2754
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
2755
|
+
* silence on the call.
|
|
2756
|
+
*/
|
|
2757
|
+
enable_typing_sound?: boolean;
|
|
2758
|
+
/**
|
|
2759
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
2760
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
2761
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
2762
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
2763
|
+
*/
|
|
2764
|
+
execution_message_description?: string;
|
|
2765
|
+
/**
|
|
2766
|
+
* Type of execution message. "prompt" means the agent will use
|
|
2767
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
2768
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
2769
|
+
* to "prompt".
|
|
2770
|
+
*/
|
|
2771
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
2772
|
+
/**
|
|
2773
|
+
* Headers to add to the request.
|
|
2774
|
+
*/
|
|
2775
|
+
headers?: {
|
|
2776
|
+
[key: string]: string;
|
|
2777
|
+
};
|
|
2778
|
+
/**
|
|
2779
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
2780
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
2781
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
2782
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
2783
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
2784
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
2785
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
2786
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
2787
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
2788
|
+
* than once. Defaults to 0 (no retry).
|
|
2789
|
+
*/
|
|
2790
|
+
max_retry?: number;
|
|
2791
|
+
/**
|
|
2792
|
+
* Method to use for the request, default to POST.
|
|
2793
|
+
*/
|
|
2794
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2795
|
+
/**
|
|
2796
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
2797
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
2798
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
2799
|
+
* is encoded (see `args_at_root`).
|
|
2800
|
+
*/
|
|
2801
|
+
parameter_type?: 'json' | 'form';
|
|
2802
|
+
/**
|
|
2803
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
2804
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
2805
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
2806
|
+
* empty parameter list.
|
|
2807
|
+
*/
|
|
2808
|
+
parameters?: CustomTool.Parameters;
|
|
2809
|
+
/**
|
|
2810
|
+
* Query parameters to append to the request URL.
|
|
2811
|
+
*/
|
|
2812
|
+
query_params?: {
|
|
2813
|
+
[key: string]: string;
|
|
2814
|
+
};
|
|
2815
|
+
/**
|
|
2816
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
2817
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
2818
|
+
* use.
|
|
2819
|
+
*/
|
|
2820
|
+
response_variables?: {
|
|
2821
|
+
[key: string]: string;
|
|
2822
|
+
};
|
|
2823
|
+
/**
|
|
2824
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
2825
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
2826
|
+
* get update for the function call.
|
|
1374
2827
|
*/
|
|
1375
|
-
|
|
2828
|
+
speak_after_execution?: boolean;
|
|
2829
|
+
/**
|
|
2830
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
2831
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
2832
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
2833
|
+
* responsive.
|
|
2834
|
+
*/
|
|
2835
|
+
speak_during_execution?: boolean;
|
|
2836
|
+
/**
|
|
2837
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
2838
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
2839
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
2840
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
2841
|
+
*/
|
|
2842
|
+
timeout_ms?: number;
|
|
1376
2843
|
}
|
|
1377
|
-
|
|
1378
|
-
* Configuration for guardrail checks to detect and prevent prohibited topics in
|
|
1379
|
-
* agent output and user input.
|
|
1380
|
-
*/
|
|
1381
|
-
interface GuardrailConfig {
|
|
2844
|
+
namespace CustomTool {
|
|
1382
2845
|
/**
|
|
1383
|
-
*
|
|
1384
|
-
*
|
|
1385
|
-
* processing the request.
|
|
2846
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2847
|
+
* running.
|
|
1386
2848
|
*/
|
|
1387
|
-
|
|
2849
|
+
interface Condition {
|
|
2850
|
+
equations: Array<Condition.Equation>;
|
|
2851
|
+
operator: '||' | '&&';
|
|
2852
|
+
type: 'equation';
|
|
2853
|
+
}
|
|
2854
|
+
namespace Condition {
|
|
2855
|
+
interface Equation {
|
|
2856
|
+
/**
|
|
2857
|
+
* Left side of the equation
|
|
2858
|
+
*/
|
|
2859
|
+
left: string;
|
|
2860
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
2861
|
+
/**
|
|
2862
|
+
* Right side of the equation. The right side of the equation not required when
|
|
2863
|
+
* "exists" or "not_exist" are selected.
|
|
2864
|
+
*/
|
|
2865
|
+
right?: string;
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
1388
2868
|
/**
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
2869
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
2870
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
2871
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
2872
|
+
* empty parameter list.
|
|
1391
2873
|
*/
|
|
1392
|
-
|
|
2874
|
+
interface Parameters {
|
|
2875
|
+
/**
|
|
2876
|
+
* The value of properties is an object, where each key is the name of a property
|
|
2877
|
+
* and each value is a schema used to validate that property.
|
|
2878
|
+
*/
|
|
2879
|
+
properties: unknown;
|
|
2880
|
+
/**
|
|
2881
|
+
* Type must be "object" for a JSON Schema object.
|
|
2882
|
+
*/
|
|
2883
|
+
type: 'object';
|
|
2884
|
+
/**
|
|
2885
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
2886
|
+
* its best to generate the required properties in its function arguments. Property
|
|
2887
|
+
* must exist in properties.
|
|
2888
|
+
*/
|
|
2889
|
+
required?: Array<string>;
|
|
2890
|
+
}
|
|
1393
2891
|
}
|
|
1394
|
-
|
|
1395
|
-
* Toggle behavior presets on/off to influence agent response style and behaviors.
|
|
1396
|
-
*/
|
|
1397
|
-
interface HandbookConfig {
|
|
2892
|
+
interface CodeTool {
|
|
1398
2893
|
/**
|
|
1399
|
-
*
|
|
2894
|
+
* JavaScript code to execute in the sandbox.
|
|
1400
2895
|
*/
|
|
1401
|
-
|
|
2896
|
+
code: string;
|
|
1402
2897
|
/**
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
2898
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
2899
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
2900
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
2901
|
+
* allowed).
|
|
1406
2902
|
*/
|
|
1407
|
-
|
|
2903
|
+
name: string;
|
|
2904
|
+
type: 'code';
|
|
1408
2905
|
/**
|
|
1409
|
-
*
|
|
2906
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2907
|
+
* running.
|
|
1410
2908
|
*/
|
|
1411
|
-
|
|
2909
|
+
condition?: CodeTool.Condition;
|
|
1412
2910
|
/**
|
|
1413
|
-
*
|
|
2911
|
+
* Names of tools that must run before this one.
|
|
1414
2912
|
*/
|
|
1415
|
-
|
|
2913
|
+
depends_on?: Array<string>;
|
|
1416
2914
|
/**
|
|
1417
|
-
*
|
|
2915
|
+
* Describes what this tool does and when to call this tool.
|
|
1418
2916
|
*/
|
|
1419
|
-
|
|
2917
|
+
description?: string;
|
|
1420
2918
|
/**
|
|
1421
|
-
*
|
|
2919
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
2920
|
+
* executing.
|
|
1422
2921
|
*/
|
|
1423
|
-
|
|
2922
|
+
enable_typing_sound?: boolean;
|
|
1424
2923
|
/**
|
|
1425
|
-
*
|
|
1426
|
-
*
|
|
2924
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
2925
|
+
* when speak_during_execution is true.
|
|
1427
2926
|
*/
|
|
1428
|
-
|
|
2927
|
+
execution_message_description?: string;
|
|
1429
2928
|
/**
|
|
1430
|
-
*
|
|
2929
|
+
* Type of execution message. "prompt" means the agent will use
|
|
2930
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
2931
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
2932
|
+
* to "prompt".
|
|
1431
2933
|
*/
|
|
1432
|
-
|
|
2934
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1433
2935
|
/**
|
|
1434
|
-
*
|
|
1435
|
-
*
|
|
2936
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
2937
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
1436
2938
|
*/
|
|
1437
|
-
|
|
2939
|
+
response_variables?: {
|
|
2940
|
+
[key: string]: string;
|
|
2941
|
+
};
|
|
1438
2942
|
/**
|
|
1439
|
-
*
|
|
2943
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
2944
|
+
* result of function is obtained.
|
|
1440
2945
|
*/
|
|
1441
|
-
|
|
2946
|
+
speak_after_execution?: boolean;
|
|
2947
|
+
/**
|
|
2948
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
2949
|
+
* that." when executing the tool.
|
|
2950
|
+
*/
|
|
2951
|
+
speak_during_execution?: boolean;
|
|
2952
|
+
/**
|
|
2953
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
2954
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
2955
|
+
*/
|
|
2956
|
+
timeout_ms?: number;
|
|
1442
2957
|
}
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
2958
|
+
namespace CodeTool {
|
|
2959
|
+
/**
|
|
2960
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2961
|
+
* running.
|
|
2962
|
+
*/
|
|
2963
|
+
interface Condition {
|
|
2964
|
+
equations: Array<Condition.Equation>;
|
|
2965
|
+
operator: '||' | '&&';
|
|
2966
|
+
type: 'equation';
|
|
2967
|
+
}
|
|
2968
|
+
namespace Condition {
|
|
2969
|
+
interface Equation {
|
|
2970
|
+
/**
|
|
2971
|
+
* Left side of the equation
|
|
2972
|
+
*/
|
|
2973
|
+
left: string;
|
|
2974
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
2975
|
+
/**
|
|
2976
|
+
* Right side of the equation. The right side of the equation not required when
|
|
2977
|
+
* "exists" or "not_exist" are selected.
|
|
2978
|
+
*/
|
|
2979
|
+
right?: string;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
interface SendSMSTool {
|
|
2984
|
+
/**
|
|
2985
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
2986
|
+
* time (general tools + state tools + state edges).
|
|
2987
|
+
*/
|
|
2988
|
+
name: string;
|
|
2989
|
+
sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
|
|
2990
|
+
type: 'send_sms';
|
|
2991
|
+
/**
|
|
2992
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
2993
|
+
* running.
|
|
2994
|
+
*/
|
|
2995
|
+
condition?: SendSMSTool.Condition;
|
|
2996
|
+
/**
|
|
2997
|
+
* Names of tools that must run before this one.
|
|
2998
|
+
*/
|
|
2999
|
+
depends_on?: Array<string>;
|
|
3000
|
+
/**
|
|
3001
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
3002
|
+
* to call the tool.
|
|
3003
|
+
*/
|
|
3004
|
+
description?: string;
|
|
3005
|
+
/**
|
|
3006
|
+
* Describes what to say before sending the SMS. Only applicable when
|
|
3007
|
+
* speak_during_execution is true.
|
|
3008
|
+
*/
|
|
3009
|
+
execution_message_description?: string;
|
|
3010
|
+
/**
|
|
3011
|
+
* Type of execution message. "prompt" means the agent will use
|
|
3012
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
3013
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
3014
|
+
* to "prompt".
|
|
3015
|
+
*/
|
|
3016
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
3017
|
+
/**
|
|
3018
|
+
* If true, the agent will speak a short line before sending the SMS. If omitted,
|
|
3019
|
+
* defaults to true (same as end_call / transfer_call tools).
|
|
3020
|
+
*/
|
|
3021
|
+
speak_during_execution?: boolean;
|
|
3022
|
+
}
|
|
3023
|
+
namespace SendSMSTool {
|
|
3024
|
+
interface SMSContentPredefined {
|
|
3025
|
+
/**
|
|
3026
|
+
* The static message to be sent in the SMS. Can contain dynamic variables.
|
|
3027
|
+
*/
|
|
3028
|
+
text?: string;
|
|
3029
|
+
type?: 'predefined';
|
|
3030
|
+
}
|
|
3031
|
+
interface SMSContentInferred {
|
|
3032
|
+
/**
|
|
3033
|
+
* The prompt to be used to help infer the SMS content. The model will take the
|
|
3034
|
+
* global prompt, the call transcript, and this prompt together to deduce the right
|
|
3035
|
+
* message to send. Can contain dynamic variables.
|
|
3036
|
+
*/
|
|
3037
|
+
prompt?: string;
|
|
3038
|
+
type?: 'inferred';
|
|
3039
|
+
}
|
|
3040
|
+
interface SMSContentTemplate {
|
|
3041
|
+
/**
|
|
3042
|
+
* The template to use for the SMS content. "info_collection" sends a predefined
|
|
3043
|
+
* message requesting information from the user.
|
|
3044
|
+
*/
|
|
3045
|
+
template: 'info_collection';
|
|
3046
|
+
type: 'template';
|
|
3047
|
+
}
|
|
3048
|
+
/**
|
|
3049
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
3050
|
+
* running.
|
|
3051
|
+
*/
|
|
3052
|
+
interface Condition {
|
|
3053
|
+
equations: Array<Condition.Equation>;
|
|
3054
|
+
operator: '||' | '&&';
|
|
3055
|
+
type: 'equation';
|
|
3056
|
+
}
|
|
3057
|
+
namespace Condition {
|
|
3058
|
+
interface Equation {
|
|
3059
|
+
/**
|
|
3060
|
+
* Left side of the equation
|
|
3061
|
+
*/
|
|
3062
|
+
left: string;
|
|
3063
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
3064
|
+
/**
|
|
3065
|
+
* Right side of the equation. The right side of the equation not required when
|
|
3066
|
+
* "exists" or "not_exist" are selected.
|
|
3067
|
+
*/
|
|
3068
|
+
right?: string;
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
interface AppTool {
|
|
3073
|
+
/**
|
|
3074
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
3075
|
+
* organization whose provider matches this tool's provider.
|
|
3076
|
+
*/
|
|
3077
|
+
app_id: string;
|
|
3078
|
+
/**
|
|
3079
|
+
* Name of the catalog template within the provider, as listed by
|
|
3080
|
+
* list-app-templates.
|
|
3081
|
+
*/
|
|
3082
|
+
app_tool_template_name: string;
|
|
3083
|
+
/**
|
|
3084
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
3085
|
+
* depends_on.
|
|
3086
|
+
*/
|
|
3087
|
+
name: string;
|
|
3088
|
+
/**
|
|
3089
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
3090
|
+
* providers are listed by list-app-templates.
|
|
3091
|
+
*/
|
|
3092
|
+
provider: string;
|
|
3093
|
+
type: 'integration_app';
|
|
3094
|
+
/**
|
|
3095
|
+
* Names of tools that must run before this one.
|
|
3096
|
+
*/
|
|
3097
|
+
depends_on?: Array<string>;
|
|
3098
|
+
/**
|
|
3099
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3100
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
3101
|
+
*/
|
|
3102
|
+
description?: string;
|
|
3103
|
+
/**
|
|
3104
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3105
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
3106
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
3107
|
+
* prevent silence on the call.
|
|
3108
|
+
*/
|
|
3109
|
+
enable_typing_sound?: boolean;
|
|
3110
|
+
/**
|
|
3111
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3112
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
3113
|
+
* applicable when speak_during_execution is true.
|
|
3114
|
+
*/
|
|
3115
|
+
execution_message_description?: string;
|
|
3116
|
+
/**
|
|
3117
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3118
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
3119
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
3120
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
3121
|
+
* to "prompt".
|
|
3122
|
+
*/
|
|
3123
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
3124
|
+
/**
|
|
3125
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
3126
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
3127
|
+
* from the raw response.
|
|
3128
|
+
*/
|
|
3129
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
3130
|
+
/**
|
|
3131
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
3132
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
3133
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
3134
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
3135
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
3136
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
3137
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
3138
|
+
* Each parameter's required list must match the schema returned by the
|
|
3139
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
3140
|
+
*/
|
|
3141
|
+
parameters?: Array<AppTool.Parameter>;
|
|
1450
3142
|
/**
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
3143
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
3144
|
+
* populated from. Missing paths are ignored.
|
|
1453
3145
|
*/
|
|
1454
|
-
|
|
3146
|
+
response_variables?: {
|
|
3147
|
+
[key: string]: string;
|
|
3148
|
+
};
|
|
3149
|
+
/**
|
|
3150
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3151
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
3152
|
+
* when the result of the tool is obtained.
|
|
3153
|
+
*/
|
|
3154
|
+
speak_after_execution?: boolean;
|
|
3155
|
+
/**
|
|
3156
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
3157
|
+
* conversation. If true, will speak during execution.
|
|
3158
|
+
*/
|
|
3159
|
+
speak_during_execution?: boolean;
|
|
1455
3160
|
}
|
|
1456
|
-
namespace
|
|
1457
|
-
interface
|
|
1458
|
-
|
|
3161
|
+
namespace AppTool {
|
|
3162
|
+
interface UnionMember0 {
|
|
3163
|
+
mode: 'all';
|
|
3164
|
+
/**
|
|
3165
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
3166
|
+
*/
|
|
3167
|
+
fields?: Array<string>;
|
|
3168
|
+
}
|
|
3169
|
+
interface UnionMember1 {
|
|
3170
|
+
/**
|
|
3171
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
3172
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
3173
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
3174
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
3175
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
3176
|
+
* that match nothing contribute nothing.
|
|
3177
|
+
*/
|
|
3178
|
+
fields: Array<string>;
|
|
3179
|
+
mode: 'subset';
|
|
3180
|
+
}
|
|
3181
|
+
/**
|
|
3182
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
3183
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
3184
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
3185
|
+
* empty parameter list.
|
|
3186
|
+
*/
|
|
3187
|
+
interface Parameter {
|
|
3188
|
+
/**
|
|
3189
|
+
* The value of properties is an object, where each key is the name of a property
|
|
3190
|
+
* and each value is a schema used to validate that property.
|
|
3191
|
+
*/
|
|
3192
|
+
properties: unknown;
|
|
3193
|
+
/**
|
|
3194
|
+
* Type must be "object" for a JSON Schema object.
|
|
3195
|
+
*/
|
|
3196
|
+
type: 'object';
|
|
3197
|
+
/**
|
|
3198
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
3199
|
+
* its best to generate the required properties in its function arguments. Property
|
|
3200
|
+
* must exist in properties.
|
|
3201
|
+
*/
|
|
3202
|
+
required?: Array<string>;
|
|
1459
3203
|
}
|
|
1460
3204
|
}
|
|
1461
|
-
|
|
1462
|
-
* Configuration for PII scrubbing from transcripts and recordings.
|
|
1463
|
-
*/
|
|
1464
|
-
interface PiiConfig {
|
|
3205
|
+
interface CustomTool {
|
|
1465
3206
|
/**
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1468
|
-
*
|
|
3207
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
3208
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
3209
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
3210
|
+
* allowed).
|
|
1469
3211
|
*/
|
|
1470
|
-
|
|
3212
|
+
name: string;
|
|
3213
|
+
type: 'custom';
|
|
1471
3214
|
/**
|
|
1472
|
-
*
|
|
3215
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
3216
|
+
* to call the tool.
|
|
1473
3217
|
*/
|
|
1474
|
-
|
|
1475
|
-
}
|
|
1476
|
-
interface StringAnalysisData {
|
|
3218
|
+
url: string;
|
|
1477
3219
|
/**
|
|
1478
|
-
*
|
|
3220
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
3221
|
+
* of nested under "args".
|
|
1479
3222
|
*/
|
|
1480
|
-
|
|
3223
|
+
args_at_root?: boolean;
|
|
1481
3224
|
/**
|
|
1482
|
-
*
|
|
3225
|
+
* Names of tools that must run before this one.
|
|
1483
3226
|
*/
|
|
1484
|
-
|
|
3227
|
+
depends_on?: Array<string>;
|
|
1485
3228
|
/**
|
|
1486
|
-
*
|
|
3229
|
+
* Describes what this tool does and when to call this tool.
|
|
1487
3230
|
*/
|
|
1488
|
-
|
|
3231
|
+
description?: string;
|
|
1489
3232
|
/**
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
1492
|
-
*
|
|
3233
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
3234
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
3235
|
+
* silence on the call.
|
|
1493
3236
|
*/
|
|
1494
|
-
|
|
3237
|
+
enable_typing_sound?: boolean;
|
|
1495
3238
|
/**
|
|
1496
|
-
*
|
|
3239
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
3240
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
3241
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
3242
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
1497
3243
|
*/
|
|
1498
|
-
|
|
3244
|
+
execution_message_description?: string;
|
|
1499
3245
|
/**
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
3246
|
+
* Type of execution message. "prompt" means the agent will use
|
|
3247
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
3248
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
3249
|
+
* to "prompt".
|
|
1502
3250
|
*/
|
|
1503
|
-
|
|
1504
|
-
}
|
|
1505
|
-
interface EnumAnalysisData {
|
|
3251
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1506
3252
|
/**
|
|
1507
|
-
*
|
|
3253
|
+
* Headers to add to the request.
|
|
1508
3254
|
*/
|
|
1509
|
-
|
|
3255
|
+
headers?: {
|
|
3256
|
+
[key: string]: string;
|
|
3257
|
+
};
|
|
1510
3258
|
/**
|
|
1511
|
-
*
|
|
3259
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
3260
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
3261
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
3262
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
3263
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
3264
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
3265
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
3266
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
3267
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
3268
|
+
* than once. Defaults to 0 (no retry).
|
|
1512
3269
|
*/
|
|
1513
|
-
|
|
3270
|
+
max_retry?: number;
|
|
1514
3271
|
/**
|
|
1515
|
-
*
|
|
3272
|
+
* Method to use for the request, default to POST.
|
|
1516
3273
|
*/
|
|
1517
|
-
|
|
3274
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1518
3275
|
/**
|
|
1519
|
-
*
|
|
3276
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
3277
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
3278
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
3279
|
+
* is encoded (see `args_at_root`).
|
|
1520
3280
|
*/
|
|
1521
|
-
|
|
3281
|
+
parameter_type?: 'json' | 'form';
|
|
1522
3282
|
/**
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
3283
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
3284
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
3285
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
3286
|
+
* empty parameter list.
|
|
1526
3287
|
*/
|
|
1527
|
-
|
|
3288
|
+
parameters?: CustomTool.Parameters;
|
|
1528
3289
|
/**
|
|
1529
|
-
*
|
|
1530
|
-
* will be marked as unsuccessful.
|
|
3290
|
+
* Query parameters to append to the request URL.
|
|
1531
3291
|
*/
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
3292
|
+
query_params?: {
|
|
3293
|
+
[key: string]: string;
|
|
3294
|
+
};
|
|
1535
3295
|
/**
|
|
1536
|
-
*
|
|
3296
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
3297
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
3298
|
+
* use.
|
|
1537
3299
|
*/
|
|
1538
|
-
|
|
3300
|
+
response_variables?: {
|
|
3301
|
+
[key: string]: string;
|
|
3302
|
+
};
|
|
1539
3303
|
/**
|
|
1540
|
-
*
|
|
3304
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
3305
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
3306
|
+
* get update for the function call.
|
|
1541
3307
|
*/
|
|
1542
|
-
|
|
3308
|
+
speak_after_execution?: boolean;
|
|
1543
3309
|
/**
|
|
1544
|
-
*
|
|
3310
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
3311
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
3312
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
3313
|
+
* responsive.
|
|
1545
3314
|
*/
|
|
1546
|
-
|
|
3315
|
+
speak_during_execution?: boolean;
|
|
1547
3316
|
/**
|
|
1548
|
-
*
|
|
1549
|
-
*
|
|
1550
|
-
*
|
|
3317
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
3318
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
3319
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
3320
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
1551
3321
|
*/
|
|
1552
|
-
|
|
3322
|
+
timeout_ms?: number;
|
|
3323
|
+
}
|
|
3324
|
+
namespace CustomTool {
|
|
1553
3325
|
/**
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
3326
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
3327
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
3328
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
3329
|
+
* empty parameter list.
|
|
1556
3330
|
*/
|
|
1557
|
-
|
|
3331
|
+
interface Parameters {
|
|
3332
|
+
/**
|
|
3333
|
+
* The value of properties is an object, where each key is the name of a property
|
|
3334
|
+
* and each value is a schema used to validate that property.
|
|
3335
|
+
*/
|
|
3336
|
+
properties: unknown;
|
|
3337
|
+
/**
|
|
3338
|
+
* Type must be "object" for a JSON Schema object.
|
|
3339
|
+
*/
|
|
3340
|
+
type: 'object';
|
|
3341
|
+
/**
|
|
3342
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
3343
|
+
* its best to generate the required properties in its function arguments. Property
|
|
3344
|
+
* must exist in properties.
|
|
3345
|
+
*/
|
|
3346
|
+
required?: Array<string>;
|
|
3347
|
+
}
|
|
1558
3348
|
}
|
|
1559
|
-
interface
|
|
3349
|
+
interface CodeTool {
|
|
1560
3350
|
/**
|
|
1561
|
-
*
|
|
3351
|
+
* JavaScript code to execute in the sandbox.
|
|
1562
3352
|
*/
|
|
1563
|
-
|
|
3353
|
+
code: string;
|
|
1564
3354
|
/**
|
|
1565
|
-
* Name of the
|
|
3355
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
3356
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
3357
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
3358
|
+
* allowed).
|
|
1566
3359
|
*/
|
|
1567
3360
|
name: string;
|
|
3361
|
+
type: 'code';
|
|
1568
3362
|
/**
|
|
1569
|
-
*
|
|
3363
|
+
* Names of tools that must run before this one.
|
|
1570
3364
|
*/
|
|
1571
|
-
|
|
3365
|
+
depends_on?: Array<string>;
|
|
1572
3366
|
/**
|
|
1573
|
-
*
|
|
1574
|
-
* the analysis. If not set, the field is always included. If required is true,
|
|
1575
|
-
* this is ignored.
|
|
3367
|
+
* Describes what this tool does and when to call this tool.
|
|
1576
3368
|
*/
|
|
1577
|
-
|
|
3369
|
+
description?: string;
|
|
1578
3370
|
/**
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
3371
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
3372
|
+
* executing.
|
|
1581
3373
|
*/
|
|
1582
|
-
|
|
1583
|
-
}
|
|
1584
|
-
/**
|
|
1585
|
-
* System preset for post-call analysis (voice agents). Use in
|
|
1586
|
-
* post_call_analysis_data to override prompts or mark fields optional.
|
|
1587
|
-
*/
|
|
1588
|
-
interface CallPresetAnalysisData {
|
|
3374
|
+
enable_typing_sound?: boolean;
|
|
1589
3375
|
/**
|
|
1590
|
-
*
|
|
3376
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
3377
|
+
* when speak_during_execution is true.
|
|
1591
3378
|
*/
|
|
1592
|
-
|
|
3379
|
+
execution_message_description?: string;
|
|
1593
3380
|
/**
|
|
1594
|
-
*
|
|
3381
|
+
* Type of execution message. "prompt" means the agent will use
|
|
3382
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
3383
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
3384
|
+
* to "prompt".
|
|
1595
3385
|
*/
|
|
1596
|
-
|
|
3386
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
1597
3387
|
/**
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
3388
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
3389
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
1600
3390
|
*/
|
|
1601
|
-
|
|
3391
|
+
response_variables?: {
|
|
3392
|
+
[key: string]: string;
|
|
3393
|
+
};
|
|
1602
3394
|
/**
|
|
1603
|
-
*
|
|
3395
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
3396
|
+
* result of function is obtained.
|
|
1604
3397
|
*/
|
|
1605
|
-
|
|
3398
|
+
speak_after_execution?: boolean;
|
|
1606
3399
|
/**
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
3400
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
3401
|
+
* that." when executing the tool.
|
|
1609
3402
|
*/
|
|
1610
|
-
|
|
3403
|
+
speak_during_execution?: boolean;
|
|
3404
|
+
/**
|
|
3405
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
3406
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
3407
|
+
*/
|
|
3408
|
+
timeout_ms?: number;
|
|
1611
3409
|
}
|
|
1612
3410
|
interface PronunciationDictionary {
|
|
1613
3411
|
/**
|
|
@@ -1771,6 +3569,14 @@ export interface AgentUpdateParams {
|
|
|
1771
3569
|
* to disable call screen prompt instructions.
|
|
1772
3570
|
*/
|
|
1773
3571
|
call_screening_option?: AgentUpdateParams.CallScreeningOption | null;
|
|
3572
|
+
/**
|
|
3573
|
+
* Body param: Contact memory settings for phone calls and SMS chats. Creating an
|
|
3574
|
+
* agent defaults enable_update to false and enable_read to true. Updates only
|
|
3575
|
+
* change the supplied flags; omitted flags stay unchanged and an empty object has
|
|
3576
|
+
* no effect. Set a flag to false to disable it. The configuration cannot be
|
|
3577
|
+
* cleared. Existing agents without this configuration have both disabled.
|
|
3578
|
+
*/
|
|
3579
|
+
contact_memory_config?: AgentUpdateParams.ContactMemoryConfig;
|
|
1774
3580
|
/**
|
|
1775
3581
|
* Body param: Custom STT configuration. Only used when stt_mode is set to custom.
|
|
1776
3582
|
*/
|
|
@@ -1805,6 +3611,13 @@ export interface AgentUpdateParams {
|
|
|
1805
3611
|
* set, agent will not backchannel.
|
|
1806
3612
|
*/
|
|
1807
3613
|
enable_backchannel?: boolean;
|
|
3614
|
+
/**
|
|
3615
|
+
* Body param: If set to true, the agent recognizes requests to stop calling or
|
|
3616
|
+
* contacting the user, confirms once, and on a clear yes ends the call with
|
|
3617
|
+
* disconnection reason user_requested_dnc and sets do_not_call to true on the
|
|
3618
|
+
* contact for the user's phone number. If unset, default value false will apply.
|
|
3619
|
+
*/
|
|
3620
|
+
enable_dnc_detection?: boolean;
|
|
1808
3621
|
/**
|
|
1809
3622
|
* Body param: If set to true, the agent will dynamically adjust how quickly it
|
|
1810
3623
|
* responds based on the user's speech rate and past turn-taking behavior in the
|
|
@@ -1908,7 +3721,23 @@ export interface AgentUpdateParams {
|
|
|
1908
3721
|
/**
|
|
1909
3722
|
* Body param: The model to use for post call analysis. Default to gpt-5.6-terra.
|
|
1910
3723
|
*/
|
|
1911
|
-
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
3724
|
+
post_call_analysis_model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6-luna' | 'claude-4.5-sonnet' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | null;
|
|
3725
|
+
/**
|
|
3726
|
+
* Body param: Integration (Agent Functions) tools run as a dependency graph during
|
|
3727
|
+
* teardown, after post-call analysis. Each tool can be gated by a condition. On
|
|
3728
|
+
* calls the graph is stopped after five minutes so teardown can finish. Set to
|
|
3729
|
+
* null to clear.
|
|
3730
|
+
*/
|
|
3731
|
+
post_session_tools?: Array<AgentUpdateParams.AppTool | AgentUpdateParams.CustomTool | AgentUpdateParams.CodeTool | AgentUpdateParams.SendSMSTool> | null;
|
|
3732
|
+
/**
|
|
3733
|
+
* Body param: Integration (Agent Functions) tools run as a dependency graph during
|
|
3734
|
+
* session setup, before the agent's first message. Outputs are injected as dynamic
|
|
3735
|
+
* variables. On calls the graph gets one minute unless an outbound caller will be
|
|
3736
|
+
* dialed after setup, in which case it gets five minutes. Past that session
|
|
3737
|
+
* initialization continues and any remaining tools finish in the background, so
|
|
3738
|
+
* their outputs no longer reach the agent's prompt. Set to null to clear.
|
|
3739
|
+
*/
|
|
3740
|
+
pre_session_tools?: Array<AgentUpdateParams.AppTool | AgentUpdateParams.CustomTool | AgentUpdateParams.CodeTool> | null;
|
|
1912
3741
|
/**
|
|
1913
3742
|
* Body param: A list of words / phrases and their pronunciation to be used to
|
|
1914
3743
|
* guide the audio synthesize for consistent pronunciation. Check the dashboard to
|
|
@@ -1984,12 +3813,6 @@ export interface AgentUpdateParams {
|
|
|
1984
3813
|
* a no-op. Default to general.
|
|
1985
3814
|
*/
|
|
1986
3815
|
vocab_specialization?: 'general' | 'medical';
|
|
1987
|
-
/**
|
|
1988
|
-
* Body param: Controls the emotional tone of the agent's voice. Currently
|
|
1989
|
-
* supported for Cartesia and Minimax TTS providers. If unset, no emotion will be
|
|
1990
|
-
* used.
|
|
1991
|
-
*/
|
|
1992
|
-
voice_emotion?: 'calm' | 'sympathetic' | 'happy' | 'sad' | 'angry' | 'fearful' | 'surprised' | null;
|
|
1993
3816
|
/**
|
|
1994
3817
|
* Body param: Unique voice id used for the agent. Find list of available voices
|
|
1995
3818
|
* and their preview in Dashboard.
|
|
@@ -2001,7 +3824,7 @@ export interface AgentUpdateParams {
|
|
|
2001
3824
|
* selection, and default ones will apply. Check out dashboard for more details of
|
|
2002
3825
|
* each voice model.
|
|
2003
3826
|
*/
|
|
2004
|
-
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
3827
|
+
voice_model?: 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'eleven_v4_turbo' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'sonic-3.6' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | 'inworld-tts-2' | 'inworld-tts-2-flash' | null;
|
|
2005
3828
|
/**
|
|
2006
3829
|
* Body param: Controls speed of voice. Value ranging from [0.5,2]. Lower value
|
|
2007
3830
|
* means slower speech, while higher value means faster speech rate. If unset,
|
|
@@ -2048,272 +3871,1145 @@ export interface AgentUpdateParams {
|
|
|
2048
3871
|
}
|
|
2049
3872
|
export declare namespace AgentUpdateParams {
|
|
2050
3873
|
/**
|
|
2051
|
-
* If this option is set, the agent prompt will include call screen handling
|
|
2052
|
-
* instructions for identity and call purpose questions. Set this to null to
|
|
2053
|
-
* disable call screen prompt instructions.
|
|
3874
|
+
* If this option is set, the agent prompt will include call screen handling
|
|
3875
|
+
* instructions for identity and call purpose questions. Set this to null to
|
|
3876
|
+
* disable call screen prompt instructions.
|
|
3877
|
+
*/
|
|
3878
|
+
interface CallScreeningOption {
|
|
3879
|
+
/**
|
|
3880
|
+
* Identity the agent should provide when a call screen asks who is calling.
|
|
3881
|
+
* Dynamic variables are supported.
|
|
3882
|
+
*/
|
|
3883
|
+
agent_identity: string;
|
|
3884
|
+
/**
|
|
3885
|
+
* Purpose the agent should provide when a call screen asks why it is calling.
|
|
3886
|
+
* Dynamic variables are supported.
|
|
3887
|
+
*/
|
|
3888
|
+
call_purpose: string;
|
|
3889
|
+
}
|
|
3890
|
+
/**
|
|
3891
|
+
* Contact memory settings for phone calls and SMS chats. Creating an agent
|
|
3892
|
+
* defaults enable_update to false and enable_read to true. Updates only change the
|
|
3893
|
+
* supplied flags; omitted flags stay unchanged and an empty object has no effect.
|
|
3894
|
+
* Set a flag to false to disable it. The configuration cannot be cleared. Existing
|
|
3895
|
+
* agents without this configuration have both disabled.
|
|
3896
|
+
*/
|
|
3897
|
+
interface ContactMemoryConfig {
|
|
3898
|
+
/**
|
|
3899
|
+
* Automatically add saved contact memory to the agent prompt. Skippable nodes can
|
|
3900
|
+
* use answers from the current conversation even when this setting is disabled.
|
|
3901
|
+
* Contact dynamic variables, including contact_memory, remain available regardless
|
|
3902
|
+
* of this setting.
|
|
3903
|
+
*/
|
|
3904
|
+
enable_read?: boolean;
|
|
3905
|
+
/**
|
|
3906
|
+
* Rewrite the contact memory after each conversation. Requires storing
|
|
3907
|
+
* conversation data. Chat agents must also have end_chat_after_silence_ms set.
|
|
3908
|
+
*/
|
|
3909
|
+
enable_update?: boolean;
|
|
3910
|
+
}
|
|
3911
|
+
/**
|
|
3912
|
+
* Custom STT configuration. Only used when stt_mode is set to custom.
|
|
3913
|
+
*/
|
|
3914
|
+
interface CustomSttConfig {
|
|
3915
|
+
/**
|
|
3916
|
+
* Endpointing timeout in milliseconds. Minimum is 100 for Azure, 10 for Deepgram,
|
|
3917
|
+
* 500 for Soniox, 100 for AssemblyAI, 100 for Muse. For AssemblyAI, this sets
|
|
3918
|
+
* min_turn_silence (100-3000 ms). max_turn_silence adds half of this value,
|
|
3919
|
+
* rounded to the nearest millisecond and bounded to 500-1000 ms, with a total cap
|
|
3920
|
+
* of 3000 ms. Muse detects turn ends itself and ignores this value.
|
|
3921
|
+
*/
|
|
3922
|
+
endpointing_ms: number;
|
|
3923
|
+
/**
|
|
3924
|
+
* ASR provider name.
|
|
3925
|
+
*/
|
|
3926
|
+
provider: 'azure' | 'deepgram' | 'soniox' | 'assemblyai' | 'muse';
|
|
3927
|
+
}
|
|
3928
|
+
/**
|
|
3929
|
+
* Configuration for guardrail checks to detect and prevent prohibited topics in
|
|
3930
|
+
* agent output and user input.
|
|
3931
|
+
*/
|
|
3932
|
+
interface GuardrailConfig {
|
|
3933
|
+
/**
|
|
3934
|
+
* Selected prohibited user topic categories to check. When user messages contain
|
|
3935
|
+
* these topics, the agent will respond with a placeholder message instead of
|
|
3936
|
+
* processing the request.
|
|
3937
|
+
*/
|
|
3938
|
+
input_topics?: Array<'platform_integrity_jailbreaking'> | null;
|
|
3939
|
+
/**
|
|
3940
|
+
* Selected prohibited agent topic categories to check. When agent messages contain
|
|
3941
|
+
* these topics, they will be replaced with a placeholder message.
|
|
3942
|
+
*/
|
|
3943
|
+
output_topics?: Array<'harassment' | 'self_harm' | 'sexual_exploitation' | 'violence' | 'defense_and_national_security' | 'illicit_and_harmful_activity' | 'gambling' | 'regulated_professional_advice' | 'child_safety_and_exploitation'> | null;
|
|
3944
|
+
}
|
|
3945
|
+
/**
|
|
3946
|
+
* Toggle behavior presets on/off to influence agent response style and behaviors.
|
|
3947
|
+
*/
|
|
3948
|
+
interface HandbookConfig {
|
|
3949
|
+
/**
|
|
3950
|
+
* When asked, acknowledge being a virtual assistant.
|
|
3951
|
+
*/
|
|
3952
|
+
ai_disclosure?: boolean;
|
|
3953
|
+
/**
|
|
3954
|
+
* Enables Conversational Personality. When true, the agent uses the Conversational
|
|
3955
|
+
* Personality handbook preset, skips Professional Rep Personality during prompt
|
|
3956
|
+
* assembly, and enables internal colloquial rewrite behavior.
|
|
3957
|
+
*/
|
|
3958
|
+
conversational_personality?: boolean;
|
|
3959
|
+
/**
|
|
3960
|
+
* Professional call center rep baseline.
|
|
3961
|
+
*/
|
|
3962
|
+
default_personality?: boolean;
|
|
3963
|
+
/**
|
|
3964
|
+
* Repeat back and confirm important details (voice only).
|
|
3965
|
+
*/
|
|
3966
|
+
echo_verification?: boolean;
|
|
3967
|
+
/**
|
|
3968
|
+
* Warm acknowledgment of caller concerns.
|
|
3969
|
+
*/
|
|
3970
|
+
high_empathy?: boolean;
|
|
3971
|
+
/**
|
|
3972
|
+
* Spell using NATO phonetic alphabet style (voice only).
|
|
3973
|
+
*/
|
|
3974
|
+
nato_phonetic_alphabet?: boolean;
|
|
3975
|
+
/**
|
|
3976
|
+
* Sprinkle natural speech fillers like "um", "you know" for a more human,
|
|
3977
|
+
* conversational tone.
|
|
3978
|
+
*/
|
|
3979
|
+
natural_filler_words?: boolean;
|
|
3980
|
+
/**
|
|
3981
|
+
* Stay within prompt/context scope, don't invent details.
|
|
3982
|
+
*/
|
|
3983
|
+
scope_boundaries?: boolean;
|
|
3984
|
+
/**
|
|
3985
|
+
* Treat near-match similar words as same entity to reduce impact of transcription
|
|
3986
|
+
* error (voice only).
|
|
3987
|
+
*/
|
|
3988
|
+
smart_matching?: boolean;
|
|
3989
|
+
/**
|
|
3990
|
+
* Convert numbers/dates/currency to spoken forms (voice only).
|
|
3991
|
+
*/
|
|
3992
|
+
speech_normalization?: boolean;
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* If this option is set, the call will try to detect IVR in the first 3 minutes of
|
|
3996
|
+
* the call. Actions defined will be applied when the IVR is detected. Set this to
|
|
3997
|
+
* null to disable IVR detection.
|
|
3998
|
+
*/
|
|
3999
|
+
interface IvrOption {
|
|
4000
|
+
action: IvrOption.Action;
|
|
4001
|
+
/**
|
|
4002
|
+
* Optionally describe what should be treated as an IVR. Leave as null to use the
|
|
4003
|
+
* default definition.
|
|
4004
|
+
*/
|
|
4005
|
+
detection_prompt?: string | null;
|
|
4006
|
+
}
|
|
4007
|
+
namespace IvrOption {
|
|
4008
|
+
interface Action {
|
|
4009
|
+
type: 'hangup';
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* Configuration for PII scrubbing from transcripts and recordings.
|
|
2054
4014
|
*/
|
|
2055
|
-
interface
|
|
4015
|
+
interface PiiConfig {
|
|
2056
4016
|
/**
|
|
2057
|
-
*
|
|
2058
|
-
*
|
|
4017
|
+
* List of PII categories to scrub from transcripts and recordings. PII redaction
|
|
4018
|
+
* is only active when this list is non-empty; an empty array means no PII
|
|
4019
|
+
* scrubbing is performed.
|
|
2059
4020
|
*/
|
|
2060
|
-
|
|
4021
|
+
categories: Array<'person_name' | 'address' | 'email' | 'phone_number' | 'ssn' | 'passport' | 'driver_license' | 'credit_card' | 'bank_account' | 'password' | 'pin' | 'medical_id' | 'date_of_birth' | 'customer_account_number'>;
|
|
2061
4022
|
/**
|
|
2062
|
-
*
|
|
2063
|
-
* Dynamic variables are supported.
|
|
4023
|
+
* The processing mode for PII scrubbing. Currently only post-call is supported.
|
|
2064
4024
|
*/
|
|
2065
|
-
|
|
4025
|
+
mode: 'post_call';
|
|
4026
|
+
}
|
|
4027
|
+
interface StringAnalysisData {
|
|
4028
|
+
/**
|
|
4029
|
+
* Description of the variable.
|
|
4030
|
+
*/
|
|
4031
|
+
description: string;
|
|
4032
|
+
/**
|
|
4033
|
+
* Name of the variable.
|
|
4034
|
+
*/
|
|
4035
|
+
name: string;
|
|
4036
|
+
/**
|
|
4037
|
+
* Type of the variable to extract.
|
|
4038
|
+
*/
|
|
4039
|
+
type: 'string';
|
|
4040
|
+
/**
|
|
4041
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
4042
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
4043
|
+
* this is ignored.
|
|
4044
|
+
*/
|
|
4045
|
+
conditional_prompt?: string;
|
|
4046
|
+
/**
|
|
4047
|
+
* Examples of the variable value to teach model the style and syntax.
|
|
4048
|
+
*/
|
|
4049
|
+
examples?: Array<string>;
|
|
4050
|
+
/**
|
|
4051
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
4052
|
+
* will be marked as unsuccessful.
|
|
4053
|
+
*/
|
|
4054
|
+
required?: boolean;
|
|
4055
|
+
}
|
|
4056
|
+
interface EnumAnalysisData {
|
|
4057
|
+
/**
|
|
4058
|
+
* The possible values of the variable, must be non empty array.
|
|
4059
|
+
*/
|
|
4060
|
+
choices: Array<string>;
|
|
4061
|
+
/**
|
|
4062
|
+
* Description of the variable.
|
|
4063
|
+
*/
|
|
4064
|
+
description: string;
|
|
4065
|
+
/**
|
|
4066
|
+
* Name of the variable.
|
|
4067
|
+
*/
|
|
4068
|
+
name: string;
|
|
4069
|
+
/**
|
|
4070
|
+
* Type of the variable to extract.
|
|
4071
|
+
*/
|
|
4072
|
+
type: 'enum';
|
|
4073
|
+
/**
|
|
4074
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
4075
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
4076
|
+
* this is ignored.
|
|
4077
|
+
*/
|
|
4078
|
+
conditional_prompt?: string;
|
|
4079
|
+
/**
|
|
4080
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
4081
|
+
* will be marked as unsuccessful.
|
|
4082
|
+
*/
|
|
4083
|
+
required?: boolean;
|
|
4084
|
+
}
|
|
4085
|
+
interface BooleanAnalysisData {
|
|
4086
|
+
/**
|
|
4087
|
+
* Description of the variable.
|
|
4088
|
+
*/
|
|
4089
|
+
description: string;
|
|
4090
|
+
/**
|
|
4091
|
+
* Name of the variable.
|
|
4092
|
+
*/
|
|
4093
|
+
name: string;
|
|
4094
|
+
/**
|
|
4095
|
+
* Type of the variable to extract.
|
|
4096
|
+
*/
|
|
4097
|
+
type: 'boolean';
|
|
4098
|
+
/**
|
|
4099
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
4100
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
4101
|
+
* this is ignored.
|
|
4102
|
+
*/
|
|
4103
|
+
conditional_prompt?: string;
|
|
4104
|
+
/**
|
|
4105
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
4106
|
+
* will be marked as unsuccessful.
|
|
4107
|
+
*/
|
|
4108
|
+
required?: boolean;
|
|
4109
|
+
}
|
|
4110
|
+
interface NumberAnalysisData {
|
|
4111
|
+
/**
|
|
4112
|
+
* Description of the variable.
|
|
4113
|
+
*/
|
|
4114
|
+
description: string;
|
|
4115
|
+
/**
|
|
4116
|
+
* Name of the variable.
|
|
4117
|
+
*/
|
|
4118
|
+
name: string;
|
|
4119
|
+
/**
|
|
4120
|
+
* Type of the variable to extract.
|
|
4121
|
+
*/
|
|
4122
|
+
type: 'number';
|
|
4123
|
+
/**
|
|
4124
|
+
* Optional instruction to help decide whether this field needs to be populated in
|
|
4125
|
+
* the analysis. If not set, the field is always included. If required is true,
|
|
4126
|
+
* this is ignored.
|
|
4127
|
+
*/
|
|
4128
|
+
conditional_prompt?: string;
|
|
4129
|
+
/**
|
|
4130
|
+
* Whether this data is required. If true and the data is not extracted, the call
|
|
4131
|
+
* will be marked as unsuccessful.
|
|
4132
|
+
*/
|
|
4133
|
+
required?: boolean;
|
|
2066
4134
|
}
|
|
2067
4135
|
/**
|
|
2068
|
-
*
|
|
4136
|
+
* System preset for post-call analysis (voice agents). Use in
|
|
4137
|
+
* post_call_analysis_data to override prompts or mark fields optional.
|
|
2069
4138
|
*/
|
|
2070
|
-
interface
|
|
4139
|
+
interface CallPresetAnalysisData {
|
|
4140
|
+
/**
|
|
4141
|
+
* Preset identifier for voice agent analysis.
|
|
4142
|
+
*/
|
|
4143
|
+
name: 'call_summary' | 'call_successful' | 'user_sentiment';
|
|
4144
|
+
/**
|
|
4145
|
+
* Identifies this item as a system preset.
|
|
4146
|
+
*/
|
|
4147
|
+
type: 'system-presets';
|
|
4148
|
+
/**
|
|
4149
|
+
* Optional instruction to help decide whether this field needs to be populated. If
|
|
4150
|
+
* not set, the field is always included.
|
|
4151
|
+
*/
|
|
4152
|
+
conditional_prompt?: string;
|
|
4153
|
+
/**
|
|
4154
|
+
* Prompt or description for this preset.
|
|
4155
|
+
*/
|
|
4156
|
+
description?: string;
|
|
4157
|
+
/**
|
|
4158
|
+
* If false, this field is optional in the analysis. If true or unset, the field is
|
|
4159
|
+
* required.
|
|
4160
|
+
*/
|
|
4161
|
+
required?: boolean;
|
|
4162
|
+
}
|
|
4163
|
+
interface AppTool {
|
|
4164
|
+
/**
|
|
4165
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
4166
|
+
* organization whose provider matches this tool's provider.
|
|
4167
|
+
*/
|
|
4168
|
+
app_id: string;
|
|
4169
|
+
/**
|
|
4170
|
+
* Name of the catalog template within the provider, as listed by
|
|
4171
|
+
* list-app-templates.
|
|
4172
|
+
*/
|
|
4173
|
+
app_tool_template_name: string;
|
|
4174
|
+
/**
|
|
4175
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
4176
|
+
* depends_on.
|
|
4177
|
+
*/
|
|
4178
|
+
name: string;
|
|
4179
|
+
/**
|
|
4180
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
4181
|
+
* providers are listed by list-app-templates.
|
|
4182
|
+
*/
|
|
4183
|
+
provider: string;
|
|
4184
|
+
type: 'integration_app';
|
|
4185
|
+
/**
|
|
4186
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4187
|
+
* running.
|
|
4188
|
+
*/
|
|
4189
|
+
condition?: AppTool.Condition;
|
|
4190
|
+
/**
|
|
4191
|
+
* Names of tools that must run before this one.
|
|
4192
|
+
*/
|
|
4193
|
+
depends_on?: Array<string>;
|
|
4194
|
+
/**
|
|
4195
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4196
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
4197
|
+
*/
|
|
4198
|
+
description?: string;
|
|
4199
|
+
/**
|
|
4200
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4201
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
4202
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
4203
|
+
* prevent silence on the call.
|
|
4204
|
+
*/
|
|
4205
|
+
enable_typing_sound?: boolean;
|
|
4206
|
+
/**
|
|
4207
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4208
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
4209
|
+
* applicable when speak_during_execution is true.
|
|
4210
|
+
*/
|
|
4211
|
+
execution_message_description?: string;
|
|
4212
|
+
/**
|
|
4213
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4214
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
4215
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4216
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4217
|
+
* to "prompt".
|
|
4218
|
+
*/
|
|
4219
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
4220
|
+
/**
|
|
4221
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
4222
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
4223
|
+
* from the raw response.
|
|
4224
|
+
*/
|
|
4225
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
4226
|
+
/**
|
|
4227
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
4228
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
4229
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
4230
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
4231
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
4232
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
4233
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
4234
|
+
* Each parameter's required list must match the schema returned by the
|
|
4235
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
4236
|
+
*/
|
|
4237
|
+
parameters?: Array<AppTool.Parameter>;
|
|
4238
|
+
/**
|
|
4239
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
4240
|
+
* populated from. Missing paths are ignored.
|
|
4241
|
+
*/
|
|
4242
|
+
response_variables?: {
|
|
4243
|
+
[key: string]: string;
|
|
4244
|
+
};
|
|
4245
|
+
/**
|
|
4246
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4247
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
4248
|
+
* when the result of the tool is obtained.
|
|
4249
|
+
*/
|
|
4250
|
+
speak_after_execution?: boolean;
|
|
4251
|
+
/**
|
|
4252
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4253
|
+
* conversation. If true, will speak during execution.
|
|
4254
|
+
*/
|
|
4255
|
+
speak_during_execution?: boolean;
|
|
4256
|
+
}
|
|
4257
|
+
namespace AppTool {
|
|
4258
|
+
/**
|
|
4259
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4260
|
+
* running.
|
|
4261
|
+
*/
|
|
4262
|
+
interface Condition {
|
|
4263
|
+
equations: Array<Condition.Equation>;
|
|
4264
|
+
operator: '||' | '&&';
|
|
4265
|
+
type: 'equation';
|
|
4266
|
+
}
|
|
4267
|
+
namespace Condition {
|
|
4268
|
+
interface Equation {
|
|
4269
|
+
/**
|
|
4270
|
+
* Left side of the equation
|
|
4271
|
+
*/
|
|
4272
|
+
left: string;
|
|
4273
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
4274
|
+
/**
|
|
4275
|
+
* Right side of the equation. The right side of the equation not required when
|
|
4276
|
+
* "exists" or "not_exist" are selected.
|
|
4277
|
+
*/
|
|
4278
|
+
right?: string;
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
interface UnionMember0 {
|
|
4282
|
+
mode: 'all';
|
|
4283
|
+
/**
|
|
4284
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
4285
|
+
*/
|
|
4286
|
+
fields?: Array<string>;
|
|
4287
|
+
}
|
|
4288
|
+
interface UnionMember1 {
|
|
4289
|
+
/**
|
|
4290
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
4291
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
4292
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
4293
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
4294
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
4295
|
+
* that match nothing contribute nothing.
|
|
4296
|
+
*/
|
|
4297
|
+
fields: Array<string>;
|
|
4298
|
+
mode: 'subset';
|
|
4299
|
+
}
|
|
4300
|
+
/**
|
|
4301
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4302
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4303
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4304
|
+
* empty parameter list.
|
|
4305
|
+
*/
|
|
4306
|
+
interface Parameter {
|
|
4307
|
+
/**
|
|
4308
|
+
* The value of properties is an object, where each key is the name of a property
|
|
4309
|
+
* and each value is a schema used to validate that property.
|
|
4310
|
+
*/
|
|
4311
|
+
properties: unknown;
|
|
4312
|
+
/**
|
|
4313
|
+
* Type must be "object" for a JSON Schema object.
|
|
4314
|
+
*/
|
|
4315
|
+
type: 'object';
|
|
4316
|
+
/**
|
|
4317
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
4318
|
+
* its best to generate the required properties in its function arguments. Property
|
|
4319
|
+
* must exist in properties.
|
|
4320
|
+
*/
|
|
4321
|
+
required?: Array<string>;
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
interface CustomTool {
|
|
4325
|
+
/**
|
|
4326
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
4327
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
4328
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
4329
|
+
* allowed).
|
|
4330
|
+
*/
|
|
4331
|
+
name: string;
|
|
4332
|
+
type: 'custom';
|
|
4333
|
+
/**
|
|
4334
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
4335
|
+
* to call the tool.
|
|
4336
|
+
*/
|
|
4337
|
+
url: string;
|
|
4338
|
+
/**
|
|
4339
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
4340
|
+
* of nested under "args".
|
|
4341
|
+
*/
|
|
4342
|
+
args_at_root?: boolean;
|
|
4343
|
+
/**
|
|
4344
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4345
|
+
* running.
|
|
4346
|
+
*/
|
|
4347
|
+
condition?: CustomTool.Condition;
|
|
4348
|
+
/**
|
|
4349
|
+
* Names of tools that must run before this one.
|
|
4350
|
+
*/
|
|
4351
|
+
depends_on?: Array<string>;
|
|
4352
|
+
/**
|
|
4353
|
+
* Describes what this tool does and when to call this tool.
|
|
4354
|
+
*/
|
|
4355
|
+
description?: string;
|
|
4356
|
+
/**
|
|
4357
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
4358
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
4359
|
+
* silence on the call.
|
|
4360
|
+
*/
|
|
4361
|
+
enable_typing_sound?: boolean;
|
|
4362
|
+
/**
|
|
4363
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
4364
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
4365
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
4366
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
4367
|
+
*/
|
|
4368
|
+
execution_message_description?: string;
|
|
4369
|
+
/**
|
|
4370
|
+
* Type of execution message. "prompt" means the agent will use
|
|
4371
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4372
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4373
|
+
* to "prompt".
|
|
4374
|
+
*/
|
|
4375
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
4376
|
+
/**
|
|
4377
|
+
* Headers to add to the request.
|
|
4378
|
+
*/
|
|
4379
|
+
headers?: {
|
|
4380
|
+
[key: string]: string;
|
|
4381
|
+
};
|
|
4382
|
+
/**
|
|
4383
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
4384
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
4385
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
4386
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
4387
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
4388
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
4389
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
4390
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
4391
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
4392
|
+
* than once. Defaults to 0 (no retry).
|
|
4393
|
+
*/
|
|
4394
|
+
max_retry?: number;
|
|
4395
|
+
/**
|
|
4396
|
+
* Method to use for the request, default to POST.
|
|
4397
|
+
*/
|
|
4398
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
4399
|
+
/**
|
|
4400
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
4401
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
4402
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
4403
|
+
* is encoded (see `args_at_root`).
|
|
4404
|
+
*/
|
|
4405
|
+
parameter_type?: 'json' | 'form';
|
|
4406
|
+
/**
|
|
4407
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4408
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4409
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4410
|
+
* empty parameter list.
|
|
4411
|
+
*/
|
|
4412
|
+
parameters?: CustomTool.Parameters;
|
|
4413
|
+
/**
|
|
4414
|
+
* Query parameters to append to the request URL.
|
|
4415
|
+
*/
|
|
4416
|
+
query_params?: {
|
|
4417
|
+
[key: string]: string;
|
|
4418
|
+
};
|
|
4419
|
+
/**
|
|
4420
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
4421
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
4422
|
+
* use.
|
|
4423
|
+
*/
|
|
4424
|
+
response_variables?: {
|
|
4425
|
+
[key: string]: string;
|
|
4426
|
+
};
|
|
4427
|
+
/**
|
|
4428
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
4429
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
4430
|
+
* get update for the function call.
|
|
4431
|
+
*/
|
|
4432
|
+
speak_after_execution?: boolean;
|
|
2071
4433
|
/**
|
|
2072
|
-
*
|
|
2073
|
-
*
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
4434
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
4435
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
4436
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
4437
|
+
* responsive.
|
|
2076
4438
|
*/
|
|
2077
|
-
|
|
4439
|
+
speak_during_execution?: boolean;
|
|
2078
4440
|
/**
|
|
2079
|
-
*
|
|
4441
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
4442
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
4443
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
4444
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
2080
4445
|
*/
|
|
2081
|
-
|
|
4446
|
+
timeout_ms?: number;
|
|
2082
4447
|
}
|
|
2083
|
-
|
|
2084
|
-
* Configuration for guardrail checks to detect and prevent prohibited topics in
|
|
2085
|
-
* agent output and user input.
|
|
2086
|
-
*/
|
|
2087
|
-
interface GuardrailConfig {
|
|
4448
|
+
namespace CustomTool {
|
|
2088
4449
|
/**
|
|
2089
|
-
*
|
|
2090
|
-
*
|
|
2091
|
-
* processing the request.
|
|
4450
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4451
|
+
* running.
|
|
2092
4452
|
*/
|
|
2093
|
-
|
|
4453
|
+
interface Condition {
|
|
4454
|
+
equations: Array<Condition.Equation>;
|
|
4455
|
+
operator: '||' | '&&';
|
|
4456
|
+
type: 'equation';
|
|
4457
|
+
}
|
|
4458
|
+
namespace Condition {
|
|
4459
|
+
interface Equation {
|
|
4460
|
+
/**
|
|
4461
|
+
* Left side of the equation
|
|
4462
|
+
*/
|
|
4463
|
+
left: string;
|
|
4464
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
4465
|
+
/**
|
|
4466
|
+
* Right side of the equation. The right side of the equation not required when
|
|
4467
|
+
* "exists" or "not_exist" are selected.
|
|
4468
|
+
*/
|
|
4469
|
+
right?: string;
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
2094
4472
|
/**
|
|
2095
|
-
*
|
|
2096
|
-
*
|
|
4473
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4474
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4475
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4476
|
+
* empty parameter list.
|
|
2097
4477
|
*/
|
|
2098
|
-
|
|
4478
|
+
interface Parameters {
|
|
4479
|
+
/**
|
|
4480
|
+
* The value of properties is an object, where each key is the name of a property
|
|
4481
|
+
* and each value is a schema used to validate that property.
|
|
4482
|
+
*/
|
|
4483
|
+
properties: unknown;
|
|
4484
|
+
/**
|
|
4485
|
+
* Type must be "object" for a JSON Schema object.
|
|
4486
|
+
*/
|
|
4487
|
+
type: 'object';
|
|
4488
|
+
/**
|
|
4489
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
4490
|
+
* its best to generate the required properties in its function arguments. Property
|
|
4491
|
+
* must exist in properties.
|
|
4492
|
+
*/
|
|
4493
|
+
required?: Array<string>;
|
|
4494
|
+
}
|
|
2099
4495
|
}
|
|
2100
|
-
|
|
2101
|
-
* Toggle behavior presets on/off to influence agent response style and behaviors.
|
|
2102
|
-
*/
|
|
2103
|
-
interface HandbookConfig {
|
|
4496
|
+
interface CodeTool {
|
|
2104
4497
|
/**
|
|
2105
|
-
*
|
|
4498
|
+
* JavaScript code to execute in the sandbox.
|
|
2106
4499
|
*/
|
|
2107
|
-
|
|
4500
|
+
code: string;
|
|
2108
4501
|
/**
|
|
2109
|
-
*
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
4502
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
4503
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
4504
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
4505
|
+
* allowed).
|
|
2112
4506
|
*/
|
|
2113
|
-
|
|
4507
|
+
name: string;
|
|
4508
|
+
type: 'code';
|
|
2114
4509
|
/**
|
|
2115
|
-
*
|
|
4510
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4511
|
+
* running.
|
|
2116
4512
|
*/
|
|
2117
|
-
|
|
4513
|
+
condition?: CodeTool.Condition;
|
|
2118
4514
|
/**
|
|
2119
|
-
*
|
|
4515
|
+
* Names of tools that must run before this one.
|
|
2120
4516
|
*/
|
|
2121
|
-
|
|
4517
|
+
depends_on?: Array<string>;
|
|
2122
4518
|
/**
|
|
2123
|
-
*
|
|
4519
|
+
* Describes what this tool does and when to call this tool.
|
|
2124
4520
|
*/
|
|
2125
|
-
|
|
4521
|
+
description?: string;
|
|
2126
4522
|
/**
|
|
2127
|
-
*
|
|
4523
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
4524
|
+
* executing.
|
|
2128
4525
|
*/
|
|
2129
|
-
|
|
4526
|
+
enable_typing_sound?: boolean;
|
|
2130
4527
|
/**
|
|
2131
|
-
*
|
|
2132
|
-
*
|
|
4528
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
4529
|
+
* when speak_during_execution is true.
|
|
2133
4530
|
*/
|
|
2134
|
-
|
|
4531
|
+
execution_message_description?: string;
|
|
2135
4532
|
/**
|
|
2136
|
-
*
|
|
4533
|
+
* Type of execution message. "prompt" means the agent will use
|
|
4534
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4535
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4536
|
+
* to "prompt".
|
|
2137
4537
|
*/
|
|
2138
|
-
|
|
4538
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
2139
4539
|
/**
|
|
2140
|
-
*
|
|
2141
|
-
*
|
|
4540
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
4541
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
2142
4542
|
*/
|
|
2143
|
-
|
|
4543
|
+
response_variables?: {
|
|
4544
|
+
[key: string]: string;
|
|
4545
|
+
};
|
|
2144
4546
|
/**
|
|
2145
|
-
*
|
|
4547
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
4548
|
+
* result of function is obtained.
|
|
2146
4549
|
*/
|
|
2147
|
-
|
|
2148
|
-
}
|
|
2149
|
-
/**
|
|
2150
|
-
* If this option is set, the call will try to detect IVR in the first 3 minutes of
|
|
2151
|
-
* the call. Actions defined will be applied when the IVR is detected. Set this to
|
|
2152
|
-
* null to disable IVR detection.
|
|
2153
|
-
*/
|
|
2154
|
-
interface IvrOption {
|
|
2155
|
-
action: IvrOption.Action;
|
|
4550
|
+
speak_after_execution?: boolean;
|
|
2156
4551
|
/**
|
|
2157
|
-
*
|
|
2158
|
-
*
|
|
4552
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
4553
|
+
* that." when executing the tool.
|
|
2159
4554
|
*/
|
|
2160
|
-
|
|
4555
|
+
speak_during_execution?: boolean;
|
|
4556
|
+
/**
|
|
4557
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
4558
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
4559
|
+
*/
|
|
4560
|
+
timeout_ms?: number;
|
|
2161
4561
|
}
|
|
2162
|
-
namespace
|
|
2163
|
-
|
|
2164
|
-
|
|
4562
|
+
namespace CodeTool {
|
|
4563
|
+
/**
|
|
4564
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4565
|
+
* running.
|
|
4566
|
+
*/
|
|
4567
|
+
interface Condition {
|
|
4568
|
+
equations: Array<Condition.Equation>;
|
|
4569
|
+
operator: '||' | '&&';
|
|
4570
|
+
type: 'equation';
|
|
4571
|
+
}
|
|
4572
|
+
namespace Condition {
|
|
4573
|
+
interface Equation {
|
|
4574
|
+
/**
|
|
4575
|
+
* Left side of the equation
|
|
4576
|
+
*/
|
|
4577
|
+
left: string;
|
|
4578
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
4579
|
+
/**
|
|
4580
|
+
* Right side of the equation. The right side of the equation not required when
|
|
4581
|
+
* "exists" or "not_exist" are selected.
|
|
4582
|
+
*/
|
|
4583
|
+
right?: string;
|
|
4584
|
+
}
|
|
2165
4585
|
}
|
|
2166
4586
|
}
|
|
2167
|
-
|
|
2168
|
-
* Configuration for PII scrubbing from transcripts and recordings.
|
|
2169
|
-
*/
|
|
2170
|
-
interface PiiConfig {
|
|
4587
|
+
interface SendSMSTool {
|
|
2171
4588
|
/**
|
|
2172
|
-
*
|
|
2173
|
-
*
|
|
2174
|
-
* scrubbing is performed.
|
|
4589
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
4590
|
+
* time (general tools + state tools + state edges).
|
|
2175
4591
|
*/
|
|
2176
|
-
|
|
4592
|
+
name: string;
|
|
4593
|
+
sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
|
|
4594
|
+
type: 'send_sms';
|
|
2177
4595
|
/**
|
|
2178
|
-
*
|
|
4596
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4597
|
+
* running.
|
|
2179
4598
|
*/
|
|
2180
|
-
|
|
2181
|
-
}
|
|
2182
|
-
interface StringAnalysisData {
|
|
4599
|
+
condition?: SendSMSTool.Condition;
|
|
2183
4600
|
/**
|
|
2184
|
-
*
|
|
4601
|
+
* Names of tools that must run before this one.
|
|
2185
4602
|
*/
|
|
2186
|
-
|
|
4603
|
+
depends_on?: Array<string>;
|
|
2187
4604
|
/**
|
|
2188
|
-
*
|
|
4605
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
4606
|
+
* to call the tool.
|
|
2189
4607
|
*/
|
|
2190
|
-
|
|
4608
|
+
description?: string;
|
|
2191
4609
|
/**
|
|
2192
|
-
*
|
|
4610
|
+
* Describes what to say before sending the SMS. Only applicable when
|
|
4611
|
+
* speak_during_execution is true.
|
|
2193
4612
|
*/
|
|
2194
|
-
|
|
4613
|
+
execution_message_description?: string;
|
|
2195
4614
|
/**
|
|
2196
|
-
*
|
|
2197
|
-
*
|
|
2198
|
-
*
|
|
4615
|
+
* Type of execution message. "prompt" means the agent will use
|
|
4616
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4617
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4618
|
+
* to "prompt".
|
|
2199
4619
|
*/
|
|
2200
|
-
|
|
4620
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
2201
4621
|
/**
|
|
2202
|
-
*
|
|
4622
|
+
* If true, the agent will speak a short line before sending the SMS. If omitted,
|
|
4623
|
+
* defaults to true (same as end_call / transfer_call tools).
|
|
2203
4624
|
*/
|
|
2204
|
-
|
|
4625
|
+
speak_during_execution?: boolean;
|
|
4626
|
+
}
|
|
4627
|
+
namespace SendSMSTool {
|
|
4628
|
+
interface SMSContentPredefined {
|
|
4629
|
+
/**
|
|
4630
|
+
* The static message to be sent in the SMS. Can contain dynamic variables.
|
|
4631
|
+
*/
|
|
4632
|
+
text?: string;
|
|
4633
|
+
type?: 'predefined';
|
|
4634
|
+
}
|
|
4635
|
+
interface SMSContentInferred {
|
|
4636
|
+
/**
|
|
4637
|
+
* The prompt to be used to help infer the SMS content. The model will take the
|
|
4638
|
+
* global prompt, the call transcript, and this prompt together to deduce the right
|
|
4639
|
+
* message to send. Can contain dynamic variables.
|
|
4640
|
+
*/
|
|
4641
|
+
prompt?: string;
|
|
4642
|
+
type?: 'inferred';
|
|
4643
|
+
}
|
|
4644
|
+
interface SMSContentTemplate {
|
|
4645
|
+
/**
|
|
4646
|
+
* The template to use for the SMS content. "info_collection" sends a predefined
|
|
4647
|
+
* message requesting information from the user.
|
|
4648
|
+
*/
|
|
4649
|
+
template: 'info_collection';
|
|
4650
|
+
type: 'template';
|
|
4651
|
+
}
|
|
2205
4652
|
/**
|
|
2206
|
-
*
|
|
2207
|
-
*
|
|
4653
|
+
* Optional gate; the step only runs when the condition holds. Defaults to always
|
|
4654
|
+
* running.
|
|
2208
4655
|
*/
|
|
2209
|
-
|
|
4656
|
+
interface Condition {
|
|
4657
|
+
equations: Array<Condition.Equation>;
|
|
4658
|
+
operator: '||' | '&&';
|
|
4659
|
+
type: 'equation';
|
|
4660
|
+
}
|
|
4661
|
+
namespace Condition {
|
|
4662
|
+
interface Equation {
|
|
4663
|
+
/**
|
|
4664
|
+
* Left side of the equation
|
|
4665
|
+
*/
|
|
4666
|
+
left: string;
|
|
4667
|
+
operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
|
|
4668
|
+
/**
|
|
4669
|
+
* Right side of the equation. The right side of the equation not required when
|
|
4670
|
+
* "exists" or "not_exist" are selected.
|
|
4671
|
+
*/
|
|
4672
|
+
right?: string;
|
|
4673
|
+
}
|
|
4674
|
+
}
|
|
2210
4675
|
}
|
|
2211
|
-
interface
|
|
4676
|
+
interface AppTool {
|
|
2212
4677
|
/**
|
|
2213
|
-
* The
|
|
4678
|
+
* The connection (App) this tool runs against. Must be a connection in the
|
|
4679
|
+
* organization whose provider matches this tool's provider.
|
|
2214
4680
|
*/
|
|
2215
|
-
|
|
4681
|
+
app_id: string;
|
|
2216
4682
|
/**
|
|
2217
|
-
*
|
|
4683
|
+
* Name of the catalog template within the provider, as listed by
|
|
4684
|
+
* list-app-templates.
|
|
2218
4685
|
*/
|
|
2219
|
-
|
|
4686
|
+
app_tool_template_name: string;
|
|
2220
4687
|
/**
|
|
2221
|
-
* Name of the
|
|
4688
|
+
* Name of the tool. Must be unique within the phase's tools; referenced by
|
|
4689
|
+
* depends_on.
|
|
2222
4690
|
*/
|
|
2223
4691
|
name: string;
|
|
2224
4692
|
/**
|
|
2225
|
-
*
|
|
4693
|
+
* Provider of the connection. Must match the connection's provider; supported
|
|
4694
|
+
* providers are listed by list-app-templates.
|
|
2226
4695
|
*/
|
|
2227
|
-
|
|
4696
|
+
provider: string;
|
|
4697
|
+
type: 'integration_app';
|
|
2228
4698
|
/**
|
|
2229
|
-
*
|
|
2230
|
-
* the analysis. If not set, the field is always included. If required is true,
|
|
2231
|
-
* this is ignored.
|
|
4699
|
+
* Names of tools that must run before this one.
|
|
2232
4700
|
*/
|
|
2233
|
-
|
|
4701
|
+
depends_on?: Array<string>;
|
|
2234
4702
|
/**
|
|
2235
|
-
*
|
|
2236
|
-
*
|
|
4703
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4704
|
+
* conversation. Overrides the catalog template's LLM-facing description.
|
|
2237
4705
|
*/
|
|
2238
|
-
|
|
2239
|
-
}
|
|
2240
|
-
interface BooleanAnalysisData {
|
|
4706
|
+
description?: string;
|
|
2241
4707
|
/**
|
|
2242
|
-
*
|
|
4708
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4709
|
+
* conversation. If true, play a typing sound on the agent audio track while this
|
|
4710
|
+
* tool is executing. Useful when the tool takes a noticeable amount of time to
|
|
4711
|
+
* prevent silence on the call.
|
|
2243
4712
|
*/
|
|
2244
|
-
|
|
4713
|
+
enable_typing_sound?: boolean;
|
|
2245
4714
|
/**
|
|
2246
|
-
*
|
|
4715
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4716
|
+
* conversation. The message for the agent to speak when executing the tool. Only
|
|
4717
|
+
* applicable when speak_during_execution is true.
|
|
2247
4718
|
*/
|
|
2248
|
-
|
|
4719
|
+
execution_message_description?: string;
|
|
2249
4720
|
/**
|
|
2250
|
-
*
|
|
4721
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4722
|
+
* conversation. Type of execution message. "prompt" means the agent will use
|
|
4723
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4724
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4725
|
+
* to "prompt".
|
|
2251
4726
|
*/
|
|
2252
|
-
|
|
4727
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
2253
4728
|
/**
|
|
2254
|
-
*
|
|
2255
|
-
*
|
|
2256
|
-
*
|
|
4729
|
+
* What the agent and the transcript see of the tool's response. Omit to send the
|
|
4730
|
+
* full response. Does not affect response_variables, which are always extracted
|
|
4731
|
+
* from the raw response.
|
|
2257
4732
|
*/
|
|
2258
|
-
|
|
4733
|
+
output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
|
|
2259
4734
|
/**
|
|
2260
|
-
*
|
|
2261
|
-
*
|
|
4735
|
+
* The resolved input parameters, in order. Properties may pin a value with const
|
|
4736
|
+
* (including {{variable}} references) or provide a description for LLM inference.
|
|
4737
|
+
* Each property may also record selected*input_mode, the editor mode the user
|
|
4738
|
+
* selected ("const_enum", "const_boolean", "const_value", "description_custom", or
|
|
4739
|
+
* "description_preset"); it is stored and returned as-is, used only by the tool
|
|
4740
|
+
* config UI. Omit the key when no mode is recorded; when set, const*_ modes
|
|
4741
|
+
* require a non-empty const, and description\__ modes must omit const entirely.
|
|
4742
|
+
* Each parameter's required list must match the schema returned by the
|
|
4743
|
+
* corresponding step of the get-app-tool-schema loop.
|
|
2262
4744
|
*/
|
|
2263
|
-
|
|
4745
|
+
parameters?: Array<AppTool.Parameter>;
|
|
4746
|
+
/**
|
|
4747
|
+
* Mapping of a dynamic-variable name to the response field (dot-path) it is
|
|
4748
|
+
* populated from. Missing paths are ignored.
|
|
4749
|
+
*/
|
|
4750
|
+
response_variables?: {
|
|
4751
|
+
[key: string]: string;
|
|
4752
|
+
};
|
|
4753
|
+
/**
|
|
4754
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4755
|
+
* conversation. Determines whether the agent would call LLM another time and speak
|
|
4756
|
+
* when the result of the tool is obtained.
|
|
4757
|
+
*/
|
|
4758
|
+
speak_after_execution?: boolean;
|
|
4759
|
+
/**
|
|
4760
|
+
* Only applies to during conversation functions; ignored by the pre/post
|
|
4761
|
+
* conversation. If true, will speak during execution.
|
|
4762
|
+
*/
|
|
4763
|
+
speak_during_execution?: boolean;
|
|
2264
4764
|
}
|
|
2265
|
-
|
|
4765
|
+
namespace AppTool {
|
|
4766
|
+
interface UnionMember0 {
|
|
4767
|
+
mode: 'all';
|
|
4768
|
+
/**
|
|
4769
|
+
* Not used at runtime; stored and returned as-is for the UI.
|
|
4770
|
+
*/
|
|
4771
|
+
fields?: Array<string>;
|
|
4772
|
+
}
|
|
4773
|
+
interface UnionMember1 {
|
|
4774
|
+
/**
|
|
4775
|
+
* The only response fields the agent and the transcript see, as dot-paths into the
|
|
4776
|
+
* response schema returned by get-app-tool-schema. Everything else is dropped.
|
|
4777
|
+
* Selecting a parent keeps its whole subtree. A plain segment traverses arrays
|
|
4778
|
+
* element-wise (deals.properties.amount keeps that field on every deal), while
|
|
4779
|
+
* key[n] selects one element (deals[0].id keeps only the first deal's id); paths
|
|
4780
|
+
* that match nothing contribute nothing.
|
|
4781
|
+
*/
|
|
4782
|
+
fields: Array<string>;
|
|
4783
|
+
mode: 'subset';
|
|
4784
|
+
}
|
|
2266
4785
|
/**
|
|
2267
|
-
*
|
|
4786
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4787
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4788
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4789
|
+
* empty parameter list.
|
|
2268
4790
|
*/
|
|
2269
|
-
|
|
4791
|
+
interface Parameter {
|
|
4792
|
+
/**
|
|
4793
|
+
* The value of properties is an object, where each key is the name of a property
|
|
4794
|
+
* and each value is a schema used to validate that property.
|
|
4795
|
+
*/
|
|
4796
|
+
properties: unknown;
|
|
4797
|
+
/**
|
|
4798
|
+
* Type must be "object" for a JSON Schema object.
|
|
4799
|
+
*/
|
|
4800
|
+
type: 'object';
|
|
4801
|
+
/**
|
|
4802
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
4803
|
+
* its best to generate the required properties in its function arguments. Property
|
|
4804
|
+
* must exist in properties.
|
|
4805
|
+
*/
|
|
4806
|
+
required?: Array<string>;
|
|
4807
|
+
}
|
|
4808
|
+
}
|
|
4809
|
+
interface CustomTool {
|
|
2270
4810
|
/**
|
|
2271
|
-
* Name of the
|
|
4811
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
4812
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
4813
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
4814
|
+
* allowed).
|
|
2272
4815
|
*/
|
|
2273
4816
|
name: string;
|
|
4817
|
+
type: 'custom';
|
|
2274
4818
|
/**
|
|
2275
|
-
*
|
|
4819
|
+
* Describes what the tool does, sometimes can also include information about when
|
|
4820
|
+
* to call the tool.
|
|
2276
4821
|
*/
|
|
2277
|
-
|
|
4822
|
+
url: string;
|
|
2278
4823
|
/**
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2281
|
-
* this is ignored.
|
|
4824
|
+
* If set to true, the parameters will be passed as root level JSON object instead
|
|
4825
|
+
* of nested under "args".
|
|
2282
4826
|
*/
|
|
2283
|
-
|
|
4827
|
+
args_at_root?: boolean;
|
|
2284
4828
|
/**
|
|
2285
|
-
*
|
|
2286
|
-
* will be marked as unsuccessful.
|
|
4829
|
+
* Names of tools that must run before this one.
|
|
2287
4830
|
*/
|
|
2288
|
-
|
|
4831
|
+
depends_on?: Array<string>;
|
|
4832
|
+
/**
|
|
4833
|
+
* Describes what this tool does and when to call this tool.
|
|
4834
|
+
*/
|
|
4835
|
+
description?: string;
|
|
4836
|
+
/**
|
|
4837
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
4838
|
+
* executing. Useful when the tool takes a noticeable amount of time to prevent
|
|
4839
|
+
* silence on the call.
|
|
4840
|
+
*/
|
|
4841
|
+
enable_typing_sound?: boolean;
|
|
4842
|
+
/**
|
|
4843
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
4844
|
+
* when speak_during_execution is true. Can write what to say or even provide
|
|
4845
|
+
* examples. The default is "The message you will say to callee when calling this
|
|
4846
|
+
* tool. Make sure it fits into the conversation smoothly.".
|
|
4847
|
+
*/
|
|
4848
|
+
execution_message_description?: string;
|
|
4849
|
+
/**
|
|
4850
|
+
* Type of execution message. "prompt" means the agent will use
|
|
4851
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4852
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4853
|
+
* to "prompt".
|
|
4854
|
+
*/
|
|
4855
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
4856
|
+
/**
|
|
4857
|
+
* Headers to add to the request.
|
|
4858
|
+
*/
|
|
4859
|
+
headers?: {
|
|
4860
|
+
[key: string]: string;
|
|
4861
|
+
};
|
|
4862
|
+
/**
|
|
4863
|
+
* Maximum number of times to retry the request after a failed attempt, from 0 (no
|
|
4864
|
+
* retry) to 5. Retries happen on any failure, with exponential backoff between
|
|
4865
|
+
* attempts; the backoff delay is not configurable. `timeout_ms` applies per
|
|
4866
|
+
* attempt rather than as a budget across all attempts, so an attempt that times
|
|
4867
|
+
* out is still retried and the worst-case total duration is `timeout_ms`
|
|
4868
|
+
* multiplied by (`max_retry` + 1) as well as any latency incurred by the
|
|
4869
|
+
* exponential backoff + jitter between each retry. Only the final attempt's result
|
|
4870
|
+
* is reported to the agent. Because retries repeat the request, only set this
|
|
4871
|
+
* above 0 if your endpoint is idempotent — a retried request may be processed more
|
|
4872
|
+
* than once. Defaults to 0 (no retry).
|
|
4873
|
+
*/
|
|
4874
|
+
max_retry?: number;
|
|
4875
|
+
/**
|
|
4876
|
+
* Method to use for the request, default to POST.
|
|
4877
|
+
*/
|
|
4878
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
4879
|
+
/**
|
|
4880
|
+
* How the tool's `parameters` are authored and shown in the dashboard editor —
|
|
4881
|
+
* "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
|
|
4882
|
+
* produce the same `parameters` schema; this does not change how the request body
|
|
4883
|
+
* is encoded (see `args_at_root`).
|
|
4884
|
+
*/
|
|
4885
|
+
parameter_type?: 'json' | 'form';
|
|
4886
|
+
/**
|
|
4887
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4888
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4889
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4890
|
+
* empty parameter list.
|
|
4891
|
+
*/
|
|
4892
|
+
parameters?: CustomTool.Parameters;
|
|
4893
|
+
/**
|
|
4894
|
+
* Query parameters to append to the request URL.
|
|
4895
|
+
*/
|
|
4896
|
+
query_params?: {
|
|
4897
|
+
[key: string]: string;
|
|
4898
|
+
};
|
|
4899
|
+
/**
|
|
4900
|
+
* A mapping of variable names to JSON paths in the response body. These values
|
|
4901
|
+
* will be extracted from the response and made available as dynamic variables for
|
|
4902
|
+
* use.
|
|
4903
|
+
*/
|
|
4904
|
+
response_variables?: {
|
|
4905
|
+
[key: string]: string;
|
|
4906
|
+
};
|
|
4907
|
+
/**
|
|
4908
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
4909
|
+
* result of function is obtained. Usually this needs to get turned on so user can
|
|
4910
|
+
* get update for the function call.
|
|
4911
|
+
*/
|
|
4912
|
+
speak_after_execution?: boolean;
|
|
4913
|
+
/**
|
|
4914
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
4915
|
+
* that." when executing the function. Recommend to turn on if your function call
|
|
4916
|
+
* takes over 1s (including network) to complete, so that your agent remains
|
|
4917
|
+
* responsive.
|
|
4918
|
+
*/
|
|
4919
|
+
speak_during_execution?: boolean;
|
|
4920
|
+
/**
|
|
4921
|
+
* The maximum time in milliseconds the tool can run before it's considered
|
|
4922
|
+
* timeout. If the tool times out, the agent would have that info. The minimum
|
|
4923
|
+
* value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
|
|
4924
|
+
* min). By default, this is set to 120,000 ms (2 min).
|
|
4925
|
+
*/
|
|
4926
|
+
timeout_ms?: number;
|
|
2289
4927
|
}
|
|
2290
|
-
|
|
2291
|
-
* System preset for post-call analysis (voice agents). Use in
|
|
2292
|
-
* post_call_analysis_data to override prompts or mark fields optional.
|
|
2293
|
-
*/
|
|
2294
|
-
interface CallPresetAnalysisData {
|
|
4928
|
+
namespace CustomTool {
|
|
2295
4929
|
/**
|
|
2296
|
-
*
|
|
4930
|
+
* The parameters the functions accepts, described as a JSON Schema object. See
|
|
4931
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
4932
|
+
* documentation about the format. Omitting parameters defines a function with an
|
|
4933
|
+
* empty parameter list.
|
|
2297
4934
|
*/
|
|
2298
|
-
|
|
4935
|
+
interface Parameters {
|
|
4936
|
+
/**
|
|
4937
|
+
* The value of properties is an object, where each key is the name of a property
|
|
4938
|
+
* and each value is a schema used to validate that property.
|
|
4939
|
+
*/
|
|
4940
|
+
properties: unknown;
|
|
4941
|
+
/**
|
|
4942
|
+
* Type must be "object" for a JSON Schema object.
|
|
4943
|
+
*/
|
|
4944
|
+
type: 'object';
|
|
4945
|
+
/**
|
|
4946
|
+
* List of names of required property when generating this parameter. LLM will do
|
|
4947
|
+
* its best to generate the required properties in its function arguments. Property
|
|
4948
|
+
* must exist in properties.
|
|
4949
|
+
*/
|
|
4950
|
+
required?: Array<string>;
|
|
4951
|
+
}
|
|
4952
|
+
}
|
|
4953
|
+
interface CodeTool {
|
|
2299
4954
|
/**
|
|
2300
|
-
*
|
|
4955
|
+
* JavaScript code to execute in the sandbox.
|
|
2301
4956
|
*/
|
|
2302
|
-
|
|
4957
|
+
code: string;
|
|
2303
4958
|
/**
|
|
2304
|
-
*
|
|
2305
|
-
*
|
|
4959
|
+
* Name of the tool. Must be unique within all tools available to LLM at any given
|
|
4960
|
+
* time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
|
|
4961
|
+
* 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
|
|
4962
|
+
* allowed).
|
|
2306
4963
|
*/
|
|
2307
|
-
|
|
4964
|
+
name: string;
|
|
4965
|
+
type: 'code';
|
|
2308
4966
|
/**
|
|
2309
|
-
*
|
|
4967
|
+
* Names of tools that must run before this one.
|
|
4968
|
+
*/
|
|
4969
|
+
depends_on?: Array<string>;
|
|
4970
|
+
/**
|
|
4971
|
+
* Describes what this tool does and when to call this tool.
|
|
2310
4972
|
*/
|
|
2311
4973
|
description?: string;
|
|
2312
4974
|
/**
|
|
2313
|
-
* If
|
|
2314
|
-
*
|
|
4975
|
+
* If true, play a typing sound on the agent audio track while this tool is
|
|
4976
|
+
* executing.
|
|
2315
4977
|
*/
|
|
2316
|
-
|
|
4978
|
+
enable_typing_sound?: boolean;
|
|
4979
|
+
/**
|
|
4980
|
+
* The description for the sentence agent say during execution. Only applicable
|
|
4981
|
+
* when speak_during_execution is true.
|
|
4982
|
+
*/
|
|
4983
|
+
execution_message_description?: string;
|
|
4984
|
+
/**
|
|
4985
|
+
* Type of execution message. "prompt" means the agent will use
|
|
4986
|
+
* execution_message_description as a prompt to generate the message. "static_text"
|
|
4987
|
+
* means the agent will speak the execution_message_description directly. Defaults
|
|
4988
|
+
* to "prompt".
|
|
4989
|
+
*/
|
|
4990
|
+
execution_message_type?: 'prompt' | 'static_text';
|
|
4991
|
+
/**
|
|
4992
|
+
* A mapping of variable names to JSON paths in the code execution result. These
|
|
4993
|
+
* mapped values will be extracted and added as dynamic variables.
|
|
4994
|
+
*/
|
|
4995
|
+
response_variables?: {
|
|
4996
|
+
[key: string]: string;
|
|
4997
|
+
};
|
|
4998
|
+
/**
|
|
4999
|
+
* Determines whether the agent would call LLM another time and speak when the
|
|
5000
|
+
* result of function is obtained.
|
|
5001
|
+
*/
|
|
5002
|
+
speak_after_execution?: boolean;
|
|
5003
|
+
/**
|
|
5004
|
+
* Determines whether the agent would say sentence like "One moment, let me check
|
|
5005
|
+
* that." when executing the tool.
|
|
5006
|
+
*/
|
|
5007
|
+
speak_during_execution?: boolean;
|
|
5008
|
+
/**
|
|
5009
|
+
* The maximum time in milliseconds the code can run before it's considered
|
|
5010
|
+
* timeout. Defaults to 30,000 ms (30 s).
|
|
5011
|
+
*/
|
|
5012
|
+
timeout_ms?: number;
|
|
2317
5013
|
}
|
|
2318
5014
|
interface PronunciationDictionary {
|
|
2319
5015
|
/**
|