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.
Files changed (96) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agent.d.mts +3222 -526
  10. package/resources/agent.d.mts.map +1 -1
  11. package/resources/agent.d.ts +3222 -526
  12. package/resources/agent.d.ts.map +1 -1
  13. package/resources/app.d.mts +122 -5
  14. package/resources/app.d.mts.map +1 -1
  15. package/resources/app.d.ts +122 -5
  16. package/resources/app.d.ts.map +1 -1
  17. package/resources/app.js +17 -1
  18. package/resources/app.js.map +1 -1
  19. package/resources/app.mjs +17 -1
  20. package/resources/app.mjs.map +1 -1
  21. package/resources/batch-call.d.mts +912 -13
  22. package/resources/batch-call.d.mts.map +1 -1
  23. package/resources/batch-call.d.ts +912 -13
  24. package/resources/batch-call.d.ts.map +1 -1
  25. package/resources/call.d.mts +7843 -3792
  26. package/resources/call.d.mts.map +1 -1
  27. package/resources/call.d.ts +7843 -3792
  28. package/resources/call.d.ts.map +1 -1
  29. package/resources/call.js +1 -1
  30. package/resources/call.mjs +1 -1
  31. package/resources/chat-agent.d.mts +3125 -453
  32. package/resources/chat-agent.d.mts.map +1 -1
  33. package/resources/chat-agent.d.ts +3125 -453
  34. package/resources/chat-agent.d.ts.map +1 -1
  35. package/resources/chat.d.mts +892 -26
  36. package/resources/chat.d.mts.map +1 -1
  37. package/resources/chat.d.ts +892 -26
  38. package/resources/chat.d.ts.map +1 -1
  39. package/resources/contact.d.mts +162 -20
  40. package/resources/contact.d.mts.map +1 -1
  41. package/resources/contact.d.ts +162 -20
  42. package/resources/contact.d.ts.map +1 -1
  43. package/resources/contact.js +98 -4
  44. package/resources/contact.js.map +1 -1
  45. package/resources/contact.mjs +98 -4
  46. package/resources/contact.mjs.map +1 -1
  47. package/resources/conversation-flow-component.d.mts +3282 -243
  48. package/resources/conversation-flow-component.d.mts.map +1 -1
  49. package/resources/conversation-flow-component.d.ts +3282 -243
  50. package/resources/conversation-flow-component.d.ts.map +1 -1
  51. package/resources/conversation-flow.d.mts +7347 -1269
  52. package/resources/conversation-flow.d.mts.map +1 -1
  53. package/resources/conversation-flow.d.ts +7347 -1269
  54. package/resources/conversation-flow.d.ts.map +1 -1
  55. package/resources/crm.d.mts +37 -5
  56. package/resources/crm.d.mts.map +1 -1
  57. package/resources/crm.d.ts +37 -5
  58. package/resources/crm.d.ts.map +1 -1
  59. package/resources/identity.d.mts +4 -0
  60. package/resources/identity.d.mts.map +1 -1
  61. package/resources/identity.d.ts +4 -0
  62. package/resources/identity.d.ts.map +1 -1
  63. package/resources/index.d.mts +1 -1
  64. package/resources/index.d.mts.map +1 -1
  65. package/resources/index.d.ts +1 -1
  66. package/resources/index.d.ts.map +1 -1
  67. package/resources/index.js.map +1 -1
  68. package/resources/index.mjs.map +1 -1
  69. package/resources/llm.d.mts +867 -9
  70. package/resources/llm.d.mts.map +1 -1
  71. package/resources/llm.d.ts +867 -9
  72. package/resources/llm.d.ts.map +1 -1
  73. package/resources/tests.d.mts +3 -3
  74. package/resources/tests.d.mts.map +1 -1
  75. package/resources/tests.d.ts +3 -3
  76. package/resources/tests.d.ts.map +1 -1
  77. package/src/client.ts +4 -0
  78. package/src/resources/agent.ts +4786 -1504
  79. package/src/resources/app.ts +144 -4
  80. package/src/resources/batch-call.ts +1115 -10
  81. package/src/resources/call.ts +9825 -4806
  82. package/src/resources/chat-agent.ts +3958 -698
  83. package/src/resources/chat.ts +1133 -50
  84. package/src/resources/contact.ts +168 -20
  85. package/src/resources/conversation-flow-component.ts +4466 -191
  86. package/src/resources/conversation-flow.ts +9084 -525
  87. package/src/resources/crm.ts +44 -5
  88. package/src/resources/identity.ts +5 -0
  89. package/src/resources/index.ts +2 -0
  90. package/src/resources/llm.ts +1045 -46
  91. package/src/resources/tests.ts +21 -0
  92. package/src/version.ts +1 -1
  93. package/version.d.mts +1 -1
  94. package/version.d.ts +1 -1
  95. package/version.js +1 -1
  96. package/version.mjs +1 -1
@@ -134,6 +134,14 @@ export interface ChatAgentResponse {
134
134
  * Version that this draft was based on. Null for initial versions.
135
135
  */
136
136
  base_version?: number | null;
137
+ /**
138
+ * Contact memory settings for phone calls and SMS chats. Creating an agent
139
+ * defaults enable_update to false and enable_read to true. Updates only change the
140
+ * supplied flags; omitted flags stay unchanged and an empty object has no effect.
141
+ * Set a flag to false to disable it. The configuration cannot be cleared. Existing
142
+ * agents without this configuration have both disabled.
143
+ */
144
+ contact_memory_config?: ChatAgentResponse.ContactMemoryConfig;
137
145
  /**
138
146
  * Number of days to retain call/chat data before automatic deletion. Must be
139
147
  * between 1 and 730 days. If not set, data is retained forever (no automatic
@@ -194,7 +202,17 @@ export interface ChatAgentResponse {
194
202
  /**
195
203
  * The model to use for post chat analysis. Default to gpt-5.6-terra.
196
204
  */
197
- post_chat_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;
205
+ post_chat_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;
206
+ /**
207
+ * Integration (Agent Functions) tools run as a dependency graph at chat end, after
208
+ * post-chat analysis. Each tool can be gated by a condition. Set to null to clear.
209
+ */
210
+ post_session_tools?: Array<ChatAgentResponse.AppTool | ChatAgentResponse.CustomTool | ChatAgentResponse.CodeTool | ChatAgentResponse.SendSMSTool> | null;
211
+ /**
212
+ * Integration (Agent Functions) tools run as a dependency graph before the chat's
213
+ * first message. Outputs are injected as dynamic variables. Set to null to clear.
214
+ */
215
+ pre_session_tools?: Array<ChatAgentResponse.AppTool | ChatAgentResponse.CustomTool | ChatAgentResponse.CodeTool> | null;
198
216
  /**
199
217
  * The expiration time for the signed url in milliseconds. Only applicable when
200
218
  * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
@@ -271,6 +289,27 @@ export declare namespace ChatAgentResponse {
271
289
  */
272
290
  version?: number | null;
273
291
  }
292
+ /**
293
+ * Contact memory settings for phone calls and SMS chats. Creating an agent
294
+ * defaults enable_update to false and enable_read to true. Updates only change the
295
+ * supplied flags; omitted flags stay unchanged and an empty object has no effect.
296
+ * Set a flag to false to disable it. The configuration cannot be cleared. Existing
297
+ * agents without this configuration have both disabled.
298
+ */
299
+ interface ContactMemoryConfig {
300
+ /**
301
+ * Automatically add saved contact memory to the agent prompt. Skippable nodes can
302
+ * use answers from the current conversation even when this setting is disabled.
303
+ * Contact dynamic variables, including contact_memory, remain available regardless
304
+ * of this setting.
305
+ */
306
+ enable_read?: boolean;
307
+ /**
308
+ * Rewrite the contact memory after each conversation. Requires storing
309
+ * conversation data. Chat agents must also have end_chat_after_silence_ms set.
310
+ */
311
+ enable_update?: boolean;
312
+ }
274
313
  /**
275
314
  * Configuration for guardrail checks to detect and prevent prohibited topics in
276
315
  * agent output and user input.
@@ -461,281 +500,2374 @@ export declare namespace ChatAgentResponse {
461
500
  */
462
501
  required?: boolean;
463
502
  }
464
- }
465
- export interface ChatAgentListResponse {
466
- /**
467
- * Whether more results are available.
468
- */
469
- has_more: boolean;
470
- items: Array<ChatAgentListResponse.Item>;
471
- /**
472
- * Pagination key for the next page.
473
- */
474
- pagination_key?: string;
475
- }
476
- export declare namespace ChatAgentListResponse {
477
- interface Item {
503
+ interface AppTool {
478
504
  /**
479
- * Unique id of agent.
505
+ * The connection (App) this tool runs against. Must be a connection in the
506
+ * organization whose provider matches this tool's provider.
480
507
  */
481
- agent_id: string;
508
+ app_id: string;
482
509
  /**
483
- * The name of the agent. Only used for your own reference.
510
+ * Name of the catalog template within the provider, as listed by
511
+ * list-app-templates.
484
512
  */
485
- agent_name: string;
486
- channel: 'voice' | 'chat';
513
+ app_tool_template_name: string;
487
514
  /**
488
- * Authoritative root tags for this agent, keyed by tag name.
515
+ * Name of the tool. Must be unique within the phase's tools; referenced by
516
+ * depends_on.
489
517
  */
490
- tags: {
491
- [key: string]: Item.Tags;
492
- };
518
+ name: string;
493
519
  /**
494
- * User modification timestamp (milliseconds since epoch). Either the time of last
495
- * update or creation if no updates available.
520
+ * Provider of the connection. Must match the connection's provider; supported
521
+ * providers are listed by list-app-templates.
496
522
  */
497
- user_modified_timestamp: number;
498
- }
499
- namespace Item {
500
- interface Tags {
501
- dynamic_variables?: {
502
- [key: string]: string;
503
- };
504
- version?: number;
505
- }
506
- }
507
- }
508
- export type ChatAgentCreateVersionResponse = AgentAPI.AgentResponse | ChatAgentResponse;
509
- export interface ChatAgentCreateParams {
510
- /**
511
- * The Response Engine to attach to the agent. It is used to generate responses for
512
- * the agent. You need to create a Response Engine first before attaching it to an
513
- * agent.
514
- */
515
- response_engine: ChatAgentCreateParams.ResponseEngineRetellLm | ChatAgentCreateParams.ResponseEngineCustomLm | ChatAgentCreateParams.ResponseEngineConversationFlow;
516
- /**
517
- * The name of the chat agent. Only used for your own reference.
518
- */
519
- agent_name?: string | null;
520
- /**
521
- * Message to display when the chat is automatically closed.
522
- */
523
- auto_close_message?: string | null;
524
- /**
525
- * Number of days to retain call/chat data before automatic deletion. Must be
526
- * between 1 and 730 days. If not set, data is retained forever (no automatic
527
- * deletion).
528
- */
529
- data_storage_retention_days?: number | null;
530
- /**
531
- * Controls what data is stored for this agent. "everything" stores all data
532
- * including transcripts and recordings. "everything_except_pii" stores data but
533
- * excludes PII when possible based on PII configuration. "basic_attributes_only"
534
- * stores only basic metadata. If not set, defaults to "everything".
535
- */
536
- data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
537
- /**
538
- * If users stay silent for a period after agent speech, end the chat. The minimum
539
- * value allowed is 120,000 ms (2 minutes). The maximum value allowed is
540
- * 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
541
- */
542
- end_chat_after_silence_ms?: number | null;
543
- /**
544
- * Configuration for guardrail checks to detect and prevent prohibited topics in
545
- * agent output and user input.
546
- */
547
- guardrail_config?: ChatAgentCreateParams.GuardrailConfig;
548
- /**
549
- * Toggle behavior presets on/off to influence agent response style and behaviors.
550
- * Voice-only presets are not available for chat agents.
551
- */
552
- handbook_config?: ChatAgentCreateParams.HandbookConfig;
553
- /**
554
- * Specifies what language(s) the agent will operate in. Accepts either a single
555
- * locale (e.g. `en-US`) or an array of locales for multilingual agents (e.g.
556
- * `["en-US","es-ES"]`). The scalar value `multi` is deprecated but still accepted
557
- * as a scalar, and is stored and returned as the ten locales it used to mean. It
558
- * must not appear inside the array form. Send an explicit locale array instead. If
559
- * unset, defaults to `en-US`.
560
- */
561
- language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>;
562
- /**
563
- * Whether this agent opts in to signed url for public log. If not set, default
564
- * value of false will apply.
565
- */
566
- opt_in_signed_url?: boolean;
567
- /**
568
- * Configuration for PII scrubbing from transcripts and recordings.
569
- */
570
- pii_config?: ChatAgentCreateParams.PiiConfig;
571
- /**
572
- * Post chat analysis data to extract from the chat. This data will augment the
573
- * pre-defined variables extracted in the chat analysis. This will be available
574
- * after the chat ends.
575
- */
576
- post_chat_analysis_data?: Array<ChatAgentCreateParams.StringAnalysisData | ChatAgentCreateParams.EnumAnalysisData | ChatAgentCreateParams.BooleanAnalysisData | ChatAgentCreateParams.NumberAnalysisData | ChatAgentCreateParams.ChatPresetAnalysisData> | null;
577
- /**
578
- * The model to use for post chat analysis. Default to gpt-5.6-terra.
579
- */
580
- post_chat_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;
581
- /**
582
- * The expiration time for the signed url in milliseconds. Only applicable when
583
- * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
584
- * apply.
585
- */
586
- signed_url_expiration_ms?: number | null;
587
- /**
588
- * IANA timezone for the agent (e.g. America/New_York). Defaults to
589
- * America/Los_Angeles if not set.
590
- */
591
- timezone?: string | null;
592
- /**
593
- * Optional title of the chat agent version. Used for your own reference.
594
- */
595
- version_title?: string | null;
596
- /**
597
- * Which webhook events this agent should receive. If not set, defaults to
598
- * chat_started, chat_ended, chat_analyzed.
599
- */
600
- webhook_events?: Array<'chat_started' | 'chat_ended' | 'chat_analyzed' | 'transcript_updated'> | null;
601
- /**
602
- * The timeout for the webhook in milliseconds. If not set, default value of 10000
603
- * will apply.
604
- */
605
- webhook_timeout_ms?: number;
606
- /**
607
- * The webhook for agent to listen to chat events. See what events it would get at
608
- * [webhook doc](/features/webhook). If set, will binds webhook events for this
609
- * agent to the specified url, and will ignore the account level webhook for this
610
- * agent. Set to `null` to remove webhook url from this agent.
611
- */
612
- webhook_url?: string | null;
613
- }
614
- export declare namespace ChatAgentCreateParams {
615
- interface ResponseEngineRetellLm {
523
+ provider: string;
524
+ type: 'integration_app';
616
525
  /**
617
- * id of the Retell LLM Response Engine.
526
+ * Optional gate; the step only runs when the condition holds. Defaults to always
527
+ * running.
618
528
  */
619
- llm_id: string;
529
+ condition?: AppTool.Condition;
620
530
  /**
621
- * type of the Response Engine.
531
+ * Names of tools that must run before this one.
622
532
  */
623
- type: 'retell-llm';
533
+ depends_on?: Array<string>;
624
534
  /**
625
- * Version of the Retell LLM Response Engine.
535
+ * Only applies to during conversation functions; ignored by the pre/post
536
+ * conversation. Overrides the catalog template's LLM-facing description.
626
537
  */
627
- version?: number | null;
628
- }
629
- interface ResponseEngineCustomLm {
538
+ description?: string;
630
539
  /**
631
- * LLM websocket url of the custom LLM.
540
+ * Only applies to during conversation functions; ignored by the pre/post
541
+ * conversation. If true, play a typing sound on the agent audio track while this
542
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
543
+ * prevent silence on the call.
632
544
  */
633
- llm_websocket_url: string;
545
+ enable_typing_sound?: boolean;
634
546
  /**
635
- * type of the Response Engine.
547
+ * Only applies to during conversation functions; ignored by the pre/post
548
+ * conversation. The message for the agent to speak when executing the tool. Only
549
+ * applicable when speak_during_execution is true.
636
550
  */
637
- type: 'custom-llm';
638
- }
639
- interface ResponseEngineConversationFlow {
551
+ execution_message_description?: string;
640
552
  /**
641
- * ID of the Conversation Flow Response Engine.
553
+ * Only applies to during conversation functions; ignored by the pre/post
554
+ * conversation. Type of execution message. "prompt" means the agent will use
555
+ * execution_message_description as a prompt to generate the message. "static_text"
556
+ * means the agent will speak the execution_message_description directly. Defaults
557
+ * to "prompt".
642
558
  */
643
- conversation_flow_id: string;
559
+ execution_message_type?: 'prompt' | 'static_text';
644
560
  /**
645
- * type of the Response Engine.
561
+ * What the agent and the transcript see of the tool's response. Omit to send the
562
+ * full response. Does not affect response_variables, which are always extracted
563
+ * from the raw response.
646
564
  */
647
- type: 'conversation-flow';
565
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
648
566
  /**
649
- * Version of the Conversation Flow Response Engine.
567
+ * The resolved input parameters, in order. Properties may pin a value with const
568
+ * (including {{variable}} references) or provide a description for LLM inference.
569
+ * Each property may also record selected*input_mode, the editor mode the user
570
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
571
+ * "description_preset"); it is stored and returned as-is, used only by the tool
572
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
573
+ * require a non-empty const, and description\__ modes must omit const entirely.
574
+ * Each parameter's required list must match the schema returned by the
575
+ * corresponding step of the get-app-tool-schema loop.
650
576
  */
651
- version?: number | null;
652
- }
653
- /**
654
- * Configuration for guardrail checks to detect and prevent prohibited topics in
655
- * agent output and user input.
656
- */
657
- interface GuardrailConfig {
577
+ parameters?: Array<AppTool.Parameter>;
658
578
  /**
659
- * Selected prohibited user topic categories to check. When user messages contain
660
- * these topics, the agent will respond with a placeholder message instead of
661
- * processing the request.
579
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
580
+ * populated from. Missing paths are ignored.
662
581
  */
663
- input_topics?: Array<'platform_integrity_jailbreaking'> | null;
582
+ response_variables?: {
583
+ [key: string]: string;
584
+ };
664
585
  /**
665
- * Selected prohibited agent topic categories to check. When agent messages contain
666
- * these topics, they will be replaced with a placeholder message.
586
+ * Only applies to during conversation functions; ignored by the pre/post
587
+ * conversation. Determines whether the agent would call LLM another time and speak
588
+ * when the result of the tool is obtained.
667
589
  */
668
- 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;
669
- }
670
- /**
671
- * Toggle behavior presets on/off to influence agent response style and behaviors.
672
- * Voice-only presets are not available for chat agents.
673
- */
674
- interface HandbookConfig {
590
+ speak_after_execution?: boolean;
675
591
  /**
676
- * When asked, acknowledge being a virtual assistant.
592
+ * Only applies to during conversation functions; ignored by the pre/post
593
+ * conversation. If true, will speak during execution.
677
594
  */
678
- ai_disclosure?: boolean;
595
+ speak_during_execution?: boolean;
596
+ }
597
+ namespace AppTool {
679
598
  /**
680
- * Professional call center rep baseline.
599
+ * Optional gate; the step only runs when the condition holds. Defaults to always
600
+ * running.
681
601
  */
682
- default_personality?: boolean;
602
+ interface Condition {
603
+ equations: Array<Condition.Equation>;
604
+ operator: '||' | '&&';
605
+ type: 'equation';
606
+ }
607
+ namespace Condition {
608
+ interface Equation {
609
+ /**
610
+ * Left side of the equation
611
+ */
612
+ left: string;
613
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
614
+ /**
615
+ * Right side of the equation. The right side of the equation not required when
616
+ * "exists" or "not_exist" are selected.
617
+ */
618
+ right?: string;
619
+ }
620
+ }
621
+ interface UnionMember0 {
622
+ mode: 'all';
623
+ /**
624
+ * Not used at runtime; stored and returned as-is for the UI.
625
+ */
626
+ fields?: Array<string>;
627
+ }
628
+ interface UnionMember1 {
629
+ /**
630
+ * The only response fields the agent and the transcript see, as dot-paths into the
631
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
632
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
633
+ * element-wise (deals.properties.amount keeps that field on every deal), while
634
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
635
+ * that match nothing contribute nothing.
636
+ */
637
+ fields: Array<string>;
638
+ mode: 'subset';
639
+ }
683
640
  /**
684
- * Warm acknowledgment of caller concerns.
641
+ * The parameters the functions accepts, described as a JSON Schema object. See
642
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
643
+ * documentation about the format. Omitting parameters defines a function with an
644
+ * empty parameter list.
685
645
  */
686
- high_empathy?: boolean;
646
+ interface Parameter {
647
+ /**
648
+ * The value of properties is an object, where each key is the name of a property
649
+ * and each value is a schema used to validate that property.
650
+ */
651
+ properties: unknown;
652
+ /**
653
+ * Type must be "object" for a JSON Schema object.
654
+ */
655
+ type: 'object';
656
+ /**
657
+ * List of names of required property when generating this parameter. LLM will do
658
+ * its best to generate the required properties in its function arguments. Property
659
+ * must exist in properties.
660
+ */
661
+ required?: Array<string>;
662
+ }
663
+ }
664
+ interface CustomTool {
687
665
  /**
688
- * Stay within prompt/context scope, don't invent details.
666
+ * Name of the tool. Must be unique within all tools available to LLM at any given
667
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
668
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
669
+ * allowed).
689
670
  */
690
- scope_boundaries?: boolean;
691
- }
692
- /**
693
- * Configuration for PII scrubbing from transcripts and recordings.
694
- */
695
- interface PiiConfig {
671
+ name: string;
672
+ type: 'custom';
696
673
  /**
697
- * List of PII categories to scrub from transcripts and recordings. PII redaction
698
- * is only active when this list is non-empty; an empty array means no PII
699
- * scrubbing is performed.
674
+ * Describes what the tool does, sometimes can also include information about when
675
+ * to call the tool.
700
676
  */
701
- 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'>;
677
+ url: string;
702
678
  /**
703
- * The processing mode for PII scrubbing. Currently only post-call is supported.
679
+ * If set to true, the parameters will be passed as root level JSON object instead
680
+ * of nested under "args".
704
681
  */
705
- mode: 'post_call';
706
- }
707
- interface StringAnalysisData {
682
+ args_at_root?: boolean;
708
683
  /**
709
- * Description of the variable.
684
+ * Optional gate; the step only runs when the condition holds. Defaults to always
685
+ * running.
710
686
  */
711
- description: string;
687
+ condition?: CustomTool.Condition;
712
688
  /**
713
- * Name of the variable.
689
+ * Names of tools that must run before this one.
714
690
  */
715
- name: string;
691
+ depends_on?: Array<string>;
716
692
  /**
717
- * Type of the variable to extract.
693
+ * Describes what this tool does and when to call this tool.
718
694
  */
719
- type: 'string';
695
+ description?: string;
720
696
  /**
721
- * Optional instruction to help decide whether this field needs to be populated in
722
- * the analysis. If not set, the field is always included. If required is true,
723
- * this is ignored.
697
+ * If true, play a typing sound on the agent audio track while this tool is
698
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
699
+ * silence on the call.
724
700
  */
725
- conditional_prompt?: string;
701
+ enable_typing_sound?: boolean;
726
702
  /**
727
- * Examples of the variable value to teach model the style and syntax.
703
+ * The description for the sentence agent say during execution. Only applicable
704
+ * when speak_during_execution is true. Can write what to say or even provide
705
+ * examples. The default is "The message you will say to callee when calling this
706
+ * tool. Make sure it fits into the conversation smoothly.".
728
707
  */
729
- examples?: Array<string>;
708
+ execution_message_description?: string;
730
709
  /**
731
- * Whether this data is required. If true and the data is not extracted, the call
732
- * will be marked as unsuccessful.
710
+ * Type of execution message. "prompt" means the agent will use
711
+ * execution_message_description as a prompt to generate the message. "static_text"
712
+ * means the agent will speak the execution_message_description directly. Defaults
713
+ * to "prompt".
733
714
  */
734
- required?: boolean;
735
- }
736
- interface EnumAnalysisData {
715
+ execution_message_type?: 'prompt' | 'static_text';
737
716
  /**
738
- * The possible values of the variable, must be non empty array.
717
+ * Headers to add to the request.
718
+ */
719
+ headers?: {
720
+ [key: string]: string;
721
+ };
722
+ /**
723
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
724
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
725
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
726
+ * attempt rather than as a budget across all attempts, so an attempt that times
727
+ * out is still retried and the worst-case total duration is `timeout_ms`
728
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
729
+ * exponential backoff + jitter between each retry. Only the final attempt's result
730
+ * is reported to the agent. Because retries repeat the request, only set this
731
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
732
+ * than once. Defaults to 0 (no retry).
733
+ */
734
+ max_retry?: number;
735
+ /**
736
+ * Method to use for the request, default to POST.
737
+ */
738
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
739
+ /**
740
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
741
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
742
+ * produce the same `parameters` schema; this does not change how the request body
743
+ * is encoded (see `args_at_root`).
744
+ */
745
+ parameter_type?: 'json' | 'form';
746
+ /**
747
+ * The parameters the functions accepts, described as a JSON Schema object. See
748
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
749
+ * documentation about the format. Omitting parameters defines a function with an
750
+ * empty parameter list.
751
+ */
752
+ parameters?: CustomTool.Parameters;
753
+ /**
754
+ * Query parameters to append to the request URL.
755
+ */
756
+ query_params?: {
757
+ [key: string]: string;
758
+ };
759
+ /**
760
+ * A mapping of variable names to JSON paths in the response body. These values
761
+ * will be extracted from the response and made available as dynamic variables for
762
+ * use.
763
+ */
764
+ response_variables?: {
765
+ [key: string]: string;
766
+ };
767
+ /**
768
+ * Determines whether the agent would call LLM another time and speak when the
769
+ * result of function is obtained. Usually this needs to get turned on so user can
770
+ * get update for the function call.
771
+ */
772
+ speak_after_execution?: boolean;
773
+ /**
774
+ * Determines whether the agent would say sentence like "One moment, let me check
775
+ * that." when executing the function. Recommend to turn on if your function call
776
+ * takes over 1s (including network) to complete, so that your agent remains
777
+ * responsive.
778
+ */
779
+ speak_during_execution?: boolean;
780
+ /**
781
+ * The maximum time in milliseconds the tool can run before it's considered
782
+ * timeout. If the tool times out, the agent would have that info. The minimum
783
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
784
+ * min). By default, this is set to 120,000 ms (2 min).
785
+ */
786
+ timeout_ms?: number;
787
+ }
788
+ namespace CustomTool {
789
+ /**
790
+ * Optional gate; the step only runs when the condition holds. Defaults to always
791
+ * running.
792
+ */
793
+ interface Condition {
794
+ equations: Array<Condition.Equation>;
795
+ operator: '||' | '&&';
796
+ type: 'equation';
797
+ }
798
+ namespace Condition {
799
+ interface Equation {
800
+ /**
801
+ * Left side of the equation
802
+ */
803
+ left: string;
804
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
805
+ /**
806
+ * Right side of the equation. The right side of the equation not required when
807
+ * "exists" or "not_exist" are selected.
808
+ */
809
+ right?: string;
810
+ }
811
+ }
812
+ /**
813
+ * The parameters the functions accepts, described as a JSON Schema object. See
814
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
815
+ * documentation about the format. Omitting parameters defines a function with an
816
+ * empty parameter list.
817
+ */
818
+ interface Parameters {
819
+ /**
820
+ * The value of properties is an object, where each key is the name of a property
821
+ * and each value is a schema used to validate that property.
822
+ */
823
+ properties: unknown;
824
+ /**
825
+ * Type must be "object" for a JSON Schema object.
826
+ */
827
+ type: 'object';
828
+ /**
829
+ * List of names of required property when generating this parameter. LLM will do
830
+ * its best to generate the required properties in its function arguments. Property
831
+ * must exist in properties.
832
+ */
833
+ required?: Array<string>;
834
+ }
835
+ }
836
+ interface CodeTool {
837
+ /**
838
+ * JavaScript code to execute in the sandbox.
839
+ */
840
+ code: string;
841
+ /**
842
+ * Name of the tool. Must be unique within all tools available to LLM at any given
843
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
844
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
845
+ * allowed).
846
+ */
847
+ name: string;
848
+ type: 'code';
849
+ /**
850
+ * Optional gate; the step only runs when the condition holds. Defaults to always
851
+ * running.
852
+ */
853
+ condition?: CodeTool.Condition;
854
+ /**
855
+ * Names of tools that must run before this one.
856
+ */
857
+ depends_on?: Array<string>;
858
+ /**
859
+ * Describes what this tool does and when to call this tool.
860
+ */
861
+ description?: string;
862
+ /**
863
+ * If true, play a typing sound on the agent audio track while this tool is
864
+ * executing.
865
+ */
866
+ enable_typing_sound?: boolean;
867
+ /**
868
+ * The description for the sentence agent say during execution. Only applicable
869
+ * when speak_during_execution is true.
870
+ */
871
+ execution_message_description?: string;
872
+ /**
873
+ * Type of execution message. "prompt" means the agent will use
874
+ * execution_message_description as a prompt to generate the message. "static_text"
875
+ * means the agent will speak the execution_message_description directly. Defaults
876
+ * to "prompt".
877
+ */
878
+ execution_message_type?: 'prompt' | 'static_text';
879
+ /**
880
+ * A mapping of variable names to JSON paths in the code execution result. These
881
+ * mapped values will be extracted and added as dynamic variables.
882
+ */
883
+ response_variables?: {
884
+ [key: string]: string;
885
+ };
886
+ /**
887
+ * Determines whether the agent would call LLM another time and speak when the
888
+ * result of function is obtained.
889
+ */
890
+ speak_after_execution?: boolean;
891
+ /**
892
+ * Determines whether the agent would say sentence like "One moment, let me check
893
+ * that." when executing the tool.
894
+ */
895
+ speak_during_execution?: boolean;
896
+ /**
897
+ * The maximum time in milliseconds the code can run before it's considered
898
+ * timeout. Defaults to 30,000 ms (30 s).
899
+ */
900
+ timeout_ms?: number;
901
+ }
902
+ namespace CodeTool {
903
+ /**
904
+ * Optional gate; the step only runs when the condition holds. Defaults to always
905
+ * running.
906
+ */
907
+ interface Condition {
908
+ equations: Array<Condition.Equation>;
909
+ operator: '||' | '&&';
910
+ type: 'equation';
911
+ }
912
+ namespace Condition {
913
+ interface Equation {
914
+ /**
915
+ * Left side of the equation
916
+ */
917
+ left: string;
918
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
919
+ /**
920
+ * Right side of the equation. The right side of the equation not required when
921
+ * "exists" or "not_exist" are selected.
922
+ */
923
+ right?: string;
924
+ }
925
+ }
926
+ }
927
+ interface SendSMSTool {
928
+ /**
929
+ * Name of the tool. Must be unique within all tools available to LLM at any given
930
+ * time (general tools + state tools + state edges).
931
+ */
932
+ name: string;
933
+ sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
934
+ type: 'send_sms';
935
+ /**
936
+ * Optional gate; the step only runs when the condition holds. Defaults to always
937
+ * running.
938
+ */
939
+ condition?: SendSMSTool.Condition;
940
+ /**
941
+ * Names of tools that must run before this one.
942
+ */
943
+ depends_on?: Array<string>;
944
+ /**
945
+ * Describes what the tool does, sometimes can also include information about when
946
+ * to call the tool.
947
+ */
948
+ description?: string;
949
+ /**
950
+ * Describes what to say before sending the SMS. Only applicable when
951
+ * speak_during_execution is true.
952
+ */
953
+ execution_message_description?: string;
954
+ /**
955
+ * Type of execution message. "prompt" means the agent will use
956
+ * execution_message_description as a prompt to generate the message. "static_text"
957
+ * means the agent will speak the execution_message_description directly. Defaults
958
+ * to "prompt".
959
+ */
960
+ execution_message_type?: 'prompt' | 'static_text';
961
+ /**
962
+ * If true, the agent will speak a short line before sending the SMS. If omitted,
963
+ * defaults to true (same as end_call / transfer_call tools).
964
+ */
965
+ speak_during_execution?: boolean;
966
+ }
967
+ namespace SendSMSTool {
968
+ interface SMSContentPredefined {
969
+ /**
970
+ * The static message to be sent in the SMS. Can contain dynamic variables.
971
+ */
972
+ text?: string;
973
+ type?: 'predefined';
974
+ }
975
+ interface SMSContentInferred {
976
+ /**
977
+ * The prompt to be used to help infer the SMS content. The model will take the
978
+ * global prompt, the call transcript, and this prompt together to deduce the right
979
+ * message to send. Can contain dynamic variables.
980
+ */
981
+ prompt?: string;
982
+ type?: 'inferred';
983
+ }
984
+ interface SMSContentTemplate {
985
+ /**
986
+ * The template to use for the SMS content. "info_collection" sends a predefined
987
+ * message requesting information from the user.
988
+ */
989
+ template: 'info_collection';
990
+ type: 'template';
991
+ }
992
+ /**
993
+ * Optional gate; the step only runs when the condition holds. Defaults to always
994
+ * running.
995
+ */
996
+ interface Condition {
997
+ equations: Array<Condition.Equation>;
998
+ operator: '||' | '&&';
999
+ type: 'equation';
1000
+ }
1001
+ namespace Condition {
1002
+ interface Equation {
1003
+ /**
1004
+ * Left side of the equation
1005
+ */
1006
+ left: string;
1007
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
1008
+ /**
1009
+ * Right side of the equation. The right side of the equation not required when
1010
+ * "exists" or "not_exist" are selected.
1011
+ */
1012
+ right?: string;
1013
+ }
1014
+ }
1015
+ }
1016
+ interface AppTool {
1017
+ /**
1018
+ * The connection (App) this tool runs against. Must be a connection in the
1019
+ * organization whose provider matches this tool's provider.
1020
+ */
1021
+ app_id: string;
1022
+ /**
1023
+ * Name of the catalog template within the provider, as listed by
1024
+ * list-app-templates.
1025
+ */
1026
+ app_tool_template_name: string;
1027
+ /**
1028
+ * Name of the tool. Must be unique within the phase's tools; referenced by
1029
+ * depends_on.
1030
+ */
1031
+ name: string;
1032
+ /**
1033
+ * Provider of the connection. Must match the connection's provider; supported
1034
+ * providers are listed by list-app-templates.
1035
+ */
1036
+ provider: string;
1037
+ type: 'integration_app';
1038
+ /**
1039
+ * Names of tools that must run before this one.
1040
+ */
1041
+ depends_on?: Array<string>;
1042
+ /**
1043
+ * Only applies to during conversation functions; ignored by the pre/post
1044
+ * conversation. Overrides the catalog template's LLM-facing description.
1045
+ */
1046
+ description?: string;
1047
+ /**
1048
+ * Only applies to during conversation functions; ignored by the pre/post
1049
+ * conversation. If true, play a typing sound on the agent audio track while this
1050
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
1051
+ * prevent silence on the call.
1052
+ */
1053
+ enable_typing_sound?: boolean;
1054
+ /**
1055
+ * Only applies to during conversation functions; ignored by the pre/post
1056
+ * conversation. The message for the agent to speak when executing the tool. Only
1057
+ * applicable when speak_during_execution is true.
1058
+ */
1059
+ execution_message_description?: string;
1060
+ /**
1061
+ * Only applies to during conversation functions; ignored by the pre/post
1062
+ * conversation. 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
+ * What the agent and the transcript see of the tool's response. Omit to send the
1070
+ * full response. Does not affect response_variables, which are always extracted
1071
+ * from the raw response.
1072
+ */
1073
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
1074
+ /**
1075
+ * The resolved input parameters, in order. Properties may pin a value with const
1076
+ * (including {{variable}} references) or provide a description for LLM inference.
1077
+ * Each property may also record selected*input_mode, the editor mode the user
1078
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
1079
+ * "description_preset"); it is stored and returned as-is, used only by the tool
1080
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
1081
+ * require a non-empty const, and description\__ modes must omit const entirely.
1082
+ * Each parameter's required list must match the schema returned by the
1083
+ * corresponding step of the get-app-tool-schema loop.
1084
+ */
1085
+ parameters?: Array<AppTool.Parameter>;
1086
+ /**
1087
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
1088
+ * populated from. Missing paths are ignored.
1089
+ */
1090
+ response_variables?: {
1091
+ [key: string]: string;
1092
+ };
1093
+ /**
1094
+ * Only applies to during conversation functions; ignored by the pre/post
1095
+ * conversation. Determines whether the agent would call LLM another time and speak
1096
+ * when the result of the tool is obtained.
1097
+ */
1098
+ speak_after_execution?: boolean;
1099
+ /**
1100
+ * Only applies to during conversation functions; ignored by the pre/post
1101
+ * conversation. If true, will speak during execution.
1102
+ */
1103
+ speak_during_execution?: boolean;
1104
+ }
1105
+ namespace AppTool {
1106
+ interface UnionMember0 {
1107
+ mode: 'all';
1108
+ /**
1109
+ * Not used at runtime; stored and returned as-is for the UI.
1110
+ */
1111
+ fields?: Array<string>;
1112
+ }
1113
+ interface UnionMember1 {
1114
+ /**
1115
+ * The only response fields the agent and the transcript see, as dot-paths into the
1116
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
1117
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
1118
+ * element-wise (deals.properties.amount keeps that field on every deal), while
1119
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
1120
+ * that match nothing contribute nothing.
1121
+ */
1122
+ fields: Array<string>;
1123
+ mode: 'subset';
1124
+ }
1125
+ /**
1126
+ * The parameters the functions accepts, described as a JSON Schema object. See
1127
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1128
+ * documentation about the format. Omitting parameters defines a function with an
1129
+ * empty parameter list.
1130
+ */
1131
+ interface Parameter {
1132
+ /**
1133
+ * The value of properties is an object, where each key is the name of a property
1134
+ * and each value is a schema used to validate that property.
1135
+ */
1136
+ properties: unknown;
1137
+ /**
1138
+ * Type must be "object" for a JSON Schema object.
1139
+ */
1140
+ type: 'object';
1141
+ /**
1142
+ * List of names of required property when generating this parameter. LLM will do
1143
+ * its best to generate the required properties in its function arguments. Property
1144
+ * must exist in properties.
1145
+ */
1146
+ required?: Array<string>;
1147
+ }
1148
+ }
1149
+ interface CustomTool {
1150
+ /**
1151
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1152
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
1153
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
1154
+ * allowed).
1155
+ */
1156
+ name: string;
1157
+ type: 'custom';
1158
+ /**
1159
+ * Describes what the tool does, sometimes can also include information about when
1160
+ * to call the tool.
1161
+ */
1162
+ url: string;
1163
+ /**
1164
+ * If set to true, the parameters will be passed as root level JSON object instead
1165
+ * of nested under "args".
1166
+ */
1167
+ args_at_root?: boolean;
1168
+ /**
1169
+ * Names of tools that must run before this one.
1170
+ */
1171
+ depends_on?: Array<string>;
1172
+ /**
1173
+ * Describes what this tool does and when to call this tool.
1174
+ */
1175
+ description?: string;
1176
+ /**
1177
+ * If true, play a typing sound on the agent audio track while this tool is
1178
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
1179
+ * silence on the call.
1180
+ */
1181
+ enable_typing_sound?: boolean;
1182
+ /**
1183
+ * The description for the sentence agent say during execution. Only applicable
1184
+ * when speak_during_execution is true. Can write what to say or even provide
1185
+ * examples. The default is "The message you will say to callee when calling this
1186
+ * tool. Make sure it fits into the conversation smoothly.".
1187
+ */
1188
+ execution_message_description?: string;
1189
+ /**
1190
+ * Type of execution message. "prompt" means the agent will use
1191
+ * execution_message_description as a prompt to generate the message. "static_text"
1192
+ * means the agent will speak the execution_message_description directly. Defaults
1193
+ * to "prompt".
1194
+ */
1195
+ execution_message_type?: 'prompt' | 'static_text';
1196
+ /**
1197
+ * Headers to add to the request.
1198
+ */
1199
+ headers?: {
1200
+ [key: string]: string;
1201
+ };
1202
+ /**
1203
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
1204
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
1205
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
1206
+ * attempt rather than as a budget across all attempts, so an attempt that times
1207
+ * out is still retried and the worst-case total duration is `timeout_ms`
1208
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
1209
+ * exponential backoff + jitter between each retry. Only the final attempt's result
1210
+ * is reported to the agent. Because retries repeat the request, only set this
1211
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
1212
+ * than once. Defaults to 0 (no retry).
1213
+ */
1214
+ max_retry?: number;
1215
+ /**
1216
+ * Method to use for the request, default to POST.
1217
+ */
1218
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
1219
+ /**
1220
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
1221
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
1222
+ * produce the same `parameters` schema; this does not change how the request body
1223
+ * is encoded (see `args_at_root`).
1224
+ */
1225
+ parameter_type?: 'json' | 'form';
1226
+ /**
1227
+ * The parameters the functions accepts, described as a JSON Schema object. See
1228
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1229
+ * documentation about the format. Omitting parameters defines a function with an
1230
+ * empty parameter list.
1231
+ */
1232
+ parameters?: CustomTool.Parameters;
1233
+ /**
1234
+ * Query parameters to append to the request URL.
1235
+ */
1236
+ query_params?: {
1237
+ [key: string]: string;
1238
+ };
1239
+ /**
1240
+ * A mapping of variable names to JSON paths in the response body. These values
1241
+ * will be extracted from the response and made available as dynamic variables for
1242
+ * use.
1243
+ */
1244
+ response_variables?: {
1245
+ [key: string]: string;
1246
+ };
1247
+ /**
1248
+ * Determines whether the agent would call LLM another time and speak when the
1249
+ * result of function is obtained. Usually this needs to get turned on so user can
1250
+ * get update for the function call.
1251
+ */
1252
+ speak_after_execution?: boolean;
1253
+ /**
1254
+ * Determines whether the agent would say sentence like "One moment, let me check
1255
+ * that." when executing the function. Recommend to turn on if your function call
1256
+ * takes over 1s (including network) to complete, so that your agent remains
1257
+ * responsive.
1258
+ */
1259
+ speak_during_execution?: boolean;
1260
+ /**
1261
+ * The maximum time in milliseconds the tool can run before it's considered
1262
+ * timeout. If the tool times out, the agent would have that info. The minimum
1263
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
1264
+ * min). By default, this is set to 120,000 ms (2 min).
1265
+ */
1266
+ timeout_ms?: number;
1267
+ }
1268
+ namespace CustomTool {
1269
+ /**
1270
+ * The parameters the functions accepts, described as a JSON Schema object. See
1271
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1272
+ * documentation about the format. Omitting parameters defines a function with an
1273
+ * empty parameter list.
1274
+ */
1275
+ interface Parameters {
1276
+ /**
1277
+ * The value of properties is an object, where each key is the name of a property
1278
+ * and each value is a schema used to validate that property.
1279
+ */
1280
+ properties: unknown;
1281
+ /**
1282
+ * Type must be "object" for a JSON Schema object.
1283
+ */
1284
+ type: 'object';
1285
+ /**
1286
+ * List of names of required property when generating this parameter. LLM will do
1287
+ * its best to generate the required properties in its function arguments. Property
1288
+ * must exist in properties.
1289
+ */
1290
+ required?: Array<string>;
1291
+ }
1292
+ }
1293
+ interface CodeTool {
1294
+ /**
1295
+ * JavaScript code to execute in the sandbox.
1296
+ */
1297
+ code: string;
1298
+ /**
1299
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1300
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
1301
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
1302
+ * allowed).
1303
+ */
1304
+ name: string;
1305
+ type: 'code';
1306
+ /**
1307
+ * Names of tools that must run before this one.
1308
+ */
1309
+ depends_on?: Array<string>;
1310
+ /**
1311
+ * Describes what this tool does and when to call this tool.
1312
+ */
1313
+ description?: string;
1314
+ /**
1315
+ * If true, play a typing sound on the agent audio track while this tool is
1316
+ * executing.
1317
+ */
1318
+ enable_typing_sound?: boolean;
1319
+ /**
1320
+ * The description for the sentence agent say during execution. Only applicable
1321
+ * when speak_during_execution is true.
1322
+ */
1323
+ execution_message_description?: string;
1324
+ /**
1325
+ * Type of execution message. "prompt" means the agent will use
1326
+ * execution_message_description as a prompt to generate the message. "static_text"
1327
+ * means the agent will speak the execution_message_description directly. Defaults
1328
+ * to "prompt".
1329
+ */
1330
+ execution_message_type?: 'prompt' | 'static_text';
1331
+ /**
1332
+ * A mapping of variable names to JSON paths in the code execution result. These
1333
+ * mapped values will be extracted and added as dynamic variables.
1334
+ */
1335
+ response_variables?: {
1336
+ [key: string]: string;
1337
+ };
1338
+ /**
1339
+ * Determines whether the agent would call LLM another time and speak when the
1340
+ * result of function is obtained.
1341
+ */
1342
+ speak_after_execution?: boolean;
1343
+ /**
1344
+ * Determines whether the agent would say sentence like "One moment, let me check
1345
+ * that." when executing the tool.
1346
+ */
1347
+ speak_during_execution?: boolean;
1348
+ /**
1349
+ * The maximum time in milliseconds the code can run before it's considered
1350
+ * timeout. Defaults to 30,000 ms (30 s).
1351
+ */
1352
+ timeout_ms?: number;
1353
+ }
1354
+ }
1355
+ export interface ChatAgentListResponse {
1356
+ /**
1357
+ * Whether more results are available.
1358
+ */
1359
+ has_more: boolean;
1360
+ items: Array<ChatAgentListResponse.Item>;
1361
+ /**
1362
+ * Pagination key for the next page.
1363
+ */
1364
+ pagination_key?: string;
1365
+ }
1366
+ export declare namespace ChatAgentListResponse {
1367
+ interface Item {
1368
+ /**
1369
+ * Unique id of agent.
1370
+ */
1371
+ agent_id: string;
1372
+ /**
1373
+ * The name of the agent. Only used for your own reference.
1374
+ */
1375
+ agent_name: string;
1376
+ channel: 'voice' | 'chat';
1377
+ /**
1378
+ * Authoritative root tags for this agent, keyed by tag name.
1379
+ */
1380
+ tags: {
1381
+ [key: string]: Item.Tags;
1382
+ };
1383
+ /**
1384
+ * User modification timestamp (milliseconds since epoch). Either the time of last
1385
+ * update or creation if no updates available.
1386
+ */
1387
+ user_modified_timestamp: number;
1388
+ }
1389
+ namespace Item {
1390
+ interface Tags {
1391
+ dynamic_variables?: {
1392
+ [key: string]: string;
1393
+ };
1394
+ version?: number;
1395
+ }
1396
+ }
1397
+ }
1398
+ export type ChatAgentCreateVersionResponse = AgentAPI.AgentResponse | ChatAgentResponse;
1399
+ export interface ChatAgentCreateParams {
1400
+ /**
1401
+ * The Response Engine to attach to the agent. It is used to generate responses for
1402
+ * the agent. You need to create a Response Engine first before attaching it to an
1403
+ * agent.
1404
+ */
1405
+ response_engine: ChatAgentCreateParams.ResponseEngineRetellLm | ChatAgentCreateParams.ResponseEngineCustomLm | ChatAgentCreateParams.ResponseEngineConversationFlow;
1406
+ /**
1407
+ * The name of the chat agent. Only used for your own reference.
1408
+ */
1409
+ agent_name?: string | null;
1410
+ /**
1411
+ * Message to display when the chat is automatically closed.
1412
+ */
1413
+ auto_close_message?: string | null;
1414
+ /**
1415
+ * Contact memory settings for phone calls and SMS chats. Creating an agent
1416
+ * defaults enable_update to false and enable_read to true. Updates only change the
1417
+ * supplied flags; omitted flags stay unchanged and an empty object has no effect.
1418
+ * Set a flag to false to disable it. The configuration cannot be cleared. Existing
1419
+ * agents without this configuration have both disabled.
1420
+ */
1421
+ contact_memory_config?: ChatAgentCreateParams.ContactMemoryConfig;
1422
+ /**
1423
+ * Number of days to retain call/chat data before automatic deletion. Must be
1424
+ * between 1 and 730 days. If not set, data is retained forever (no automatic
1425
+ * deletion).
1426
+ */
1427
+ data_storage_retention_days?: number | null;
1428
+ /**
1429
+ * Controls what data is stored for this agent. "everything" stores all data
1430
+ * including transcripts and recordings. "everything_except_pii" stores data but
1431
+ * excludes PII when possible based on PII configuration. "basic_attributes_only"
1432
+ * stores only basic metadata. If not set, defaults to "everything".
1433
+ */
1434
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
1435
+ /**
1436
+ * If users stay silent for a period after agent speech, end the chat. The minimum
1437
+ * value allowed is 120,000 ms (2 minutes). The maximum value allowed is
1438
+ * 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
1439
+ */
1440
+ end_chat_after_silence_ms?: number | null;
1441
+ /**
1442
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
1443
+ * agent output and user input.
1444
+ */
1445
+ guardrail_config?: ChatAgentCreateParams.GuardrailConfig;
1446
+ /**
1447
+ * Toggle behavior presets on/off to influence agent response style and behaviors.
1448
+ * Voice-only presets are not available for chat agents.
1449
+ */
1450
+ handbook_config?: ChatAgentCreateParams.HandbookConfig;
1451
+ /**
1452
+ * Specifies what language(s) the agent will operate in. Accepts either a single
1453
+ * locale (e.g. `en-US`) or an array of locales for multilingual agents (e.g.
1454
+ * `["en-US","es-ES"]`). The scalar value `multi` is deprecated but still accepted
1455
+ * as a scalar, and is stored and returned as the ten locales it used to mean. It
1456
+ * must not appear inside the array form. Send an explicit locale array instead. If
1457
+ * unset, defaults to `en-US`.
1458
+ */
1459
+ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>;
1460
+ /**
1461
+ * Whether this agent opts in to signed url for public log. If not set, default
1462
+ * value of false will apply.
1463
+ */
1464
+ opt_in_signed_url?: boolean;
1465
+ /**
1466
+ * Configuration for PII scrubbing from transcripts and recordings.
1467
+ */
1468
+ pii_config?: ChatAgentCreateParams.PiiConfig;
1469
+ /**
1470
+ * Post chat analysis data to extract from the chat. This data will augment the
1471
+ * pre-defined variables extracted in the chat analysis. This will be available
1472
+ * after the chat ends.
1473
+ */
1474
+ post_chat_analysis_data?: Array<ChatAgentCreateParams.StringAnalysisData | ChatAgentCreateParams.EnumAnalysisData | ChatAgentCreateParams.BooleanAnalysisData | ChatAgentCreateParams.NumberAnalysisData | ChatAgentCreateParams.ChatPresetAnalysisData> | null;
1475
+ /**
1476
+ * The model to use for post chat analysis. Default to gpt-5.6-terra.
1477
+ */
1478
+ post_chat_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;
1479
+ /**
1480
+ * Integration (Agent Functions) tools run as a dependency graph at chat end, after
1481
+ * post-chat analysis. Each tool can be gated by a condition. Set to null to clear.
1482
+ */
1483
+ post_session_tools?: Array<ChatAgentCreateParams.AppTool | ChatAgentCreateParams.CustomTool | ChatAgentCreateParams.CodeTool | ChatAgentCreateParams.SendSMSTool> | null;
1484
+ /**
1485
+ * Integration (Agent Functions) tools run as a dependency graph before the chat's
1486
+ * first message. Outputs are injected as dynamic variables. Set to null to clear.
1487
+ */
1488
+ pre_session_tools?: Array<ChatAgentCreateParams.AppTool | ChatAgentCreateParams.CustomTool | ChatAgentCreateParams.CodeTool> | null;
1489
+ /**
1490
+ * The expiration time for the signed url in milliseconds. Only applicable when
1491
+ * opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will
1492
+ * apply.
1493
+ */
1494
+ signed_url_expiration_ms?: number | null;
1495
+ /**
1496
+ * IANA timezone for the agent (e.g. America/New_York). Defaults to
1497
+ * America/Los_Angeles if not set.
1498
+ */
1499
+ timezone?: string | null;
1500
+ /**
1501
+ * Optional title of the chat agent version. Used for your own reference.
1502
+ */
1503
+ version_title?: string | null;
1504
+ /**
1505
+ * Which webhook events this agent should receive. If not set, defaults to
1506
+ * chat_started, chat_ended, chat_analyzed.
1507
+ */
1508
+ webhook_events?: Array<'chat_started' | 'chat_ended' | 'chat_analyzed' | 'transcript_updated'> | null;
1509
+ /**
1510
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
1511
+ * will apply.
1512
+ */
1513
+ webhook_timeout_ms?: number;
1514
+ /**
1515
+ * The webhook for agent to listen to chat events. See what events it would get at
1516
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
1517
+ * agent to the specified url, and will ignore the account level webhook for this
1518
+ * agent. Set to `null` to remove webhook url from this agent.
1519
+ */
1520
+ webhook_url?: string | null;
1521
+ }
1522
+ export declare namespace ChatAgentCreateParams {
1523
+ interface ResponseEngineRetellLm {
1524
+ /**
1525
+ * id of the Retell LLM Response Engine.
1526
+ */
1527
+ llm_id: string;
1528
+ /**
1529
+ * type of the Response Engine.
1530
+ */
1531
+ type: 'retell-llm';
1532
+ /**
1533
+ * Version of the Retell LLM Response Engine.
1534
+ */
1535
+ version?: number | null;
1536
+ }
1537
+ interface ResponseEngineCustomLm {
1538
+ /**
1539
+ * LLM websocket url of the custom LLM.
1540
+ */
1541
+ llm_websocket_url: string;
1542
+ /**
1543
+ * type of the Response Engine.
1544
+ */
1545
+ type: 'custom-llm';
1546
+ }
1547
+ interface ResponseEngineConversationFlow {
1548
+ /**
1549
+ * ID of the Conversation Flow Response Engine.
1550
+ */
1551
+ conversation_flow_id: string;
1552
+ /**
1553
+ * type of the Response Engine.
1554
+ */
1555
+ type: 'conversation-flow';
1556
+ /**
1557
+ * Version of the Conversation Flow Response Engine.
1558
+ */
1559
+ version?: number | null;
1560
+ }
1561
+ /**
1562
+ * Contact memory settings for phone calls and SMS chats. Creating an agent
1563
+ * defaults enable_update to false and enable_read to true. Updates only change the
1564
+ * supplied flags; omitted flags stay unchanged and an empty object has no effect.
1565
+ * Set a flag to false to disable it. The configuration cannot be cleared. Existing
1566
+ * agents without this configuration have both disabled.
1567
+ */
1568
+ interface ContactMemoryConfig {
1569
+ /**
1570
+ * Automatically add saved contact memory to the agent prompt. Skippable nodes can
1571
+ * use answers from the current conversation even when this setting is disabled.
1572
+ * Contact dynamic variables, including contact_memory, remain available regardless
1573
+ * of this setting.
1574
+ */
1575
+ enable_read?: boolean;
1576
+ /**
1577
+ * Rewrite the contact memory after each conversation. Requires storing
1578
+ * conversation data. Chat agents must also have end_chat_after_silence_ms set.
1579
+ */
1580
+ enable_update?: boolean;
1581
+ }
1582
+ /**
1583
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
1584
+ * agent output and user input.
1585
+ */
1586
+ interface GuardrailConfig {
1587
+ /**
1588
+ * Selected prohibited user topic categories to check. When user messages contain
1589
+ * these topics, the agent will respond with a placeholder message instead of
1590
+ * processing the request.
1591
+ */
1592
+ input_topics?: Array<'platform_integrity_jailbreaking'> | null;
1593
+ /**
1594
+ * Selected prohibited agent topic categories to check. When agent messages contain
1595
+ * these topics, they will be replaced with a placeholder message.
1596
+ */
1597
+ 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;
1598
+ }
1599
+ /**
1600
+ * Toggle behavior presets on/off to influence agent response style and behaviors.
1601
+ * Voice-only presets are not available for chat agents.
1602
+ */
1603
+ interface HandbookConfig {
1604
+ /**
1605
+ * When asked, acknowledge being a virtual assistant.
1606
+ */
1607
+ ai_disclosure?: boolean;
1608
+ /**
1609
+ * Professional call center rep baseline.
1610
+ */
1611
+ default_personality?: boolean;
1612
+ /**
1613
+ * Warm acknowledgment of caller concerns.
1614
+ */
1615
+ high_empathy?: boolean;
1616
+ /**
1617
+ * Stay within prompt/context scope, don't invent details.
1618
+ */
1619
+ scope_boundaries?: boolean;
1620
+ }
1621
+ /**
1622
+ * Configuration for PII scrubbing from transcripts and recordings.
1623
+ */
1624
+ interface PiiConfig {
1625
+ /**
1626
+ * List of PII categories to scrub from transcripts and recordings. PII redaction
1627
+ * is only active when this list is non-empty; an empty array means no PII
1628
+ * scrubbing is performed.
1629
+ */
1630
+ 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'>;
1631
+ /**
1632
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
1633
+ */
1634
+ mode: 'post_call';
1635
+ }
1636
+ interface StringAnalysisData {
1637
+ /**
1638
+ * Description of the variable.
1639
+ */
1640
+ description: string;
1641
+ /**
1642
+ * Name of the variable.
1643
+ */
1644
+ name: string;
1645
+ /**
1646
+ * Type of the variable to extract.
1647
+ */
1648
+ type: 'string';
1649
+ /**
1650
+ * Optional instruction to help decide whether this field needs to be populated in
1651
+ * the analysis. If not set, the field is always included. If required is true,
1652
+ * this is ignored.
1653
+ */
1654
+ conditional_prompt?: string;
1655
+ /**
1656
+ * Examples of the variable value to teach model the style and syntax.
1657
+ */
1658
+ examples?: Array<string>;
1659
+ /**
1660
+ * Whether this data is required. If true and the data is not extracted, the call
1661
+ * will be marked as unsuccessful.
1662
+ */
1663
+ required?: boolean;
1664
+ }
1665
+ interface EnumAnalysisData {
1666
+ /**
1667
+ * The possible values of the variable, must be non empty array.
1668
+ */
1669
+ choices: Array<string>;
1670
+ /**
1671
+ * Description of the variable.
1672
+ */
1673
+ description: string;
1674
+ /**
1675
+ * Name of the variable.
1676
+ */
1677
+ name: string;
1678
+ /**
1679
+ * Type of the variable to extract.
1680
+ */
1681
+ type: 'enum';
1682
+ /**
1683
+ * Optional instruction to help decide whether this field needs to be populated in
1684
+ * the analysis. If not set, the field is always included. If required is true,
1685
+ * this is ignored.
1686
+ */
1687
+ conditional_prompt?: string;
1688
+ /**
1689
+ * Whether this data is required. If true and the data is not extracted, the call
1690
+ * will be marked as unsuccessful.
1691
+ */
1692
+ required?: boolean;
1693
+ }
1694
+ interface BooleanAnalysisData {
1695
+ /**
1696
+ * Description of the variable.
1697
+ */
1698
+ description: string;
1699
+ /**
1700
+ * Name of the variable.
1701
+ */
1702
+ name: string;
1703
+ /**
1704
+ * Type of the variable to extract.
1705
+ */
1706
+ type: 'boolean';
1707
+ /**
1708
+ * Optional instruction to help decide whether this field needs to be populated in
1709
+ * the analysis. If not set, the field is always included. If required is true,
1710
+ * this is ignored.
1711
+ */
1712
+ conditional_prompt?: string;
1713
+ /**
1714
+ * Whether this data is required. If true and the data is not extracted, the call
1715
+ * will be marked as unsuccessful.
1716
+ */
1717
+ required?: boolean;
1718
+ }
1719
+ interface NumberAnalysisData {
1720
+ /**
1721
+ * Description of the variable.
1722
+ */
1723
+ description: string;
1724
+ /**
1725
+ * Name of the variable.
1726
+ */
1727
+ name: string;
1728
+ /**
1729
+ * Type of the variable to extract.
1730
+ */
1731
+ type: 'number';
1732
+ /**
1733
+ * Optional instruction to help decide whether this field needs to be populated in
1734
+ * the analysis. If not set, the field is always included. If required is true,
1735
+ * this is ignored.
1736
+ */
1737
+ conditional_prompt?: string;
1738
+ /**
1739
+ * Whether this data is required. If true and the data is not extracted, the call
1740
+ * will be marked as unsuccessful.
1741
+ */
1742
+ required?: boolean;
1743
+ }
1744
+ /**
1745
+ * System preset for post-chat analysis (chat agents). Use in
1746
+ * post_chat_analysis_data to override prompts or mark fields optional.
1747
+ */
1748
+ interface ChatPresetAnalysisData {
1749
+ /**
1750
+ * Preset identifier for chat agent analysis.
1751
+ */
1752
+ name: 'chat_summary' | 'chat_successful' | 'user_sentiment';
1753
+ /**
1754
+ * Identifies this item as a system preset.
1755
+ */
1756
+ type: 'system-presets';
1757
+ /**
1758
+ * Optional instruction to help decide whether this field needs to be populated. If
1759
+ * not set, the field is always included.
1760
+ */
1761
+ conditional_prompt?: string;
1762
+ /**
1763
+ * Prompt or description for this preset.
1764
+ */
1765
+ description?: string;
1766
+ /**
1767
+ * If false, this field is optional in the analysis. If true or unset, the field is
1768
+ * required.
1769
+ */
1770
+ required?: boolean;
1771
+ }
1772
+ interface AppTool {
1773
+ /**
1774
+ * The connection (App) this tool runs against. Must be a connection in the
1775
+ * organization whose provider matches this tool's provider.
1776
+ */
1777
+ app_id: string;
1778
+ /**
1779
+ * Name of the catalog template within the provider, as listed by
1780
+ * list-app-templates.
1781
+ */
1782
+ app_tool_template_name: string;
1783
+ /**
1784
+ * Name of the tool. Must be unique within the phase's tools; referenced by
1785
+ * depends_on.
1786
+ */
1787
+ name: string;
1788
+ /**
1789
+ * Provider of the connection. Must match the connection's provider; supported
1790
+ * providers are listed by list-app-templates.
1791
+ */
1792
+ provider: string;
1793
+ type: 'integration_app';
1794
+ /**
1795
+ * Optional gate; the step only runs when the condition holds. Defaults to always
1796
+ * running.
1797
+ */
1798
+ condition?: AppTool.Condition;
1799
+ /**
1800
+ * Names of tools that must run before this one.
1801
+ */
1802
+ depends_on?: Array<string>;
1803
+ /**
1804
+ * Only applies to during conversation functions; ignored by the pre/post
1805
+ * conversation. Overrides the catalog template's LLM-facing description.
1806
+ */
1807
+ description?: string;
1808
+ /**
1809
+ * Only applies to during conversation functions; ignored by the pre/post
1810
+ * conversation. If true, play a typing sound on the agent audio track while this
1811
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
1812
+ * prevent silence on the call.
1813
+ */
1814
+ enable_typing_sound?: boolean;
1815
+ /**
1816
+ * Only applies to during conversation functions; ignored by the pre/post
1817
+ * conversation. The message for the agent to speak when executing the tool. Only
1818
+ * applicable when speak_during_execution is true.
1819
+ */
1820
+ execution_message_description?: string;
1821
+ /**
1822
+ * Only applies to during conversation functions; ignored by the pre/post
1823
+ * conversation. Type of execution message. "prompt" means the agent will use
1824
+ * execution_message_description as a prompt to generate the message. "static_text"
1825
+ * means the agent will speak the execution_message_description directly. Defaults
1826
+ * to "prompt".
1827
+ */
1828
+ execution_message_type?: 'prompt' | 'static_text';
1829
+ /**
1830
+ * What the agent and the transcript see of the tool's response. Omit to send the
1831
+ * full response. Does not affect response_variables, which are always extracted
1832
+ * from the raw response.
1833
+ */
1834
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
1835
+ /**
1836
+ * The resolved input parameters, in order. Properties may pin a value with const
1837
+ * (including {{variable}} references) or provide a description for LLM inference.
1838
+ * Each property may also record selected*input_mode, the editor mode the user
1839
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
1840
+ * "description_preset"); it is stored and returned as-is, used only by the tool
1841
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
1842
+ * require a non-empty const, and description\__ modes must omit const entirely.
1843
+ * Each parameter's required list must match the schema returned by the
1844
+ * corresponding step of the get-app-tool-schema loop.
1845
+ */
1846
+ parameters?: Array<AppTool.Parameter>;
1847
+ /**
1848
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
1849
+ * populated from. Missing paths are ignored.
1850
+ */
1851
+ response_variables?: {
1852
+ [key: string]: string;
1853
+ };
1854
+ /**
1855
+ * Only applies to during conversation functions; ignored by the pre/post
1856
+ * conversation. Determines whether the agent would call LLM another time and speak
1857
+ * when the result of the tool is obtained.
1858
+ */
1859
+ speak_after_execution?: boolean;
1860
+ /**
1861
+ * Only applies to during conversation functions; ignored by the pre/post
1862
+ * conversation. If true, will speak during execution.
1863
+ */
1864
+ speak_during_execution?: boolean;
1865
+ }
1866
+ namespace AppTool {
1867
+ /**
1868
+ * Optional gate; the step only runs when the condition holds. Defaults to always
1869
+ * running.
1870
+ */
1871
+ interface Condition {
1872
+ equations: Array<Condition.Equation>;
1873
+ operator: '||' | '&&';
1874
+ type: 'equation';
1875
+ }
1876
+ namespace Condition {
1877
+ interface Equation {
1878
+ /**
1879
+ * Left side of the equation
1880
+ */
1881
+ left: string;
1882
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
1883
+ /**
1884
+ * Right side of the equation. The right side of the equation not required when
1885
+ * "exists" or "not_exist" are selected.
1886
+ */
1887
+ right?: string;
1888
+ }
1889
+ }
1890
+ interface UnionMember0 {
1891
+ mode: 'all';
1892
+ /**
1893
+ * Not used at runtime; stored and returned as-is for the UI.
1894
+ */
1895
+ fields?: Array<string>;
1896
+ }
1897
+ interface UnionMember1 {
1898
+ /**
1899
+ * The only response fields the agent and the transcript see, as dot-paths into the
1900
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
1901
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
1902
+ * element-wise (deals.properties.amount keeps that field on every deal), while
1903
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
1904
+ * that match nothing contribute nothing.
1905
+ */
1906
+ fields: Array<string>;
1907
+ mode: 'subset';
1908
+ }
1909
+ /**
1910
+ * The parameters the functions accepts, described as a JSON Schema object. See
1911
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1912
+ * documentation about the format. Omitting parameters defines a function with an
1913
+ * empty parameter list.
1914
+ */
1915
+ interface Parameter {
1916
+ /**
1917
+ * The value of properties is an object, where each key is the name of a property
1918
+ * and each value is a schema used to validate that property.
1919
+ */
1920
+ properties: unknown;
1921
+ /**
1922
+ * Type must be "object" for a JSON Schema object.
1923
+ */
1924
+ type: 'object';
1925
+ /**
1926
+ * List of names of required property when generating this parameter. LLM will do
1927
+ * its best to generate the required properties in its function arguments. Property
1928
+ * must exist in properties.
1929
+ */
1930
+ required?: Array<string>;
1931
+ }
1932
+ }
1933
+ interface CustomTool {
1934
+ /**
1935
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1936
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
1937
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
1938
+ * allowed).
1939
+ */
1940
+ name: string;
1941
+ type: 'custom';
1942
+ /**
1943
+ * Describes what the tool does, sometimes can also include information about when
1944
+ * to call the tool.
1945
+ */
1946
+ url: string;
1947
+ /**
1948
+ * If set to true, the parameters will be passed as root level JSON object instead
1949
+ * of nested under "args".
1950
+ */
1951
+ args_at_root?: boolean;
1952
+ /**
1953
+ * Optional gate; the step only runs when the condition holds. Defaults to always
1954
+ * running.
1955
+ */
1956
+ condition?: CustomTool.Condition;
1957
+ /**
1958
+ * Names of tools that must run before this one.
1959
+ */
1960
+ depends_on?: Array<string>;
1961
+ /**
1962
+ * Describes what this tool does and when to call this tool.
1963
+ */
1964
+ description?: string;
1965
+ /**
1966
+ * If true, play a typing sound on the agent audio track while this tool is
1967
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
1968
+ * silence on the call.
1969
+ */
1970
+ enable_typing_sound?: boolean;
1971
+ /**
1972
+ * The description for the sentence agent say during execution. Only applicable
1973
+ * when speak_during_execution is true. Can write what to say or even provide
1974
+ * examples. The default is "The message you will say to callee when calling this
1975
+ * tool. Make sure it fits into the conversation smoothly.".
1976
+ */
1977
+ execution_message_description?: string;
1978
+ /**
1979
+ * Type of execution message. "prompt" means the agent will use
1980
+ * execution_message_description as a prompt to generate the message. "static_text"
1981
+ * means the agent will speak the execution_message_description directly. Defaults
1982
+ * to "prompt".
1983
+ */
1984
+ execution_message_type?: 'prompt' | 'static_text';
1985
+ /**
1986
+ * Headers to add to the request.
1987
+ */
1988
+ headers?: {
1989
+ [key: string]: string;
1990
+ };
1991
+ /**
1992
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
1993
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
1994
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
1995
+ * attempt rather than as a budget across all attempts, so an attempt that times
1996
+ * out is still retried and the worst-case total duration is `timeout_ms`
1997
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
1998
+ * exponential backoff + jitter between each retry. Only the final attempt's result
1999
+ * is reported to the agent. Because retries repeat the request, only set this
2000
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
2001
+ * than once. Defaults to 0 (no retry).
2002
+ */
2003
+ max_retry?: number;
2004
+ /**
2005
+ * Method to use for the request, default to POST.
2006
+ */
2007
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
2008
+ /**
2009
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
2010
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
2011
+ * produce the same `parameters` schema; this does not change how the request body
2012
+ * is encoded (see `args_at_root`).
2013
+ */
2014
+ parameter_type?: 'json' | 'form';
2015
+ /**
2016
+ * The parameters the functions accepts, described as a JSON Schema object. See
2017
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
2018
+ * documentation about the format. Omitting parameters defines a function with an
2019
+ * empty parameter list.
2020
+ */
2021
+ parameters?: CustomTool.Parameters;
2022
+ /**
2023
+ * Query parameters to append to the request URL.
2024
+ */
2025
+ query_params?: {
2026
+ [key: string]: string;
2027
+ };
2028
+ /**
2029
+ * A mapping of variable names to JSON paths in the response body. These values
2030
+ * will be extracted from the response and made available as dynamic variables for
2031
+ * use.
2032
+ */
2033
+ response_variables?: {
2034
+ [key: string]: string;
2035
+ };
2036
+ /**
2037
+ * Determines whether the agent would call LLM another time and speak when the
2038
+ * result of function is obtained. Usually this needs to get turned on so user can
2039
+ * get update for the function call.
2040
+ */
2041
+ speak_after_execution?: boolean;
2042
+ /**
2043
+ * Determines whether the agent would say sentence like "One moment, let me check
2044
+ * that." when executing the function. Recommend to turn on if your function call
2045
+ * takes over 1s (including network) to complete, so that your agent remains
2046
+ * responsive.
2047
+ */
2048
+ speak_during_execution?: boolean;
2049
+ /**
2050
+ * The maximum time in milliseconds the tool can run before it's considered
2051
+ * timeout. If the tool times out, the agent would have that info. The minimum
2052
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
2053
+ * min). By default, this is set to 120,000 ms (2 min).
2054
+ */
2055
+ timeout_ms?: number;
2056
+ }
2057
+ namespace CustomTool {
2058
+ /**
2059
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2060
+ * running.
2061
+ */
2062
+ interface Condition {
2063
+ equations: Array<Condition.Equation>;
2064
+ operator: '||' | '&&';
2065
+ type: 'equation';
2066
+ }
2067
+ namespace Condition {
2068
+ interface Equation {
2069
+ /**
2070
+ * Left side of the equation
2071
+ */
2072
+ left: string;
2073
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
2074
+ /**
2075
+ * Right side of the equation. The right side of the equation not required when
2076
+ * "exists" or "not_exist" are selected.
2077
+ */
2078
+ right?: string;
2079
+ }
2080
+ }
2081
+ /**
2082
+ * The parameters the functions accepts, described as a JSON Schema object. See
2083
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
2084
+ * documentation about the format. Omitting parameters defines a function with an
2085
+ * empty parameter list.
2086
+ */
2087
+ interface Parameters {
2088
+ /**
2089
+ * The value of properties is an object, where each key is the name of a property
2090
+ * and each value is a schema used to validate that property.
2091
+ */
2092
+ properties: unknown;
2093
+ /**
2094
+ * Type must be "object" for a JSON Schema object.
2095
+ */
2096
+ type: 'object';
2097
+ /**
2098
+ * List of names of required property when generating this parameter. LLM will do
2099
+ * its best to generate the required properties in its function arguments. Property
2100
+ * must exist in properties.
2101
+ */
2102
+ required?: Array<string>;
2103
+ }
2104
+ }
2105
+ interface CodeTool {
2106
+ /**
2107
+ * JavaScript code to execute in the sandbox.
2108
+ */
2109
+ code: string;
2110
+ /**
2111
+ * Name of the tool. Must be unique within all tools available to LLM at any given
2112
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
2113
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
2114
+ * allowed).
2115
+ */
2116
+ name: string;
2117
+ type: 'code';
2118
+ /**
2119
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2120
+ * running.
2121
+ */
2122
+ condition?: CodeTool.Condition;
2123
+ /**
2124
+ * Names of tools that must run before this one.
2125
+ */
2126
+ depends_on?: Array<string>;
2127
+ /**
2128
+ * Describes what this tool does and when to call this tool.
2129
+ */
2130
+ description?: string;
2131
+ /**
2132
+ * If true, play a typing sound on the agent audio track while this tool is
2133
+ * executing.
2134
+ */
2135
+ enable_typing_sound?: boolean;
2136
+ /**
2137
+ * The description for the sentence agent say during execution. Only applicable
2138
+ * when speak_during_execution is true.
2139
+ */
2140
+ execution_message_description?: string;
2141
+ /**
2142
+ * Type of execution message. "prompt" means the agent will use
2143
+ * execution_message_description as a prompt to generate the message. "static_text"
2144
+ * means the agent will speak the execution_message_description directly. Defaults
2145
+ * to "prompt".
2146
+ */
2147
+ execution_message_type?: 'prompt' | 'static_text';
2148
+ /**
2149
+ * A mapping of variable names to JSON paths in the code execution result. These
2150
+ * mapped values will be extracted and added as dynamic variables.
2151
+ */
2152
+ response_variables?: {
2153
+ [key: string]: string;
2154
+ };
2155
+ /**
2156
+ * Determines whether the agent would call LLM another time and speak when the
2157
+ * result of function is obtained.
2158
+ */
2159
+ speak_after_execution?: boolean;
2160
+ /**
2161
+ * Determines whether the agent would say sentence like "One moment, let me check
2162
+ * that." when executing the tool.
2163
+ */
2164
+ speak_during_execution?: boolean;
2165
+ /**
2166
+ * The maximum time in milliseconds the code can run before it's considered
2167
+ * timeout. Defaults to 30,000 ms (30 s).
2168
+ */
2169
+ timeout_ms?: number;
2170
+ }
2171
+ namespace CodeTool {
2172
+ /**
2173
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2174
+ * running.
2175
+ */
2176
+ interface Condition {
2177
+ equations: Array<Condition.Equation>;
2178
+ operator: '||' | '&&';
2179
+ type: 'equation';
2180
+ }
2181
+ namespace Condition {
2182
+ interface Equation {
2183
+ /**
2184
+ * Left side of the equation
2185
+ */
2186
+ left: string;
2187
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
2188
+ /**
2189
+ * Right side of the equation. The right side of the equation not required when
2190
+ * "exists" or "not_exist" are selected.
2191
+ */
2192
+ right?: string;
2193
+ }
2194
+ }
2195
+ }
2196
+ interface SendSMSTool {
2197
+ /**
2198
+ * Name of the tool. Must be unique within all tools available to LLM at any given
2199
+ * time (general tools + state tools + state edges).
2200
+ */
2201
+ name: string;
2202
+ sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
2203
+ type: 'send_sms';
2204
+ /**
2205
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2206
+ * running.
2207
+ */
2208
+ condition?: SendSMSTool.Condition;
2209
+ /**
2210
+ * Names of tools that must run before this one.
2211
+ */
2212
+ depends_on?: Array<string>;
2213
+ /**
2214
+ * Describes what the tool does, sometimes can also include information about when
2215
+ * to call the tool.
2216
+ */
2217
+ description?: string;
2218
+ /**
2219
+ * Describes what to say before sending the SMS. Only applicable when
2220
+ * speak_during_execution is true.
2221
+ */
2222
+ execution_message_description?: string;
2223
+ /**
2224
+ * Type of execution message. "prompt" means the agent will use
2225
+ * execution_message_description as a prompt to generate the message. "static_text"
2226
+ * means the agent will speak the execution_message_description directly. Defaults
2227
+ * to "prompt".
2228
+ */
2229
+ execution_message_type?: 'prompt' | 'static_text';
2230
+ /**
2231
+ * If true, the agent will speak a short line before sending the SMS. If omitted,
2232
+ * defaults to true (same as end_call / transfer_call tools).
2233
+ */
2234
+ speak_during_execution?: boolean;
2235
+ }
2236
+ namespace SendSMSTool {
2237
+ interface SMSContentPredefined {
2238
+ /**
2239
+ * The static message to be sent in the SMS. Can contain dynamic variables.
2240
+ */
2241
+ text?: string;
2242
+ type?: 'predefined';
2243
+ }
2244
+ interface SMSContentInferred {
2245
+ /**
2246
+ * The prompt to be used to help infer the SMS content. The model will take the
2247
+ * global prompt, the call transcript, and this prompt together to deduce the right
2248
+ * message to send. Can contain dynamic variables.
2249
+ */
2250
+ prompt?: string;
2251
+ type?: 'inferred';
2252
+ }
2253
+ interface SMSContentTemplate {
2254
+ /**
2255
+ * The template to use for the SMS content. "info_collection" sends a predefined
2256
+ * message requesting information from the user.
2257
+ */
2258
+ template: 'info_collection';
2259
+ type: 'template';
2260
+ }
2261
+ /**
2262
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2263
+ * running.
2264
+ */
2265
+ interface Condition {
2266
+ equations: Array<Condition.Equation>;
2267
+ operator: '||' | '&&';
2268
+ type: 'equation';
2269
+ }
2270
+ namespace Condition {
2271
+ interface Equation {
2272
+ /**
2273
+ * Left side of the equation
2274
+ */
2275
+ left: string;
2276
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
2277
+ /**
2278
+ * Right side of the equation. The right side of the equation not required when
2279
+ * "exists" or "not_exist" are selected.
2280
+ */
2281
+ right?: string;
2282
+ }
2283
+ }
2284
+ }
2285
+ interface AppTool {
2286
+ /**
2287
+ * The connection (App) this tool runs against. Must be a connection in the
2288
+ * organization whose provider matches this tool's provider.
2289
+ */
2290
+ app_id: string;
2291
+ /**
2292
+ * Name of the catalog template within the provider, as listed by
2293
+ * list-app-templates.
2294
+ */
2295
+ app_tool_template_name: string;
2296
+ /**
2297
+ * Name of the tool. Must be unique within the phase's tools; referenced by
2298
+ * depends_on.
2299
+ */
2300
+ name: string;
2301
+ /**
2302
+ * Provider of the connection. Must match the connection's provider; supported
2303
+ * providers are listed by list-app-templates.
2304
+ */
2305
+ provider: string;
2306
+ type: 'integration_app';
2307
+ /**
2308
+ * Names of tools that must run before this one.
2309
+ */
2310
+ depends_on?: Array<string>;
2311
+ /**
2312
+ * Only applies to during conversation functions; ignored by the pre/post
2313
+ * conversation. Overrides the catalog template's LLM-facing description.
2314
+ */
2315
+ description?: string;
2316
+ /**
2317
+ * Only applies to during conversation functions; ignored by the pre/post
2318
+ * conversation. If true, play a typing sound on the agent audio track while this
2319
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
2320
+ * prevent silence on the call.
2321
+ */
2322
+ enable_typing_sound?: boolean;
2323
+ /**
2324
+ * Only applies to during conversation functions; ignored by the pre/post
2325
+ * conversation. The message for the agent to speak when executing the tool. Only
2326
+ * applicable when speak_during_execution is true.
2327
+ */
2328
+ execution_message_description?: string;
2329
+ /**
2330
+ * Only applies to during conversation functions; ignored by the pre/post
2331
+ * conversation. Type of execution message. "prompt" means the agent will use
2332
+ * execution_message_description as a prompt to generate the message. "static_text"
2333
+ * means the agent will speak the execution_message_description directly. Defaults
2334
+ * to "prompt".
2335
+ */
2336
+ execution_message_type?: 'prompt' | 'static_text';
2337
+ /**
2338
+ * What the agent and the transcript see of the tool's response. Omit to send the
2339
+ * full response. Does not affect response_variables, which are always extracted
2340
+ * from the raw response.
2341
+ */
2342
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
2343
+ /**
2344
+ * The resolved input parameters, in order. Properties may pin a value with const
2345
+ * (including {{variable}} references) or provide a description for LLM inference.
2346
+ * Each property may also record selected*input_mode, the editor mode the user
2347
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
2348
+ * "description_preset"); it is stored and returned as-is, used only by the tool
2349
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
2350
+ * require a non-empty const, and description\__ modes must omit const entirely.
2351
+ * Each parameter's required list must match the schema returned by the
2352
+ * corresponding step of the get-app-tool-schema loop.
2353
+ */
2354
+ parameters?: Array<AppTool.Parameter>;
2355
+ /**
2356
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
2357
+ * populated from. Missing paths are ignored.
2358
+ */
2359
+ response_variables?: {
2360
+ [key: string]: string;
2361
+ };
2362
+ /**
2363
+ * Only applies to during conversation functions; ignored by the pre/post
2364
+ * conversation. Determines whether the agent would call LLM another time and speak
2365
+ * when the result of the tool is obtained.
2366
+ */
2367
+ speak_after_execution?: boolean;
2368
+ /**
2369
+ * Only applies to during conversation functions; ignored by the pre/post
2370
+ * conversation. If true, will speak during execution.
2371
+ */
2372
+ speak_during_execution?: boolean;
2373
+ }
2374
+ namespace AppTool {
2375
+ interface UnionMember0 {
2376
+ mode: 'all';
2377
+ /**
2378
+ * Not used at runtime; stored and returned as-is for the UI.
2379
+ */
2380
+ fields?: Array<string>;
2381
+ }
2382
+ interface UnionMember1 {
2383
+ /**
2384
+ * The only response fields the agent and the transcript see, as dot-paths into the
2385
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
2386
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
2387
+ * element-wise (deals.properties.amount keeps that field on every deal), while
2388
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
2389
+ * that match nothing contribute nothing.
2390
+ */
2391
+ fields: Array<string>;
2392
+ mode: 'subset';
2393
+ }
2394
+ /**
2395
+ * The parameters the functions accepts, described as a JSON Schema object. See
2396
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
2397
+ * documentation about the format. Omitting parameters defines a function with an
2398
+ * empty parameter list.
2399
+ */
2400
+ interface Parameter {
2401
+ /**
2402
+ * The value of properties is an object, where each key is the name of a property
2403
+ * and each value is a schema used to validate that property.
2404
+ */
2405
+ properties: unknown;
2406
+ /**
2407
+ * Type must be "object" for a JSON Schema object.
2408
+ */
2409
+ type: 'object';
2410
+ /**
2411
+ * List of names of required property when generating this parameter. LLM will do
2412
+ * its best to generate the required properties in its function arguments. Property
2413
+ * must exist in properties.
2414
+ */
2415
+ required?: Array<string>;
2416
+ }
2417
+ }
2418
+ interface CustomTool {
2419
+ /**
2420
+ * Name of the tool. Must be unique within all tools available to LLM at any given
2421
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
2422
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
2423
+ * allowed).
2424
+ */
2425
+ name: string;
2426
+ type: 'custom';
2427
+ /**
2428
+ * Describes what the tool does, sometimes can also include information about when
2429
+ * to call the tool.
2430
+ */
2431
+ url: string;
2432
+ /**
2433
+ * If set to true, the parameters will be passed as root level JSON object instead
2434
+ * of nested under "args".
2435
+ */
2436
+ args_at_root?: boolean;
2437
+ /**
2438
+ * Names of tools that must run before this one.
2439
+ */
2440
+ depends_on?: Array<string>;
2441
+ /**
2442
+ * Describes what this tool does and when to call this tool.
2443
+ */
2444
+ description?: string;
2445
+ /**
2446
+ * If true, play a typing sound on the agent audio track while this tool is
2447
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
2448
+ * silence on the call.
2449
+ */
2450
+ enable_typing_sound?: boolean;
2451
+ /**
2452
+ * The description for the sentence agent say during execution. Only applicable
2453
+ * when speak_during_execution is true. Can write what to say or even provide
2454
+ * examples. The default is "The message you will say to callee when calling this
2455
+ * tool. Make sure it fits into the conversation smoothly.".
2456
+ */
2457
+ execution_message_description?: string;
2458
+ /**
2459
+ * Type of execution message. "prompt" means the agent will use
2460
+ * execution_message_description as a prompt to generate the message. "static_text"
2461
+ * means the agent will speak the execution_message_description directly. Defaults
2462
+ * to "prompt".
2463
+ */
2464
+ execution_message_type?: 'prompt' | 'static_text';
2465
+ /**
2466
+ * Headers to add to the request.
2467
+ */
2468
+ headers?: {
2469
+ [key: string]: string;
2470
+ };
2471
+ /**
2472
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
2473
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
2474
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
2475
+ * attempt rather than as a budget across all attempts, so an attempt that times
2476
+ * out is still retried and the worst-case total duration is `timeout_ms`
2477
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
2478
+ * exponential backoff + jitter between each retry. Only the final attempt's result
2479
+ * is reported to the agent. Because retries repeat the request, only set this
2480
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
2481
+ * than once. Defaults to 0 (no retry).
2482
+ */
2483
+ max_retry?: number;
2484
+ /**
2485
+ * Method to use for the request, default to POST.
2486
+ */
2487
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
2488
+ /**
2489
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
2490
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
2491
+ * produce the same `parameters` schema; this does not change how the request body
2492
+ * is encoded (see `args_at_root`).
2493
+ */
2494
+ parameter_type?: 'json' | 'form';
2495
+ /**
2496
+ * The parameters the functions accepts, described as a JSON Schema object. See
2497
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
2498
+ * documentation about the format. Omitting parameters defines a function with an
2499
+ * empty parameter list.
2500
+ */
2501
+ parameters?: CustomTool.Parameters;
2502
+ /**
2503
+ * Query parameters to append to the request URL.
2504
+ */
2505
+ query_params?: {
2506
+ [key: string]: string;
2507
+ };
2508
+ /**
2509
+ * A mapping of variable names to JSON paths in the response body. These values
2510
+ * will be extracted from the response and made available as dynamic variables for
2511
+ * use.
2512
+ */
2513
+ response_variables?: {
2514
+ [key: string]: string;
2515
+ };
2516
+ /**
2517
+ * Determines whether the agent would call LLM another time and speak when the
2518
+ * result of function is obtained. Usually this needs to get turned on so user can
2519
+ * get update for the function call.
2520
+ */
2521
+ speak_after_execution?: boolean;
2522
+ /**
2523
+ * Determines whether the agent would say sentence like "One moment, let me check
2524
+ * that." when executing the function. Recommend to turn on if your function call
2525
+ * takes over 1s (including network) to complete, so that your agent remains
2526
+ * responsive.
2527
+ */
2528
+ speak_during_execution?: boolean;
2529
+ /**
2530
+ * The maximum time in milliseconds the tool can run before it's considered
2531
+ * timeout. If the tool times out, the agent would have that info. The minimum
2532
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
2533
+ * min). By default, this is set to 120,000 ms (2 min).
2534
+ */
2535
+ timeout_ms?: number;
2536
+ }
2537
+ namespace CustomTool {
2538
+ /**
2539
+ * The parameters the functions accepts, described as a JSON Schema object. See
2540
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
2541
+ * documentation about the format. Omitting parameters defines a function with an
2542
+ * empty parameter list.
2543
+ */
2544
+ interface Parameters {
2545
+ /**
2546
+ * The value of properties is an object, where each key is the name of a property
2547
+ * and each value is a schema used to validate that property.
2548
+ */
2549
+ properties: unknown;
2550
+ /**
2551
+ * Type must be "object" for a JSON Schema object.
2552
+ */
2553
+ type: 'object';
2554
+ /**
2555
+ * List of names of required property when generating this parameter. LLM will do
2556
+ * its best to generate the required properties in its function arguments. Property
2557
+ * must exist in properties.
2558
+ */
2559
+ required?: Array<string>;
2560
+ }
2561
+ }
2562
+ interface CodeTool {
2563
+ /**
2564
+ * JavaScript code to execute in the sandbox.
2565
+ */
2566
+ code: string;
2567
+ /**
2568
+ * Name of the tool. Must be unique within all tools available to LLM at any given
2569
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
2570
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
2571
+ * allowed).
2572
+ */
2573
+ name: string;
2574
+ type: 'code';
2575
+ /**
2576
+ * Names of tools that must run before this one.
2577
+ */
2578
+ depends_on?: Array<string>;
2579
+ /**
2580
+ * Describes what this tool does and when to call this tool.
2581
+ */
2582
+ description?: string;
2583
+ /**
2584
+ * If true, play a typing sound on the agent audio track while this tool is
2585
+ * executing.
2586
+ */
2587
+ enable_typing_sound?: boolean;
2588
+ /**
2589
+ * The description for the sentence agent say during execution. Only applicable
2590
+ * when speak_during_execution is true.
2591
+ */
2592
+ execution_message_description?: string;
2593
+ /**
2594
+ * Type of execution message. "prompt" means the agent will use
2595
+ * execution_message_description as a prompt to generate the message. "static_text"
2596
+ * means the agent will speak the execution_message_description directly. Defaults
2597
+ * to "prompt".
2598
+ */
2599
+ execution_message_type?: 'prompt' | 'static_text';
2600
+ /**
2601
+ * A mapping of variable names to JSON paths in the code execution result. These
2602
+ * mapped values will be extracted and added as dynamic variables.
2603
+ */
2604
+ response_variables?: {
2605
+ [key: string]: string;
2606
+ };
2607
+ /**
2608
+ * Determines whether the agent would call LLM another time and speak when the
2609
+ * result of function is obtained.
2610
+ */
2611
+ speak_after_execution?: boolean;
2612
+ /**
2613
+ * Determines whether the agent would say sentence like "One moment, let me check
2614
+ * that." when executing the tool.
2615
+ */
2616
+ speak_during_execution?: boolean;
2617
+ /**
2618
+ * The maximum time in milliseconds the code can run before it's considered
2619
+ * timeout. Defaults to 30,000 ms (30 s).
2620
+ */
2621
+ timeout_ms?: number;
2622
+ }
2623
+ }
2624
+ export interface ChatAgentRetrieveParams {
2625
+ /**
2626
+ * Optional version of the API to use for this request. If not provided, will
2627
+ * default to latest version.
2628
+ */
2629
+ version?: string | number;
2630
+ }
2631
+ export interface ChatAgentUpdateParams {
2632
+ /**
2633
+ * Query param: Optional version of the API to use for this request. Default to
2634
+ * latest version.
2635
+ */
2636
+ version?: string | number;
2637
+ /**
2638
+ * Body param: The name of the chat agent. Only used for your own reference.
2639
+ */
2640
+ agent_name?: string | null;
2641
+ /**
2642
+ * Body param: Message to display when the chat is automatically closed.
2643
+ */
2644
+ auto_close_message?: string | null;
2645
+ /**
2646
+ * Body param: Contact memory settings for phone calls and SMS chats. Creating an
2647
+ * agent defaults enable_update to false and enable_read to true. Updates only
2648
+ * change the supplied flags; omitted flags stay unchanged and an empty object has
2649
+ * no effect. Set a flag to false to disable it. The configuration cannot be
2650
+ * cleared. Existing agents without this configuration have both disabled.
2651
+ */
2652
+ contact_memory_config?: ChatAgentUpdateParams.ContactMemoryConfig;
2653
+ /**
2654
+ * Body param: Number of days to retain call/chat data before automatic deletion.
2655
+ * Must be between 1 and 730 days. If not set, data is retained forever (no
2656
+ * automatic deletion).
2657
+ */
2658
+ data_storage_retention_days?: number | null;
2659
+ /**
2660
+ * Body param: Controls what data is stored for this agent. "everything" stores all
2661
+ * data including transcripts and recordings. "everything_except_pii" stores data
2662
+ * but excludes PII when possible based on PII configuration.
2663
+ * "basic_attributes_only" stores only basic metadata. If not set, defaults to
2664
+ * "everything".
2665
+ */
2666
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
2667
+ /**
2668
+ * Body param: If users stay silent for a period after agent speech, end the chat.
2669
+ * The minimum value allowed is 120,000 ms (2 minutes). The maximum value allowed
2670
+ * is 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
2671
+ */
2672
+ end_chat_after_silence_ms?: number | null;
2673
+ /**
2674
+ * Body param: Configuration for guardrail checks to detect and prevent prohibited
2675
+ * topics in agent output and user input.
2676
+ */
2677
+ guardrail_config?: ChatAgentUpdateParams.GuardrailConfig;
2678
+ /**
2679
+ * Body param: Toggle behavior presets on/off to influence agent response style and
2680
+ * behaviors. Voice-only presets are not available for chat agents.
2681
+ */
2682
+ handbook_config?: ChatAgentUpdateParams.HandbookConfig;
2683
+ /**
2684
+ * Body param: Specifies what language(s) the agent will operate in. Accepts either
2685
+ * a single locale (e.g. `en-US`) or an array of locales for multilingual agents
2686
+ * (e.g. `["en-US","es-ES"]`). The scalar value `multi` is deprecated but still
2687
+ * accepted as a scalar, and is stored and returned as the ten locales it used to
2688
+ * mean. It must not appear inside the array form. Send an explicit locale array
2689
+ * instead. If unset, defaults to `en-US`.
2690
+ */
2691
+ language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>;
2692
+ /**
2693
+ * Body param: Whether this agent opts in to signed url for public log. If not set,
2694
+ * default value of false will apply.
2695
+ */
2696
+ opt_in_signed_url?: boolean;
2697
+ /**
2698
+ * Body param: Configuration for PII scrubbing from transcripts and recordings.
2699
+ */
2700
+ pii_config?: ChatAgentUpdateParams.PiiConfig;
2701
+ /**
2702
+ * Body param: Post chat analysis data to extract from the chat. This data will
2703
+ * augment the pre-defined variables extracted in the chat analysis. This will be
2704
+ * available after the chat ends.
2705
+ */
2706
+ post_chat_analysis_data?: Array<ChatAgentUpdateParams.StringAnalysisData | ChatAgentUpdateParams.EnumAnalysisData | ChatAgentUpdateParams.BooleanAnalysisData | ChatAgentUpdateParams.NumberAnalysisData | ChatAgentUpdateParams.ChatPresetAnalysisData> | null;
2707
+ /**
2708
+ * Body param: The model to use for post chat analysis. Default to gpt-5.6-terra.
2709
+ */
2710
+ post_chat_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;
2711
+ /**
2712
+ * Body param: Integration (Agent Functions) tools run as a dependency graph at
2713
+ * chat end, after post-chat analysis. Each tool can be gated by a condition. Set
2714
+ * to null to clear.
2715
+ */
2716
+ post_session_tools?: Array<ChatAgentUpdateParams.AppTool | ChatAgentUpdateParams.CustomTool | ChatAgentUpdateParams.CodeTool | ChatAgentUpdateParams.SendSMSTool> | null;
2717
+ /**
2718
+ * Body param: Integration (Agent Functions) tools run as a dependency graph before
2719
+ * the chat's first message. Outputs are injected as dynamic variables. Set to null
2720
+ * to clear.
2721
+ */
2722
+ pre_session_tools?: Array<ChatAgentUpdateParams.AppTool | ChatAgentUpdateParams.CustomTool | ChatAgentUpdateParams.CodeTool> | null;
2723
+ /**
2724
+ * Body param: The Response Engine to attach to the agent. It is used to generate
2725
+ * responses for the agent. You need to create a Response Engine first before
2726
+ * attaching it to an agent.
2727
+ */
2728
+ response_engine?: ChatAgentUpdateParams.ResponseEngineRetellLm | ChatAgentUpdateParams.ResponseEngineCustomLm | ChatAgentUpdateParams.ResponseEngineConversationFlow;
2729
+ /**
2730
+ * Body param: The expiration time for the signed url in milliseconds. Only
2731
+ * applicable when opt_in_signed_url is true. If not set, default value of 86400000
2732
+ * (24 hours) will apply.
2733
+ */
2734
+ signed_url_expiration_ms?: number | null;
2735
+ /**
2736
+ * Body param: IANA timezone for the agent (e.g. America/New_York). Defaults to
2737
+ * America/Los_Angeles if not set.
2738
+ */
2739
+ timezone?: string | null;
2740
+ /**
2741
+ * Body param: Optional title of the chat agent version. Used for your own
2742
+ * reference.
2743
+ */
2744
+ version_title?: string | null;
2745
+ /**
2746
+ * Body param: Which webhook events this agent should receive. If not set, defaults
2747
+ * to chat_started, chat_ended, chat_analyzed.
2748
+ */
2749
+ webhook_events?: Array<'chat_started' | 'chat_ended' | 'chat_analyzed' | 'transcript_updated'> | null;
2750
+ /**
2751
+ * Body param: The timeout for the webhook in milliseconds. If not set, default
2752
+ * value of 10000 will apply.
2753
+ */
2754
+ webhook_timeout_ms?: number;
2755
+ /**
2756
+ * Body param: The webhook for agent to listen to chat events. See what events it
2757
+ * would get at [webhook doc](/features/webhook). If set, will binds webhook events
2758
+ * for this agent to the specified url, and will ignore the account level webhook
2759
+ * for this agent. Set to `null` to remove webhook url from this agent.
2760
+ */
2761
+ webhook_url?: string | null;
2762
+ }
2763
+ export declare namespace ChatAgentUpdateParams {
2764
+ /**
2765
+ * Contact memory settings for phone calls and SMS chats. Creating an agent
2766
+ * defaults enable_update to false and enable_read to true. Updates only change the
2767
+ * supplied flags; omitted flags stay unchanged and an empty object has no effect.
2768
+ * Set a flag to false to disable it. The configuration cannot be cleared. Existing
2769
+ * agents without this configuration have both disabled.
2770
+ */
2771
+ interface ContactMemoryConfig {
2772
+ /**
2773
+ * Automatically add saved contact memory to the agent prompt. Skippable nodes can
2774
+ * use answers from the current conversation even when this setting is disabled.
2775
+ * Contact dynamic variables, including contact_memory, remain available regardless
2776
+ * of this setting.
2777
+ */
2778
+ enable_read?: boolean;
2779
+ /**
2780
+ * Rewrite the contact memory after each conversation. Requires storing
2781
+ * conversation data. Chat agents must also have end_chat_after_silence_ms set.
2782
+ */
2783
+ enable_update?: boolean;
2784
+ }
2785
+ /**
2786
+ * Configuration for guardrail checks to detect and prevent prohibited topics in
2787
+ * agent output and user input.
2788
+ */
2789
+ interface GuardrailConfig {
2790
+ /**
2791
+ * Selected prohibited user topic categories to check. When user messages contain
2792
+ * these topics, the agent will respond with a placeholder message instead of
2793
+ * processing the request.
2794
+ */
2795
+ input_topics?: Array<'platform_integrity_jailbreaking'> | null;
2796
+ /**
2797
+ * Selected prohibited agent topic categories to check. When agent messages contain
2798
+ * these topics, they will be replaced with a placeholder message.
2799
+ */
2800
+ 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;
2801
+ }
2802
+ /**
2803
+ * Toggle behavior presets on/off to influence agent response style and behaviors.
2804
+ * Voice-only presets are not available for chat agents.
2805
+ */
2806
+ interface HandbookConfig {
2807
+ /**
2808
+ * When asked, acknowledge being a virtual assistant.
2809
+ */
2810
+ ai_disclosure?: boolean;
2811
+ /**
2812
+ * Professional call center rep baseline.
2813
+ */
2814
+ default_personality?: boolean;
2815
+ /**
2816
+ * Warm acknowledgment of caller concerns.
2817
+ */
2818
+ high_empathy?: boolean;
2819
+ /**
2820
+ * Stay within prompt/context scope, don't invent details.
2821
+ */
2822
+ scope_boundaries?: boolean;
2823
+ }
2824
+ /**
2825
+ * Configuration for PII scrubbing from transcripts and recordings.
2826
+ */
2827
+ interface PiiConfig {
2828
+ /**
2829
+ * List of PII categories to scrub from transcripts and recordings. PII redaction
2830
+ * is only active when this list is non-empty; an empty array means no PII
2831
+ * scrubbing is performed.
2832
+ */
2833
+ 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'>;
2834
+ /**
2835
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
2836
+ */
2837
+ mode: 'post_call';
2838
+ }
2839
+ interface StringAnalysisData {
2840
+ /**
2841
+ * Description of the variable.
2842
+ */
2843
+ description: string;
2844
+ /**
2845
+ * Name of the variable.
2846
+ */
2847
+ name: string;
2848
+ /**
2849
+ * Type of the variable to extract.
2850
+ */
2851
+ type: 'string';
2852
+ /**
2853
+ * Optional instruction to help decide whether this field needs to be populated in
2854
+ * the analysis. If not set, the field is always included. If required is true,
2855
+ * this is ignored.
2856
+ */
2857
+ conditional_prompt?: string;
2858
+ /**
2859
+ * Examples of the variable value to teach model the style and syntax.
2860
+ */
2861
+ examples?: Array<string>;
2862
+ /**
2863
+ * Whether this data is required. If true and the data is not extracted, the call
2864
+ * will be marked as unsuccessful.
2865
+ */
2866
+ required?: boolean;
2867
+ }
2868
+ interface EnumAnalysisData {
2869
+ /**
2870
+ * The possible values of the variable, must be non empty array.
739
2871
  */
740
2872
  choices: Array<string>;
741
2873
  /**
@@ -840,316 +2972,856 @@ export declare namespace ChatAgentCreateParams {
840
2972
  */
841
2973
  required?: boolean;
842
2974
  }
843
- }
844
- export interface ChatAgentRetrieveParams {
845
- /**
846
- * Optional version of the API to use for this request. If not provided, will
847
- * default to latest version.
848
- */
849
- version?: string | number;
850
- }
851
- export interface ChatAgentUpdateParams {
852
- /**
853
- * Query param: Optional version of the API to use for this request. Default to
854
- * latest version.
855
- */
856
- version?: string | number;
857
- /**
858
- * Body param: The name of the chat agent. Only used for your own reference.
859
- */
860
- agent_name?: string | null;
861
- /**
862
- * Body param: Message to display when the chat is automatically closed.
863
- */
864
- auto_close_message?: string | null;
865
- /**
866
- * Body param: Number of days to retain call/chat data before automatic deletion.
867
- * Must be between 1 and 730 days. If not set, data is retained forever (no
868
- * automatic deletion).
869
- */
870
- data_storage_retention_days?: number | null;
871
- /**
872
- * Body param: Controls what data is stored for this agent. "everything" stores all
873
- * data including transcripts and recordings. "everything_except_pii" stores data
874
- * but excludes PII when possible based on PII configuration.
875
- * "basic_attributes_only" stores only basic metadata. If not set, defaults to
876
- * "everything".
877
- */
878
- data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
879
- /**
880
- * Body param: If users stay silent for a period after agent speech, end the chat.
881
- * The minimum value allowed is 120,000 ms (2 minutes). The maximum value allowed
882
- * is 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
883
- */
884
- end_chat_after_silence_ms?: number | null;
885
- /**
886
- * Body param: Configuration for guardrail checks to detect and prevent prohibited
887
- * topics in agent output and user input.
888
- */
889
- guardrail_config?: ChatAgentUpdateParams.GuardrailConfig;
890
- /**
891
- * Body param: Toggle behavior presets on/off to influence agent response style and
892
- * behaviors. Voice-only presets are not available for chat agents.
893
- */
894
- handbook_config?: ChatAgentUpdateParams.HandbookConfig;
895
- /**
896
- * Body param: Specifies what language(s) the agent will operate in. Accepts either
897
- * a single locale (e.g. `en-US`) or an array of locales for multilingual agents
898
- * (e.g. `["en-US","es-ES"]`). The scalar value `multi` is deprecated but still
899
- * accepted as a scalar, and is stored and returned as the ten locales it used to
900
- * mean. It must not appear inside the array form. Send an explicit locale array
901
- * instead. If unset, defaults to `en-US`.
902
- */
903
- language?: 'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA' | 'multi' | Array<'en-US' | 'en-IN' | 'en-GB' | 'en-AU' | 'en-NZ' | 'de-DE' | 'es-ES' | 'es-419' | 'hi-IN' | 'fr-FR' | 'fr-CA' | 'ja-JP' | 'pt-PT' | 'pt-BR' | 'zh-CN' | 'ru-RU' | 'it-IT' | 'ko-KR' | 'nl-NL' | 'nl-BE' | 'pl-PL' | 'tr-TR' | 'vi-VN' | 'ro-RO' | 'bg-BG' | 'ca-ES' | 'th-TH' | 'da-DK' | 'fi-FI' | 'el-GR' | 'hu-HU' | 'id-ID' | 'no-NO' | 'sk-SK' | 'sv-SE' | 'lt-LT' | 'lv-LV' | 'cs-CZ' | 'ms-MY' | 'af-ZA' | 'ar-SA' | 'az-AZ' | 'bs-BA' | 'cy-GB' | 'fa-IR' | 'fil-PH' | 'gl-ES' | 'he-IL' | 'hr-HR' | 'hy-AM' | 'is-IS' | 'kk-KZ' | 'kn-IN' | 'mk-MK' | 'mr-IN' | 'ne-NP' | 'sl-SI' | 'sr-RS' | 'sw-KE' | 'ta-IN' | 'ur-IN' | 'yue-CN' | 'uk-UA'>;
904
- /**
905
- * Body param: Whether this agent opts in to signed url for public log. If not set,
906
- * default value of false will apply.
907
- */
908
- opt_in_signed_url?: boolean;
909
- /**
910
- * Body param: Configuration for PII scrubbing from transcripts and recordings.
911
- */
912
- pii_config?: ChatAgentUpdateParams.PiiConfig;
913
- /**
914
- * Body param: Post chat analysis data to extract from the chat. This data will
915
- * augment the pre-defined variables extracted in the chat analysis. This will be
916
- * available after the chat ends.
917
- */
918
- post_chat_analysis_data?: Array<ChatAgentUpdateParams.StringAnalysisData | ChatAgentUpdateParams.EnumAnalysisData | ChatAgentUpdateParams.BooleanAnalysisData | ChatAgentUpdateParams.NumberAnalysisData | ChatAgentUpdateParams.ChatPresetAnalysisData> | null;
919
- /**
920
- * Body param: The model to use for post chat analysis. Default to gpt-5.6-terra.
921
- */
922
- post_chat_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;
923
- /**
924
- * Body param: The Response Engine to attach to the agent. It is used to generate
925
- * responses for the agent. You need to create a Response Engine first before
926
- * attaching it to an agent.
927
- */
928
- response_engine?: ChatAgentUpdateParams.ResponseEngineRetellLm | ChatAgentUpdateParams.ResponseEngineCustomLm | ChatAgentUpdateParams.ResponseEngineConversationFlow;
929
- /**
930
- * Body param: The expiration time for the signed url in milliseconds. Only
931
- * applicable when opt_in_signed_url is true. If not set, default value of 86400000
932
- * (24 hours) will apply.
933
- */
934
- signed_url_expiration_ms?: number | null;
935
- /**
936
- * Body param: IANA timezone for the agent (e.g. America/New_York). Defaults to
937
- * America/Los_Angeles if not set.
938
- */
939
- timezone?: string | null;
940
- /**
941
- * Body param: Optional title of the chat agent version. Used for your own
942
- * reference.
943
- */
944
- version_title?: string | null;
945
- /**
946
- * Body param: Which webhook events this agent should receive. If not set, defaults
947
- * to chat_started, chat_ended, chat_analyzed.
948
- */
949
- webhook_events?: Array<'chat_started' | 'chat_ended' | 'chat_analyzed' | 'transcript_updated'> | null;
950
- /**
951
- * Body param: The timeout for the webhook in milliseconds. If not set, default
952
- * value of 10000 will apply.
953
- */
954
- webhook_timeout_ms?: number;
955
- /**
956
- * Body param: The webhook for agent to listen to chat events. See what events it
957
- * would get at [webhook doc](/features/webhook). If set, will binds webhook events
958
- * for this agent to the specified url, and will ignore the account level webhook
959
- * for this agent. Set to `null` to remove webhook url from this agent.
960
- */
961
- webhook_url?: string | null;
962
- }
963
- export declare namespace ChatAgentUpdateParams {
964
- /**
965
- * Configuration for guardrail checks to detect and prevent prohibited topics in
966
- * agent output and user input.
967
- */
968
- interface GuardrailConfig {
2975
+ interface AppTool {
2976
+ /**
2977
+ * The connection (App) this tool runs against. Must be a connection in the
2978
+ * organization whose provider matches this tool's provider.
2979
+ */
2980
+ app_id: string;
2981
+ /**
2982
+ * Name of the catalog template within the provider, as listed by
2983
+ * list-app-templates.
2984
+ */
2985
+ app_tool_template_name: string;
2986
+ /**
2987
+ * Name of the tool. Must be unique within the phase's tools; referenced by
2988
+ * depends_on.
2989
+ */
2990
+ name: string;
2991
+ /**
2992
+ * Provider of the connection. Must match the connection's provider; supported
2993
+ * providers are listed by list-app-templates.
2994
+ */
2995
+ provider: string;
2996
+ type: 'integration_app';
2997
+ /**
2998
+ * Optional gate; the step only runs when the condition holds. Defaults to always
2999
+ * running.
3000
+ */
3001
+ condition?: AppTool.Condition;
3002
+ /**
3003
+ * Names of tools that must run before this one.
3004
+ */
3005
+ depends_on?: Array<string>;
3006
+ /**
3007
+ * Only applies to during conversation functions; ignored by the pre/post
3008
+ * conversation. Overrides the catalog template's LLM-facing description.
3009
+ */
3010
+ description?: string;
3011
+ /**
3012
+ * Only applies to during conversation functions; ignored by the pre/post
3013
+ * conversation. If true, play a typing sound on the agent audio track while this
3014
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
3015
+ * prevent silence on the call.
3016
+ */
3017
+ enable_typing_sound?: boolean;
3018
+ /**
3019
+ * Only applies to during conversation functions; ignored by the pre/post
3020
+ * conversation. The message for the agent to speak when executing the tool. Only
3021
+ * applicable when speak_during_execution is true.
3022
+ */
3023
+ execution_message_description?: string;
3024
+ /**
3025
+ * Only applies to during conversation functions; ignored by the pre/post
3026
+ * conversation. Type of execution message. "prompt" means the agent will use
3027
+ * execution_message_description as a prompt to generate the message. "static_text"
3028
+ * means the agent will speak the execution_message_description directly. Defaults
3029
+ * to "prompt".
3030
+ */
3031
+ execution_message_type?: 'prompt' | 'static_text';
3032
+ /**
3033
+ * What the agent and the transcript see of the tool's response. Omit to send the
3034
+ * full response. Does not affect response_variables, which are always extracted
3035
+ * from the raw response.
3036
+ */
3037
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
3038
+ /**
3039
+ * The resolved input parameters, in order. Properties may pin a value with const
3040
+ * (including {{variable}} references) or provide a description for LLM inference.
3041
+ * Each property may also record selected*input_mode, the editor mode the user
3042
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
3043
+ * "description_preset"); it is stored and returned as-is, used only by the tool
3044
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
3045
+ * require a non-empty const, and description\__ modes must omit const entirely.
3046
+ * Each parameter's required list must match the schema returned by the
3047
+ * corresponding step of the get-app-tool-schema loop.
3048
+ */
3049
+ parameters?: Array<AppTool.Parameter>;
3050
+ /**
3051
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
3052
+ * populated from. Missing paths are ignored.
3053
+ */
3054
+ response_variables?: {
3055
+ [key: string]: string;
3056
+ };
3057
+ /**
3058
+ * Only applies to during conversation functions; ignored by the pre/post
3059
+ * conversation. Determines whether the agent would call LLM another time and speak
3060
+ * when the result of the tool is obtained.
3061
+ */
3062
+ speak_after_execution?: boolean;
3063
+ /**
3064
+ * Only applies to during conversation functions; ignored by the pre/post
3065
+ * conversation. If true, will speak during execution.
3066
+ */
3067
+ speak_during_execution?: boolean;
3068
+ }
3069
+ namespace AppTool {
3070
+ /**
3071
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3072
+ * running.
3073
+ */
3074
+ interface Condition {
3075
+ equations: Array<Condition.Equation>;
3076
+ operator: '||' | '&&';
3077
+ type: 'equation';
3078
+ }
3079
+ namespace Condition {
3080
+ interface Equation {
3081
+ /**
3082
+ * Left side of the equation
3083
+ */
3084
+ left: string;
3085
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
3086
+ /**
3087
+ * Right side of the equation. The right side of the equation not required when
3088
+ * "exists" or "not_exist" are selected.
3089
+ */
3090
+ right?: string;
3091
+ }
3092
+ }
3093
+ interface UnionMember0 {
3094
+ mode: 'all';
3095
+ /**
3096
+ * Not used at runtime; stored and returned as-is for the UI.
3097
+ */
3098
+ fields?: Array<string>;
3099
+ }
3100
+ interface UnionMember1 {
3101
+ /**
3102
+ * The only response fields the agent and the transcript see, as dot-paths into the
3103
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
3104
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
3105
+ * element-wise (deals.properties.amount keeps that field on every deal), while
3106
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
3107
+ * that match nothing contribute nothing.
3108
+ */
3109
+ fields: Array<string>;
3110
+ mode: 'subset';
3111
+ }
3112
+ /**
3113
+ * The parameters the functions accepts, described as a JSON Schema object. See
3114
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3115
+ * documentation about the format. Omitting parameters defines a function with an
3116
+ * empty parameter list.
3117
+ */
3118
+ interface Parameter {
3119
+ /**
3120
+ * The value of properties is an object, where each key is the name of a property
3121
+ * and each value is a schema used to validate that property.
3122
+ */
3123
+ properties: unknown;
3124
+ /**
3125
+ * Type must be "object" for a JSON Schema object.
3126
+ */
3127
+ type: 'object';
3128
+ /**
3129
+ * List of names of required property when generating this parameter. LLM will do
3130
+ * its best to generate the required properties in its function arguments. Property
3131
+ * must exist in properties.
3132
+ */
3133
+ required?: Array<string>;
3134
+ }
3135
+ }
3136
+ interface CustomTool {
3137
+ /**
3138
+ * Name of the tool. Must be unique within all tools available to LLM at any given
3139
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
3140
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
3141
+ * allowed).
3142
+ */
3143
+ name: string;
3144
+ type: 'custom';
3145
+ /**
3146
+ * Describes what the tool does, sometimes can also include information about when
3147
+ * to call the tool.
3148
+ */
3149
+ url: string;
3150
+ /**
3151
+ * If set to true, the parameters will be passed as root level JSON object instead
3152
+ * of nested under "args".
3153
+ */
3154
+ args_at_root?: boolean;
3155
+ /**
3156
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3157
+ * running.
3158
+ */
3159
+ condition?: CustomTool.Condition;
3160
+ /**
3161
+ * Names of tools that must run before this one.
3162
+ */
3163
+ depends_on?: Array<string>;
3164
+ /**
3165
+ * Describes what this tool does and when to call this tool.
3166
+ */
3167
+ description?: string;
3168
+ /**
3169
+ * If true, play a typing sound on the agent audio track while this tool is
3170
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
3171
+ * silence on the call.
3172
+ */
3173
+ enable_typing_sound?: boolean;
969
3174
  /**
970
- * Selected prohibited user topic categories to check. When user messages contain
971
- * these topics, the agent will respond with a placeholder message instead of
972
- * processing the request.
3175
+ * The description for the sentence agent say during execution. Only applicable
3176
+ * when speak_during_execution is true. Can write what to say or even provide
3177
+ * examples. The default is "The message you will say to callee when calling this
3178
+ * tool. Make sure it fits into the conversation smoothly.".
973
3179
  */
974
- input_topics?: Array<'platform_integrity_jailbreaking'> | null;
3180
+ execution_message_description?: string;
975
3181
  /**
976
- * Selected prohibited agent topic categories to check. When agent messages contain
977
- * these topics, they will be replaced with a placeholder message.
3182
+ * Type of execution message. "prompt" means the agent will use
3183
+ * execution_message_description as a prompt to generate the message. "static_text"
3184
+ * means the agent will speak the execution_message_description directly. Defaults
3185
+ * to "prompt".
978
3186
  */
979
- 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;
980
- }
981
- /**
982
- * Toggle behavior presets on/off to influence agent response style and behaviors.
983
- * Voice-only presets are not available for chat agents.
984
- */
985
- interface HandbookConfig {
3187
+ execution_message_type?: 'prompt' | 'static_text';
986
3188
  /**
987
- * When asked, acknowledge being a virtual assistant.
3189
+ * Headers to add to the request.
988
3190
  */
989
- ai_disclosure?: boolean;
3191
+ headers?: {
3192
+ [key: string]: string;
3193
+ };
990
3194
  /**
991
- * Professional call center rep baseline.
3195
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
3196
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
3197
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
3198
+ * attempt rather than as a budget across all attempts, so an attempt that times
3199
+ * out is still retried and the worst-case total duration is `timeout_ms`
3200
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
3201
+ * exponential backoff + jitter between each retry. Only the final attempt's result
3202
+ * is reported to the agent. Because retries repeat the request, only set this
3203
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
3204
+ * than once. Defaults to 0 (no retry).
992
3205
  */
993
- default_personality?: boolean;
3206
+ max_retry?: number;
994
3207
  /**
995
- * Warm acknowledgment of caller concerns.
3208
+ * Method to use for the request, default to POST.
996
3209
  */
997
- high_empathy?: boolean;
3210
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
998
3211
  /**
999
- * Stay within prompt/context scope, don't invent details.
3212
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
3213
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
3214
+ * produce the same `parameters` schema; this does not change how the request body
3215
+ * is encoded (see `args_at_root`).
1000
3216
  */
1001
- scope_boundaries?: boolean;
3217
+ parameter_type?: 'json' | 'form';
3218
+ /**
3219
+ * The parameters the functions accepts, described as a JSON Schema object. See
3220
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3221
+ * documentation about the format. Omitting parameters defines a function with an
3222
+ * empty parameter list.
3223
+ */
3224
+ parameters?: CustomTool.Parameters;
3225
+ /**
3226
+ * Query parameters to append to the request URL.
3227
+ */
3228
+ query_params?: {
3229
+ [key: string]: string;
3230
+ };
3231
+ /**
3232
+ * A mapping of variable names to JSON paths in the response body. These values
3233
+ * will be extracted from the response and made available as dynamic variables for
3234
+ * use.
3235
+ */
3236
+ response_variables?: {
3237
+ [key: string]: string;
3238
+ };
3239
+ /**
3240
+ * Determines whether the agent would call LLM another time and speak when the
3241
+ * result of function is obtained. Usually this needs to get turned on so user can
3242
+ * get update for the function call.
3243
+ */
3244
+ speak_after_execution?: boolean;
3245
+ /**
3246
+ * Determines whether the agent would say sentence like "One moment, let me check
3247
+ * that." when executing the function. Recommend to turn on if your function call
3248
+ * takes over 1s (including network) to complete, so that your agent remains
3249
+ * responsive.
3250
+ */
3251
+ speak_during_execution?: boolean;
3252
+ /**
3253
+ * The maximum time in milliseconds the tool can run before it's considered
3254
+ * timeout. If the tool times out, the agent would have that info. The minimum
3255
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
3256
+ * min). By default, this is set to 120,000 ms (2 min).
3257
+ */
3258
+ timeout_ms?: number;
1002
3259
  }
1003
- /**
1004
- * Configuration for PII scrubbing from transcripts and recordings.
1005
- */
1006
- interface PiiConfig {
3260
+ namespace CustomTool {
1007
3261
  /**
1008
- * List of PII categories to scrub from transcripts and recordings. PII redaction
1009
- * is only active when this list is non-empty; an empty array means no PII
1010
- * scrubbing is performed.
3262
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3263
+ * running.
1011
3264
  */
1012
- 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'>;
3265
+ interface Condition {
3266
+ equations: Array<Condition.Equation>;
3267
+ operator: '||' | '&&';
3268
+ type: 'equation';
3269
+ }
3270
+ namespace Condition {
3271
+ interface Equation {
3272
+ /**
3273
+ * Left side of the equation
3274
+ */
3275
+ left: string;
3276
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
3277
+ /**
3278
+ * Right side of the equation. The right side of the equation not required when
3279
+ * "exists" or "not_exist" are selected.
3280
+ */
3281
+ right?: string;
3282
+ }
3283
+ }
1013
3284
  /**
1014
- * The processing mode for PII scrubbing. Currently only post-call is supported.
3285
+ * The parameters the functions accepts, described as a JSON Schema object. See
3286
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3287
+ * documentation about the format. Omitting parameters defines a function with an
3288
+ * empty parameter list.
1015
3289
  */
1016
- mode: 'post_call';
3290
+ interface Parameters {
3291
+ /**
3292
+ * The value of properties is an object, where each key is the name of a property
3293
+ * and each value is a schema used to validate that property.
3294
+ */
3295
+ properties: unknown;
3296
+ /**
3297
+ * Type must be "object" for a JSON Schema object.
3298
+ */
3299
+ type: 'object';
3300
+ /**
3301
+ * List of names of required property when generating this parameter. LLM will do
3302
+ * its best to generate the required properties in its function arguments. Property
3303
+ * must exist in properties.
3304
+ */
3305
+ required?: Array<string>;
3306
+ }
1017
3307
  }
1018
- interface StringAnalysisData {
3308
+ interface CodeTool {
1019
3309
  /**
1020
- * Description of the variable.
3310
+ * JavaScript code to execute in the sandbox.
1021
3311
  */
1022
- description: string;
3312
+ code: string;
1023
3313
  /**
1024
- * Name of the variable.
3314
+ * Name of the tool. Must be unique within all tools available to LLM at any given
3315
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
3316
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
3317
+ * allowed).
1025
3318
  */
1026
3319
  name: string;
3320
+ type: 'code';
1027
3321
  /**
1028
- * Type of the variable to extract.
3322
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3323
+ * running.
1029
3324
  */
1030
- type: 'string';
3325
+ condition?: CodeTool.Condition;
1031
3326
  /**
1032
- * Optional instruction to help decide whether this field needs to be populated in
1033
- * the analysis. If not set, the field is always included. If required is true,
1034
- * this is ignored.
3327
+ * Names of tools that must run before this one.
1035
3328
  */
1036
- conditional_prompt?: string;
3329
+ depends_on?: Array<string>;
1037
3330
  /**
1038
- * Examples of the variable value to teach model the style and syntax.
3331
+ * Describes what this tool does and when to call this tool.
1039
3332
  */
1040
- examples?: Array<string>;
3333
+ description?: string;
1041
3334
  /**
1042
- * Whether this data is required. If true and the data is not extracted, the call
1043
- * will be marked as unsuccessful.
3335
+ * If true, play a typing sound on the agent audio track while this tool is
3336
+ * executing.
1044
3337
  */
1045
- required?: boolean;
1046
- }
1047
- interface EnumAnalysisData {
3338
+ enable_typing_sound?: boolean;
1048
3339
  /**
1049
- * The possible values of the variable, must be non empty array.
3340
+ * The description for the sentence agent say during execution. Only applicable
3341
+ * when speak_during_execution is true.
1050
3342
  */
1051
- choices: Array<string>;
3343
+ execution_message_description?: string;
1052
3344
  /**
1053
- * Description of the variable.
3345
+ * Type of execution message. "prompt" means the agent will use
3346
+ * execution_message_description as a prompt to generate the message. "static_text"
3347
+ * means the agent will speak the execution_message_description directly. Defaults
3348
+ * to "prompt".
1054
3349
  */
1055
- description: string;
3350
+ execution_message_type?: 'prompt' | 'static_text';
1056
3351
  /**
1057
- * Name of the variable.
3352
+ * A mapping of variable names to JSON paths in the code execution result. These
3353
+ * mapped values will be extracted and added as dynamic variables.
3354
+ */
3355
+ response_variables?: {
3356
+ [key: string]: string;
3357
+ };
3358
+ /**
3359
+ * Determines whether the agent would call LLM another time and speak when the
3360
+ * result of function is obtained.
3361
+ */
3362
+ speak_after_execution?: boolean;
3363
+ /**
3364
+ * Determines whether the agent would say sentence like "One moment, let me check
3365
+ * that." when executing the tool.
3366
+ */
3367
+ speak_during_execution?: boolean;
3368
+ /**
3369
+ * The maximum time in milliseconds the code can run before it's considered
3370
+ * timeout. Defaults to 30,000 ms (30 s).
3371
+ */
3372
+ timeout_ms?: number;
3373
+ }
3374
+ namespace CodeTool {
3375
+ /**
3376
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3377
+ * running.
3378
+ */
3379
+ interface Condition {
3380
+ equations: Array<Condition.Equation>;
3381
+ operator: '||' | '&&';
3382
+ type: 'equation';
3383
+ }
3384
+ namespace Condition {
3385
+ interface Equation {
3386
+ /**
3387
+ * Left side of the equation
3388
+ */
3389
+ left: string;
3390
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
3391
+ /**
3392
+ * Right side of the equation. The right side of the equation not required when
3393
+ * "exists" or "not_exist" are selected.
3394
+ */
3395
+ right?: string;
3396
+ }
3397
+ }
3398
+ }
3399
+ interface SendSMSTool {
3400
+ /**
3401
+ * Name of the tool. Must be unique within all tools available to LLM at any given
3402
+ * time (general tools + state tools + state edges).
1058
3403
  */
1059
3404
  name: string;
3405
+ sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate;
3406
+ type: 'send_sms';
1060
3407
  /**
1061
- * Type of the variable to extract.
3408
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3409
+ * running.
1062
3410
  */
1063
- type: 'enum';
3411
+ condition?: SendSMSTool.Condition;
1064
3412
  /**
1065
- * Optional instruction to help decide whether this field needs to be populated in
1066
- * the analysis. If not set, the field is always included. If required is true,
1067
- * this is ignored.
3413
+ * Names of tools that must run before this one.
1068
3414
  */
1069
- conditional_prompt?: string;
3415
+ depends_on?: Array<string>;
1070
3416
  /**
1071
- * Whether this data is required. If true and the data is not extracted, the call
1072
- * will be marked as unsuccessful.
3417
+ * Describes what the tool does, sometimes can also include information about when
3418
+ * to call the tool.
1073
3419
  */
1074
- required?: boolean;
3420
+ description?: string;
3421
+ /**
3422
+ * Describes what to say before sending the SMS. Only applicable when
3423
+ * speak_during_execution is true.
3424
+ */
3425
+ execution_message_description?: string;
3426
+ /**
3427
+ * Type of execution message. "prompt" means the agent will use
3428
+ * execution_message_description as a prompt to generate the message. "static_text"
3429
+ * means the agent will speak the execution_message_description directly. Defaults
3430
+ * to "prompt".
3431
+ */
3432
+ execution_message_type?: 'prompt' | 'static_text';
3433
+ /**
3434
+ * If true, the agent will speak a short line before sending the SMS. If omitted,
3435
+ * defaults to true (same as end_call / transfer_call tools).
3436
+ */
3437
+ speak_during_execution?: boolean;
1075
3438
  }
1076
- interface BooleanAnalysisData {
3439
+ namespace SendSMSTool {
3440
+ interface SMSContentPredefined {
3441
+ /**
3442
+ * The static message to be sent in the SMS. Can contain dynamic variables.
3443
+ */
3444
+ text?: string;
3445
+ type?: 'predefined';
3446
+ }
3447
+ interface SMSContentInferred {
3448
+ /**
3449
+ * The prompt to be used to help infer the SMS content. The model will take the
3450
+ * global prompt, the call transcript, and this prompt together to deduce the right
3451
+ * message to send. Can contain dynamic variables.
3452
+ */
3453
+ prompt?: string;
3454
+ type?: 'inferred';
3455
+ }
3456
+ interface SMSContentTemplate {
3457
+ /**
3458
+ * The template to use for the SMS content. "info_collection" sends a predefined
3459
+ * message requesting information from the user.
3460
+ */
3461
+ template: 'info_collection';
3462
+ type: 'template';
3463
+ }
1077
3464
  /**
1078
- * Description of the variable.
3465
+ * Optional gate; the step only runs when the condition holds. Defaults to always
3466
+ * running.
1079
3467
  */
1080
- description: string;
3468
+ interface Condition {
3469
+ equations: Array<Condition.Equation>;
3470
+ operator: '||' | '&&';
3471
+ type: 'equation';
3472
+ }
3473
+ namespace Condition {
3474
+ interface Equation {
3475
+ /**
3476
+ * Left side of the equation
3477
+ */
3478
+ left: string;
3479
+ operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'not_contains' | 'exists' | 'not_exist';
3480
+ /**
3481
+ * Right side of the equation. The right side of the equation not required when
3482
+ * "exists" or "not_exist" are selected.
3483
+ */
3484
+ right?: string;
3485
+ }
3486
+ }
3487
+ }
3488
+ interface AppTool {
1081
3489
  /**
1082
- * Name of the variable.
3490
+ * The connection (App) this tool runs against. Must be a connection in the
3491
+ * organization whose provider matches this tool's provider.
3492
+ */
3493
+ app_id: string;
3494
+ /**
3495
+ * Name of the catalog template within the provider, as listed by
3496
+ * list-app-templates.
3497
+ */
3498
+ app_tool_template_name: string;
3499
+ /**
3500
+ * Name of the tool. Must be unique within the phase's tools; referenced by
3501
+ * depends_on.
1083
3502
  */
1084
3503
  name: string;
1085
3504
  /**
1086
- * Type of the variable to extract.
3505
+ * Provider of the connection. Must match the connection's provider; supported
3506
+ * providers are listed by list-app-templates.
1087
3507
  */
1088
- type: 'boolean';
3508
+ provider: string;
3509
+ type: 'integration_app';
1089
3510
  /**
1090
- * Optional instruction to help decide whether this field needs to be populated in
1091
- * the analysis. If not set, the field is always included. If required is true,
1092
- * this is ignored.
3511
+ * Names of tools that must run before this one.
1093
3512
  */
1094
- conditional_prompt?: string;
3513
+ depends_on?: Array<string>;
1095
3514
  /**
1096
- * Whether this data is required. If true and the data is not extracted, the call
1097
- * will be marked as unsuccessful.
3515
+ * Only applies to during conversation functions; ignored by the pre/post
3516
+ * conversation. Overrides the catalog template's LLM-facing description.
1098
3517
  */
1099
- required?: boolean;
3518
+ description?: string;
3519
+ /**
3520
+ * Only applies to during conversation functions; ignored by the pre/post
3521
+ * conversation. If true, play a typing sound on the agent audio track while this
3522
+ * tool is executing. Useful when the tool takes a noticeable amount of time to
3523
+ * prevent silence on the call.
3524
+ */
3525
+ enable_typing_sound?: boolean;
3526
+ /**
3527
+ * Only applies to during conversation functions; ignored by the pre/post
3528
+ * conversation. The message for the agent to speak when executing the tool. Only
3529
+ * applicable when speak_during_execution is true.
3530
+ */
3531
+ execution_message_description?: string;
3532
+ /**
3533
+ * Only applies to during conversation functions; ignored by the pre/post
3534
+ * conversation. Type of execution message. "prompt" means the agent will use
3535
+ * execution_message_description as a prompt to generate the message. "static_text"
3536
+ * means the agent will speak the execution_message_description directly. Defaults
3537
+ * to "prompt".
3538
+ */
3539
+ execution_message_type?: 'prompt' | 'static_text';
3540
+ /**
3541
+ * What the agent and the transcript see of the tool's response. Omit to send the
3542
+ * full response. Does not affect response_variables, which are always extracted
3543
+ * from the raw response.
3544
+ */
3545
+ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1;
3546
+ /**
3547
+ * The resolved input parameters, in order. Properties may pin a value with const
3548
+ * (including {{variable}} references) or provide a description for LLM inference.
3549
+ * Each property may also record selected*input_mode, the editor mode the user
3550
+ * selected ("const_enum", "const_boolean", "const_value", "description_custom", or
3551
+ * "description_preset"); it is stored and returned as-is, used only by the tool
3552
+ * config UI. Omit the key when no mode is recorded; when set, const*_ modes
3553
+ * require a non-empty const, and description\__ modes must omit const entirely.
3554
+ * Each parameter's required list must match the schema returned by the
3555
+ * corresponding step of the get-app-tool-schema loop.
3556
+ */
3557
+ parameters?: Array<AppTool.Parameter>;
3558
+ /**
3559
+ * Mapping of a dynamic-variable name to the response field (dot-path) it is
3560
+ * populated from. Missing paths are ignored.
3561
+ */
3562
+ response_variables?: {
3563
+ [key: string]: string;
3564
+ };
3565
+ /**
3566
+ * Only applies to during conversation functions; ignored by the pre/post
3567
+ * conversation. Determines whether the agent would call LLM another time and speak
3568
+ * when the result of the tool is obtained.
3569
+ */
3570
+ speak_after_execution?: boolean;
3571
+ /**
3572
+ * Only applies to during conversation functions; ignored by the pre/post
3573
+ * conversation. If true, will speak during execution.
3574
+ */
3575
+ speak_during_execution?: boolean;
1100
3576
  }
1101
- interface NumberAnalysisData {
3577
+ namespace AppTool {
3578
+ interface UnionMember0 {
3579
+ mode: 'all';
3580
+ /**
3581
+ * Not used at runtime; stored and returned as-is for the UI.
3582
+ */
3583
+ fields?: Array<string>;
3584
+ }
3585
+ interface UnionMember1 {
3586
+ /**
3587
+ * The only response fields the agent and the transcript see, as dot-paths into the
3588
+ * response schema returned by get-app-tool-schema. Everything else is dropped.
3589
+ * Selecting a parent keeps its whole subtree. A plain segment traverses arrays
3590
+ * element-wise (deals.properties.amount keeps that field on every deal), while
3591
+ * key[n] selects one element (deals[0].id keeps only the first deal's id); paths
3592
+ * that match nothing contribute nothing.
3593
+ */
3594
+ fields: Array<string>;
3595
+ mode: 'subset';
3596
+ }
1102
3597
  /**
1103
- * Description of the variable.
3598
+ * The parameters the functions accepts, described as a JSON Schema object. See
3599
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3600
+ * documentation about the format. Omitting parameters defines a function with an
3601
+ * empty parameter list.
1104
3602
  */
1105
- description: string;
3603
+ interface Parameter {
3604
+ /**
3605
+ * The value of properties is an object, where each key is the name of a property
3606
+ * and each value is a schema used to validate that property.
3607
+ */
3608
+ properties: unknown;
3609
+ /**
3610
+ * Type must be "object" for a JSON Schema object.
3611
+ */
3612
+ type: 'object';
3613
+ /**
3614
+ * List of names of required property when generating this parameter. LLM will do
3615
+ * its best to generate the required properties in its function arguments. Property
3616
+ * must exist in properties.
3617
+ */
3618
+ required?: Array<string>;
3619
+ }
3620
+ }
3621
+ interface CustomTool {
1106
3622
  /**
1107
- * Name of the variable.
3623
+ * Name of the tool. Must be unique within all tools available to LLM at any given
3624
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
3625
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
3626
+ * allowed).
1108
3627
  */
1109
3628
  name: string;
3629
+ type: 'custom';
1110
3630
  /**
1111
- * Type of the variable to extract.
3631
+ * Describes what the tool does, sometimes can also include information about when
3632
+ * to call the tool.
1112
3633
  */
1113
- type: 'number';
3634
+ url: string;
1114
3635
  /**
1115
- * Optional instruction to help decide whether this field needs to be populated in
1116
- * the analysis. If not set, the field is always included. If required is true,
1117
- * this is ignored.
3636
+ * If set to true, the parameters will be passed as root level JSON object instead
3637
+ * of nested under "args".
1118
3638
  */
1119
- conditional_prompt?: string;
3639
+ args_at_root?: boolean;
1120
3640
  /**
1121
- * Whether this data is required. If true and the data is not extracted, the call
1122
- * will be marked as unsuccessful.
3641
+ * Names of tools that must run before this one.
1123
3642
  */
1124
- required?: boolean;
3643
+ depends_on?: Array<string>;
3644
+ /**
3645
+ * Describes what this tool does and when to call this tool.
3646
+ */
3647
+ description?: string;
3648
+ /**
3649
+ * If true, play a typing sound on the agent audio track while this tool is
3650
+ * executing. Useful when the tool takes a noticeable amount of time to prevent
3651
+ * silence on the call.
3652
+ */
3653
+ enable_typing_sound?: boolean;
3654
+ /**
3655
+ * The description for the sentence agent say during execution. Only applicable
3656
+ * when speak_during_execution is true. Can write what to say or even provide
3657
+ * examples. The default is "The message you will say to callee when calling this
3658
+ * tool. Make sure it fits into the conversation smoothly.".
3659
+ */
3660
+ execution_message_description?: string;
3661
+ /**
3662
+ * Type of execution message. "prompt" means the agent will use
3663
+ * execution_message_description as a prompt to generate the message. "static_text"
3664
+ * means the agent will speak the execution_message_description directly. Defaults
3665
+ * to "prompt".
3666
+ */
3667
+ execution_message_type?: 'prompt' | 'static_text';
3668
+ /**
3669
+ * Headers to add to the request.
3670
+ */
3671
+ headers?: {
3672
+ [key: string]: string;
3673
+ };
3674
+ /**
3675
+ * Maximum number of times to retry the request after a failed attempt, from 0 (no
3676
+ * retry) to 5. Retries happen on any failure, with exponential backoff between
3677
+ * attempts; the backoff delay is not configurable. `timeout_ms` applies per
3678
+ * attempt rather than as a budget across all attempts, so an attempt that times
3679
+ * out is still retried and the worst-case total duration is `timeout_ms`
3680
+ * multiplied by (`max_retry` + 1) as well as any latency incurred by the
3681
+ * exponential backoff + jitter between each retry. Only the final attempt's result
3682
+ * is reported to the agent. Because retries repeat the request, only set this
3683
+ * above 0 if your endpoint is idempotent — a retried request may be processed more
3684
+ * than once. Defaults to 0 (no retry).
3685
+ */
3686
+ max_retry?: number;
3687
+ /**
3688
+ * Method to use for the request, default to POST.
3689
+ */
3690
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3691
+ /**
3692
+ * How the tool's `parameters` are authored and shown in the dashboard editor —
3693
+ * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both
3694
+ * produce the same `parameters` schema; this does not change how the request body
3695
+ * is encoded (see `args_at_root`).
3696
+ */
3697
+ parameter_type?: 'json' | 'form';
3698
+ /**
3699
+ * The parameters the functions accepts, described as a JSON Schema object. See
3700
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3701
+ * documentation about the format. Omitting parameters defines a function with an
3702
+ * empty parameter list.
3703
+ */
3704
+ parameters?: CustomTool.Parameters;
3705
+ /**
3706
+ * Query parameters to append to the request URL.
3707
+ */
3708
+ query_params?: {
3709
+ [key: string]: string;
3710
+ };
3711
+ /**
3712
+ * A mapping of variable names to JSON paths in the response body. These values
3713
+ * will be extracted from the response and made available as dynamic variables for
3714
+ * use.
3715
+ */
3716
+ response_variables?: {
3717
+ [key: string]: string;
3718
+ };
3719
+ /**
3720
+ * Determines whether the agent would call LLM another time and speak when the
3721
+ * result of function is obtained. Usually this needs to get turned on so user can
3722
+ * get update for the function call.
3723
+ */
3724
+ speak_after_execution?: boolean;
3725
+ /**
3726
+ * Determines whether the agent would say sentence like "One moment, let me check
3727
+ * that." when executing the function. Recommend to turn on if your function call
3728
+ * takes over 1s (including network) to complete, so that your agent remains
3729
+ * responsive.
3730
+ */
3731
+ speak_during_execution?: boolean;
3732
+ /**
3733
+ * The maximum time in milliseconds the tool can run before it's considered
3734
+ * timeout. If the tool times out, the agent would have that info. The minimum
3735
+ * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10
3736
+ * min). By default, this is set to 120,000 ms (2 min).
3737
+ */
3738
+ timeout_ms?: number;
1125
3739
  }
1126
- /**
1127
- * System preset for post-chat analysis (chat agents). Use in
1128
- * post_chat_analysis_data to override prompts or mark fields optional.
1129
- */
1130
- interface ChatPresetAnalysisData {
3740
+ namespace CustomTool {
1131
3741
  /**
1132
- * Preset identifier for chat agent analysis.
3742
+ * The parameters the functions accepts, described as a JSON Schema object. See
3743
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
3744
+ * documentation about the format. Omitting parameters defines a function with an
3745
+ * empty parameter list.
1133
3746
  */
1134
- name: 'chat_summary' | 'chat_successful' | 'user_sentiment';
3747
+ interface Parameters {
3748
+ /**
3749
+ * The value of properties is an object, where each key is the name of a property
3750
+ * and each value is a schema used to validate that property.
3751
+ */
3752
+ properties: unknown;
3753
+ /**
3754
+ * Type must be "object" for a JSON Schema object.
3755
+ */
3756
+ type: 'object';
3757
+ /**
3758
+ * List of names of required property when generating this parameter. LLM will do
3759
+ * its best to generate the required properties in its function arguments. Property
3760
+ * must exist in properties.
3761
+ */
3762
+ required?: Array<string>;
3763
+ }
3764
+ }
3765
+ interface CodeTool {
1135
3766
  /**
1136
- * Identifies this item as a system preset.
3767
+ * JavaScript code to execute in the sandbox.
1137
3768
  */
1138
- type: 'system-presets';
3769
+ code: string;
1139
3770
  /**
1140
- * Optional instruction to help decide whether this field needs to be populated. If
1141
- * not set, the field is always included.
3771
+ * Name of the tool. Must be unique within all tools available to LLM at any given
3772
+ * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z,
3773
+ * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space
3774
+ * allowed).
1142
3775
  */
1143
- conditional_prompt?: string;
3776
+ name: string;
3777
+ type: 'code';
1144
3778
  /**
1145
- * Prompt or description for this preset.
3779
+ * Names of tools that must run before this one.
3780
+ */
3781
+ depends_on?: Array<string>;
3782
+ /**
3783
+ * Describes what this tool does and when to call this tool.
1146
3784
  */
1147
3785
  description?: string;
1148
3786
  /**
1149
- * If false, this field is optional in the analysis. If true or unset, the field is
1150
- * required.
3787
+ * If true, play a typing sound on the agent audio track while this tool is
3788
+ * executing.
1151
3789
  */
1152
- required?: boolean;
3790
+ enable_typing_sound?: boolean;
3791
+ /**
3792
+ * The description for the sentence agent say during execution. Only applicable
3793
+ * when speak_during_execution is true.
3794
+ */
3795
+ execution_message_description?: string;
3796
+ /**
3797
+ * Type of execution message. "prompt" means the agent will use
3798
+ * execution_message_description as a prompt to generate the message. "static_text"
3799
+ * means the agent will speak the execution_message_description directly. Defaults
3800
+ * to "prompt".
3801
+ */
3802
+ execution_message_type?: 'prompt' | 'static_text';
3803
+ /**
3804
+ * A mapping of variable names to JSON paths in the code execution result. These
3805
+ * mapped values will be extracted and added as dynamic variables.
3806
+ */
3807
+ response_variables?: {
3808
+ [key: string]: string;
3809
+ };
3810
+ /**
3811
+ * Determines whether the agent would call LLM another time and speak when the
3812
+ * result of function is obtained.
3813
+ */
3814
+ speak_after_execution?: boolean;
3815
+ /**
3816
+ * Determines whether the agent would say sentence like "One moment, let me check
3817
+ * that." when executing the tool.
3818
+ */
3819
+ speak_during_execution?: boolean;
3820
+ /**
3821
+ * The maximum time in milliseconds the code can run before it's considered
3822
+ * timeout. Defaults to 30,000 ms (30 s).
3823
+ */
3824
+ timeout_ms?: number;
1153
3825
  }
1154
3826
  interface ResponseEngineRetellLm {
1155
3827
  /**