From 94f5fdeeda93d77a3e22644d2c9d271bc1273b0a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 05:28:27 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 42107f44..67242520 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 73 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Fretell-3aa6f6e028ef4d49bed8719dd097acb4c8d9d6afa27a499faa2e9d02782ac2bd.yml openapi_spec_hash: 47fc2e2f939e51932b6726a705877e1a -config_hash: b8e300898f198b40935f8cf775a07e2d +config_hash: bf63cd880955c4d6be170f4c6c68959e From bef8663280eb89c6bf06f990a37059ebcb0f80ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 17:45:52 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- src/retell/resources/agent.py | 36 + src/retell/resources/chat_agent.py | 40 + src/retell/resources/conversation_flow.py | 16 + .../resources/conversation_flow_component.py | 16 + src/retell/types/agent_create_params.py | 105 + src/retell/types/agent_response.py | 105 + src/retell/types/agent_update_params.py | 105 + .../batch_call_create_batch_call_params.py | 105 + .../types/call_create_phone_call_params.py | 105 + .../types/call_create_web_call_params.py | 105 + .../types/call_register_phone_call_params.py | 105 + src/retell/types/chat_agent_create_params.py | 90 + src/retell/types/chat_agent_response.py | 90 + src/retell/types/chat_agent_update_params.py | 90 + ...nversation_flow_component_create_params.py | 908 +- .../conversation_flow_component_response.py | 904 +- ...nversation_flow_component_update_params.py | 908 +- .../types/conversation_flow_create_params.py | 7205 +++++++++------ .../types/conversation_flow_response.py | 7907 +++++++++------- .../types/conversation_flow_update_params.py | 8065 ++++++++++------- src/retell/types/llm_create_params.py | 96 + src/retell/types/llm_response.py | 96 + src/retell/types/llm_update_params.py | 96 + tests/api_resources/test_agent.py | 52 + tests/api_resources/test_batch_call.py | 26 + tests/api_resources/test_call.py | 78 + tests/api_resources/test_chat_agent.py | 32 + tests/api_resources/test_conversation_flow.py | 200 +- .../test_conversation_flow_component.py | 100 +- 30 files changed, 17540 insertions(+), 10250 deletions(-) diff --git a/.stats.yml b/.stats.yml index 67242520..165b478c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 73 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Fretell-3aa6f6e028ef4d49bed8719dd097acb4c8d9d6afa27a499faa2e9d02782ac2bd.yml -openapi_spec_hash: 47fc2e2f939e51932b6726a705877e1a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Fretell-56de19127afbdf111fd60a0aa1188496712acbcf9069d535396af6e66a0afd70.yml +openapi_spec_hash: a56e1bcb7ab38d9fade4a42840e7e15f config_hash: bf63cd880955c4d6be170f4c6c68959e diff --git a/src/retell/resources/agent.py b/src/retell/resources/agent.py index 36e4ec27..468fee46 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -78,6 +78,7 @@ def create( end_call_after_silence_ms: int | Omit = omit, fallback_voice_ids: Optional[SequenceNotStr[str]] | Omit = omit, guardrail_config: agent_create_params.GuardrailConfig | Omit = omit, + handbook_config: agent_create_params.HandbookConfig | Omit = omit, interruption_sensitivity: float | Omit = omit, is_public: Optional[bool] | Omit = omit, ivr_option: Optional[agent_create_params.IvrOption] | Omit = omit, @@ -182,6 +183,7 @@ def create( ring_duration_ms: int | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, stt_mode: Literal["fast", "accurate", "custom"] | Omit = omit, + timezone: Optional[str] | Omit = omit, user_dtmf_options: Optional[agent_create_params.UserDtmfOptions] | Omit = omit, version_description: Optional[str] | Omit = omit, vocab_specialization: Literal["general", "medical"] | Omit = omit, @@ -348,6 +350,8 @@ def create( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + interruption_sensitivity: Controls how sensitive the agent is to user interruptions. Value ranging from [0,1]. Lower value means it will take longer / more words for user to interrupt agent, while higher value means it's easier for user to interrupt agent. If @@ -419,6 +423,9 @@ def create( stt_mode: If set, determines whether speech to text should focus on latency or accuracy. Default to fast mode. When set to custom, custom_stt_config must be provided. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + version_description: Optional description of the agent version. Used for your own reference and documentation. @@ -506,6 +513,7 @@ def create( "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "interruption_sensitivity": interruption_sensitivity, "is_public": is_public, "ivr_option": ivr_option, @@ -523,6 +531,7 @@ def create( "ring_duration_ms": ring_duration_ms, "signed_url_expiration_ms": signed_url_expiration_ms, "stt_mode": stt_mode, + "timezone": timezone, "user_dtmf_options": user_dtmf_options, "version_description": version_description, "vocab_specialization": vocab_specialization, @@ -619,6 +628,7 @@ def update( end_call_after_silence_ms: int | Omit = omit, fallback_voice_ids: Optional[SequenceNotStr[str]] | Omit = omit, guardrail_config: agent_update_params.GuardrailConfig | Omit = omit, + handbook_config: agent_update_params.HandbookConfig | Omit = omit, interruption_sensitivity: float | Omit = omit, is_public: Optional[bool] | Omit = omit, ivr_option: Optional[agent_update_params.IvrOption] | Omit = omit, @@ -724,6 +734,7 @@ def update( ring_duration_ms: int | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, stt_mode: Literal["fast", "accurate", "custom"] | Omit = omit, + timezone: Optional[str] | Omit = omit, user_dtmf_options: Optional[agent_update_params.UserDtmfOptions] | Omit = omit, version_description: Optional[str] | Omit = omit, vocab_specialization: Literal["general", "medical"] | Omit = omit, @@ -886,6 +897,8 @@ def update( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + interruption_sensitivity: Controls how sensitive the agent is to user interruptions. Value ranging from [0,1]. Lower value means it will take longer / more words for user to interrupt agent, while higher value means it's easier for user to interrupt agent. If @@ -961,6 +974,9 @@ def update( stt_mode: If set, determines whether speech to text should focus on latency or accuracy. Default to fast mode. When set to custom, custom_stt_config must be provided. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + version_description: Optional description of the agent version. Used for your own reference and documentation. @@ -1051,6 +1067,7 @@ def update( "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "interruption_sensitivity": interruption_sensitivity, "is_public": is_public, "ivr_option": ivr_option, @@ -1069,6 +1086,7 @@ def update( "ring_duration_ms": ring_duration_ms, "signed_url_expiration_ms": signed_url_expiration_ms, "stt_mode": stt_mode, + "timezone": timezone, "user_dtmf_options": user_dtmf_options, "version_description": version_description, "vocab_specialization": vocab_specialization, @@ -1308,6 +1326,7 @@ async def create( end_call_after_silence_ms: int | Omit = omit, fallback_voice_ids: Optional[SequenceNotStr[str]] | Omit = omit, guardrail_config: agent_create_params.GuardrailConfig | Omit = omit, + handbook_config: agent_create_params.HandbookConfig | Omit = omit, interruption_sensitivity: float | Omit = omit, is_public: Optional[bool] | Omit = omit, ivr_option: Optional[agent_create_params.IvrOption] | Omit = omit, @@ -1412,6 +1431,7 @@ async def create( ring_duration_ms: int | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, stt_mode: Literal["fast", "accurate", "custom"] | Omit = omit, + timezone: Optional[str] | Omit = omit, user_dtmf_options: Optional[agent_create_params.UserDtmfOptions] | Omit = omit, version_description: Optional[str] | Omit = omit, vocab_specialization: Literal["general", "medical"] | Omit = omit, @@ -1578,6 +1598,8 @@ async def create( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + interruption_sensitivity: Controls how sensitive the agent is to user interruptions. Value ranging from [0,1]. Lower value means it will take longer / more words for user to interrupt agent, while higher value means it's easier for user to interrupt agent. If @@ -1649,6 +1671,9 @@ async def create( stt_mode: If set, determines whether speech to text should focus on latency or accuracy. Default to fast mode. When set to custom, custom_stt_config must be provided. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + version_description: Optional description of the agent version. Used for your own reference and documentation. @@ -1736,6 +1761,7 @@ async def create( "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "interruption_sensitivity": interruption_sensitivity, "is_public": is_public, "ivr_option": ivr_option, @@ -1753,6 +1779,7 @@ async def create( "ring_duration_ms": ring_duration_ms, "signed_url_expiration_ms": signed_url_expiration_ms, "stt_mode": stt_mode, + "timezone": timezone, "user_dtmf_options": user_dtmf_options, "version_description": version_description, "vocab_specialization": vocab_specialization, @@ -1849,6 +1876,7 @@ async def update( end_call_after_silence_ms: int | Omit = omit, fallback_voice_ids: Optional[SequenceNotStr[str]] | Omit = omit, guardrail_config: agent_update_params.GuardrailConfig | Omit = omit, + handbook_config: agent_update_params.HandbookConfig | Omit = omit, interruption_sensitivity: float | Omit = omit, is_public: Optional[bool] | Omit = omit, ivr_option: Optional[agent_update_params.IvrOption] | Omit = omit, @@ -1954,6 +1982,7 @@ async def update( ring_duration_ms: int | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, stt_mode: Literal["fast", "accurate", "custom"] | Omit = omit, + timezone: Optional[str] | Omit = omit, user_dtmf_options: Optional[agent_update_params.UserDtmfOptions] | Omit = omit, version_description: Optional[str] | Omit = omit, vocab_specialization: Literal["general", "medical"] | Omit = omit, @@ -2116,6 +2145,8 @@ async def update( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + interruption_sensitivity: Controls how sensitive the agent is to user interruptions. Value ranging from [0,1]. Lower value means it will take longer / more words for user to interrupt agent, while higher value means it's easier for user to interrupt agent. If @@ -2191,6 +2222,9 @@ async def update( stt_mode: If set, determines whether speech to text should focus on latency or accuracy. Default to fast mode. When set to custom, custom_stt_config must be provided. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + version_description: Optional description of the agent version. Used for your own reference and documentation. @@ -2281,6 +2315,7 @@ async def update( "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "interruption_sensitivity": interruption_sensitivity, "is_public": is_public, "ivr_option": ivr_option, @@ -2299,6 +2334,7 @@ async def update( "ring_duration_ms": ring_duration_ms, "signed_url_expiration_ms": signed_url_expiration_ms, "stt_mode": stt_mode, + "timezone": timezone, "user_dtmf_options": user_dtmf_options, "version_description": version_description, "vocab_specialization": vocab_specialization, diff --git a/src/retell/resources/chat_agent.py b/src/retell/resources/chat_agent.py index 80779213..ca5f1436 100644 --- a/src/retell/resources/chat_agent.py +++ b/src/retell/resources/chat_agent.py @@ -65,6 +65,7 @@ def create( | Omit = omit, end_chat_after_silence_ms: Optional[int] | Omit = omit, guardrail_config: chat_agent_create_params.GuardrailConfig | Omit = omit, + handbook_config: chat_agent_create_params.HandbookConfig | Omit = omit, is_public: Optional[bool] | Omit = omit, language: Literal[ "en-US", @@ -134,6 +135,7 @@ def create( ] | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, + timezone: Optional[str] | Omit = omit, webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] | Omit = omit, webhook_timeout_ms: int | Omit = omit, webhook_url: Optional[str] | Omit = omit, @@ -181,6 +183,9 @@ def create( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + Voice-only presets are not available for chat agents. + is_public: Whether the agent is public. When set to true, the agent is available for public agent preview link. @@ -204,6 +209,9 @@ def create( opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will apply. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + webhook_events: Which webhook events this agent should receive. If not set, defaults to chat_started, chat_ended, chat_analyzed. @@ -237,6 +245,7 @@ def create( "data_storage_setting": data_storage_setting, "end_chat_after_silence_ms": end_chat_after_silence_ms, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "is_public": is_public, "language": language, "opt_in_signed_url": opt_in_signed_url, @@ -244,6 +253,7 @@ def create( "post_chat_analysis_data": post_chat_analysis_data, "post_chat_analysis_model": post_chat_analysis_model, "signed_url_expiration_ms": signed_url_expiration_ms, + "timezone": timezone, "webhook_events": webhook_events, "webhook_timeout_ms": webhook_timeout_ms, "webhook_url": webhook_url, @@ -312,6 +322,7 @@ def update( | Omit = omit, end_chat_after_silence_ms: Optional[int] | Omit = omit, guardrail_config: chat_agent_update_params.GuardrailConfig | Omit = omit, + handbook_config: chat_agent_update_params.HandbookConfig | Omit = omit, is_public: Optional[bool] | Omit = omit, language: Literal[ "en-US", @@ -382,6 +393,7 @@ def update( | Omit = omit, response_engine: chat_agent_update_params.ResponseEngine | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, + timezone: Optional[str] | Omit = omit, webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] | Omit = omit, webhook_timeout_ms: int | Omit = omit, webhook_url: Optional[str] | Omit = omit, @@ -427,6 +439,9 @@ def update( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + Voice-only presets are not available for chat agents. + is_public: Whether the agent is public. When set to true, the agent is available for public agent preview link. @@ -454,6 +469,9 @@ def update( opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will apply. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + webhook_events: Which webhook events this agent should receive. If not set, defaults to chat_started, chat_ended, chat_analyzed. @@ -488,6 +506,7 @@ def update( "data_storage_setting": data_storage_setting, "end_chat_after_silence_ms": end_chat_after_silence_ms, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "is_public": is_public, "language": language, "opt_in_signed_url": opt_in_signed_url, @@ -496,6 +515,7 @@ def update( "post_chat_analysis_model": post_chat_analysis_model, "response_engine": response_engine, "signed_url_expiration_ms": signed_url_expiration_ms, + "timezone": timezone, "webhook_events": webhook_events, "webhook_timeout_ms": webhook_timeout_ms, "webhook_url": webhook_url, @@ -704,6 +724,7 @@ async def create( | Omit = omit, end_chat_after_silence_ms: Optional[int] | Omit = omit, guardrail_config: chat_agent_create_params.GuardrailConfig | Omit = omit, + handbook_config: chat_agent_create_params.HandbookConfig | Omit = omit, is_public: Optional[bool] | Omit = omit, language: Literal[ "en-US", @@ -773,6 +794,7 @@ async def create( ] | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, + timezone: Optional[str] | Omit = omit, webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] | Omit = omit, webhook_timeout_ms: int | Omit = omit, webhook_url: Optional[str] | Omit = omit, @@ -820,6 +842,9 @@ async def create( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + Voice-only presets are not available for chat agents. + is_public: Whether the agent is public. When set to true, the agent is available for public agent preview link. @@ -843,6 +868,9 @@ async def create( opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will apply. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + webhook_events: Which webhook events this agent should receive. If not set, defaults to chat_started, chat_ended, chat_analyzed. @@ -876,6 +904,7 @@ async def create( "data_storage_setting": data_storage_setting, "end_chat_after_silence_ms": end_chat_after_silence_ms, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "is_public": is_public, "language": language, "opt_in_signed_url": opt_in_signed_url, @@ -883,6 +912,7 @@ async def create( "post_chat_analysis_data": post_chat_analysis_data, "post_chat_analysis_model": post_chat_analysis_model, "signed_url_expiration_ms": signed_url_expiration_ms, + "timezone": timezone, "webhook_events": webhook_events, "webhook_timeout_ms": webhook_timeout_ms, "webhook_url": webhook_url, @@ -953,6 +983,7 @@ async def update( | Omit = omit, end_chat_after_silence_ms: Optional[int] | Omit = omit, guardrail_config: chat_agent_update_params.GuardrailConfig | Omit = omit, + handbook_config: chat_agent_update_params.HandbookConfig | Omit = omit, is_public: Optional[bool] | Omit = omit, language: Literal[ "en-US", @@ -1023,6 +1054,7 @@ async def update( | Omit = omit, response_engine: chat_agent_update_params.ResponseEngine | Omit = omit, signed_url_expiration_ms: Optional[int] | Omit = omit, + timezone: Optional[str] | Omit = omit, webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] | Omit = omit, webhook_timeout_ms: int | Omit = omit, webhook_url: Optional[str] | Omit = omit, @@ -1068,6 +1100,9 @@ async def update( guardrail_config: Configuration for guardrail checks to detect and prevent prohibited topics in agent output and user input. + handbook_config: Toggle behavior presets on/off to influence agent response style and behaviors. + Voice-only presets are not available for chat agents. + is_public: Whether the agent is public. When set to true, the agent is available for public agent preview link. @@ -1095,6 +1130,9 @@ async def update( opt_in_signed_url is true. If not set, default value of 86400000 (24 hours) will apply. + timezone: IANA timezone for the agent (e.g. America/New_York). Defaults to + America/Los_Angeles if not set. + webhook_events: Which webhook events this agent should receive. If not set, defaults to chat_started, chat_ended, chat_analyzed. @@ -1129,6 +1167,7 @@ async def update( "data_storage_setting": data_storage_setting, "end_chat_after_silence_ms": end_chat_after_silence_ms, "guardrail_config": guardrail_config, + "handbook_config": handbook_config, "is_public": is_public, "language": language, "opt_in_signed_url": opt_in_signed_url, @@ -1137,6 +1176,7 @@ async def update( "post_chat_analysis_model": post_chat_analysis_model, "response_engine": response_engine, "signed_url_expiration_ms": signed_url_expiration_ms, + "timezone": timezone, "webhook_events": webhook_events, "webhook_timeout_ms": webhook_timeout_ms, "webhook_url": webhook_url, diff --git a/src/retell/resources/conversation_flow.py b/src/retell/resources/conversation_flow.py index bd24aa62..2bd2a136 100644 --- a/src/retell/resources/conversation_flow.py +++ b/src/retell/resources/conversation_flow.py @@ -66,6 +66,7 @@ def create( knowledge_base_ids: Optional[SequenceNotStr[str]] | Omit = omit, mcps: Optional[Iterable[conversation_flow_create_params.Mcp]] | Omit = omit, model_temperature: Optional[float] | Omit = omit, + notes: Optional[Iterable[conversation_flow_create_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tool_call_strict_mode: Optional[bool] | Omit = omit, tools: Optional[Iterable[conversation_flow_create_params.Tool]] | Omit = omit, @@ -113,6 +114,8 @@ def create( model_temperature: Controls the randomness of the model's responses. Lower values make responses more deterministic. + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the start node in the conversation flow. tool_call_strict_mode: Whether to use strict mode for tool calls. Only applicable when using certain @@ -145,6 +148,7 @@ def create( "knowledge_base_ids": knowledge_base_ids, "mcps": mcps, "model_temperature": model_temperature, + "notes": notes, "start_node_id": start_node_id, "tool_call_strict_mode": tool_call_strict_mode, "tools": tools, @@ -219,6 +223,7 @@ def update( model_choice: conversation_flow_update_params.ModelChoice | Omit = omit, model_temperature: Optional[float] | Omit = omit, nodes: Iterable[conversation_flow_update_params.Node] | Omit = omit, + notes: Optional[Iterable[conversation_flow_update_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, start_speaker: Literal["user", "agent"] | Omit = omit, tool_call_strict_mode: Optional[bool] | Omit = omit, @@ -265,6 +270,8 @@ def update( nodes: Array of nodes in the conversation flow. + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the start node in the conversation flow. start_speaker: Who starts the conversation - user or agent. @@ -304,6 +311,7 @@ def update( "model_choice": model_choice, "model_temperature": model_temperature, "nodes": nodes, + "notes": notes, "start_node_id": start_node_id, "start_speaker": start_speaker, "tool_call_strict_mode": tool_call_strict_mode, @@ -455,6 +463,7 @@ async def create( knowledge_base_ids: Optional[SequenceNotStr[str]] | Omit = omit, mcps: Optional[Iterable[conversation_flow_create_params.Mcp]] | Omit = omit, model_temperature: Optional[float] | Omit = omit, + notes: Optional[Iterable[conversation_flow_create_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tool_call_strict_mode: Optional[bool] | Omit = omit, tools: Optional[Iterable[conversation_flow_create_params.Tool]] | Omit = omit, @@ -502,6 +511,8 @@ async def create( model_temperature: Controls the randomness of the model's responses. Lower values make responses more deterministic. + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the start node in the conversation flow. tool_call_strict_mode: Whether to use strict mode for tool calls. Only applicable when using certain @@ -534,6 +545,7 @@ async def create( "knowledge_base_ids": knowledge_base_ids, "mcps": mcps, "model_temperature": model_temperature, + "notes": notes, "start_node_id": start_node_id, "tool_call_strict_mode": tool_call_strict_mode, "tools": tools, @@ -608,6 +620,7 @@ async def update( model_choice: conversation_flow_update_params.ModelChoice | Omit = omit, model_temperature: Optional[float] | Omit = omit, nodes: Iterable[conversation_flow_update_params.Node] | Omit = omit, + notes: Optional[Iterable[conversation_flow_update_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, start_speaker: Literal["user", "agent"] | Omit = omit, tool_call_strict_mode: Optional[bool] | Omit = omit, @@ -654,6 +667,8 @@ async def update( nodes: Array of nodes in the conversation flow. + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the start node in the conversation flow. start_speaker: Who starts the conversation - user or agent. @@ -693,6 +708,7 @@ async def update( "model_choice": model_choice, "model_temperature": model_temperature, "nodes": nodes, + "notes": notes, "start_node_id": start_node_id, "start_speaker": start_speaker, "tool_call_strict_mode": tool_call_strict_mode, diff --git a/src/retell/resources/conversation_flow_component.py b/src/retell/resources/conversation_flow_component.py index 9800d1bc..b2a40147 100644 --- a/src/retell/resources/conversation_flow_component.py +++ b/src/retell/resources/conversation_flow_component.py @@ -52,6 +52,7 @@ def create( begin_tag_display_position: Optional[conversation_flow_component_create_params.BeginTagDisplayPosition] | Omit = omit, mcps: Optional[Iterable[conversation_flow_component_create_params.Mcp]] | Omit = omit, + notes: Optional[Iterable[conversation_flow_component_create_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tools: Optional[Iterable[conversation_flow_component_create_params.Tool]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -73,6 +74,8 @@ def create( mcps: A list of MCP server configurations to use for this component + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the starting node tools: Tools available within the component @@ -93,6 +96,7 @@ def create( "nodes": nodes, "begin_tag_display_position": begin_tag_display_position, "mcps": mcps, + "notes": notes, "start_node_id": start_node_id, "tools": tools, }, @@ -151,6 +155,7 @@ def update( mcps: Optional[Iterable[conversation_flow_component_update_params.Mcp]] | Omit = omit, name: str | Omit = omit, nodes: Iterable[conversation_flow_component_update_params.Node] | Omit = omit, + notes: Optional[Iterable[conversation_flow_component_update_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tools: Optional[Iterable[conversation_flow_component_update_params.Tool]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -172,6 +177,8 @@ def update( nodes: Nodes that make up the component + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the starting node tools: Tools available within the component @@ -199,6 +206,7 @@ def update( "mcps": mcps, "name": name, "nodes": nodes, + "notes": notes, "start_node_id": start_node_id, "tools": tools, }, @@ -299,6 +307,7 @@ async def create( begin_tag_display_position: Optional[conversation_flow_component_create_params.BeginTagDisplayPosition] | Omit = omit, mcps: Optional[Iterable[conversation_flow_component_create_params.Mcp]] | Omit = omit, + notes: Optional[Iterable[conversation_flow_component_create_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tools: Optional[Iterable[conversation_flow_component_create_params.Tool]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -320,6 +329,8 @@ async def create( mcps: A list of MCP server configurations to use for this component + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the starting node tools: Tools available within the component @@ -340,6 +351,7 @@ async def create( "nodes": nodes, "begin_tag_display_position": begin_tag_display_position, "mcps": mcps, + "notes": notes, "start_node_id": start_node_id, "tools": tools, }, @@ -398,6 +410,7 @@ async def update( mcps: Optional[Iterable[conversation_flow_component_update_params.Mcp]] | Omit = omit, name: str | Omit = omit, nodes: Iterable[conversation_flow_component_update_params.Node] | Omit = omit, + notes: Optional[Iterable[conversation_flow_component_update_params.Note]] | Omit = omit, start_node_id: Optional[str] | Omit = omit, tools: Optional[Iterable[conversation_flow_component_update_params.Tool]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -419,6 +432,8 @@ async def update( nodes: Nodes that make up the component + notes: Visual annotations displayed on the flow canvas. + start_node_id: ID of the starting node tools: Tools available within the component @@ -446,6 +461,7 @@ async def update( "mcps": mcps, "name": name, "nodes": nodes, + "notes": notes, "start_node_id": start_node_id, "tools": tools, }, diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index 9beb8929..22a94f78 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -15,6 +15,7 @@ "ResponseEngineResponseEngineConversationFlow", "CustomSttConfig", "GuardrailConfig", + "HandbookConfig", "IvrOption", "IvrOptionAction", "PiiConfig", @@ -23,6 +24,7 @@ "PostCallAnalysisDataEnumAnalysisData", "PostCallAnalysisDataBooleanAnalysisData", "PostCallAnalysisDataNumberAnalysisData", + "PostCallAnalysisDataCallPresetAnalysisData", "PronunciationDictionary", "UserDtmfOptions", "VoicemailOption", @@ -213,6 +215,9 @@ class AgentCreateParams(TypedDict, total=False): agent output and user input. """ + handbook_config: HandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -416,6 +421,12 @@ class AgentCreateParams(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[UserDtmfOptions] version_description: Optional[str] @@ -623,6 +634,43 @@ class GuardrailConfig(TypedDict, total=False): """ +class HandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class IvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -674,6 +722,13 @@ class PostCallAnalysisDataStringAnalysisData(TypedDict, total=False): type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -697,6 +752,13 @@ class PostCallAnalysisDataEnumAnalysisData(TypedDict, total=False): type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -714,6 +776,13 @@ class PostCallAnalysisDataBooleanAnalysisData(TypedDict, total=False): type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -731,6 +800,13 @@ class PostCallAnalysisDataNumberAnalysisData(TypedDict, total=False): type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -738,11 +814,40 @@ class PostCallAnalysisDataNumberAnalysisData(TypedDict, total=False): """ +class PostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostCallAnalysisData: TypeAlias = Union[ PostCallAnalysisDataStringAnalysisData, PostCallAnalysisDataEnumAnalysisData, PostCallAnalysisDataBooleanAnalysisData, PostCallAnalysisDataNumberAnalysisData, + PostCallAnalysisDataCallPresetAnalysisData, ] diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index 2284f406..8f8bc0e2 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -13,6 +13,7 @@ "ResponseEngineResponseEngineConversationFlow", "CustomSttConfig", "GuardrailConfig", + "HandbookConfig", "IvrOption", "IvrOptionAction", "PiiConfig", @@ -21,6 +22,7 @@ "PostCallAnalysisDataEnumAnalysisData", "PostCallAnalysisDataBooleanAnalysisData", "PostCallAnalysisDataNumberAnalysisData", + "PostCallAnalysisDataCallPresetAnalysisData", "PronunciationDictionary", "UserDtmfOptions", "VoicemailOption", @@ -113,6 +115,43 @@ class GuardrailConfig(BaseModel): """ +class HandbookConfig(BaseModel): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: Optional[bool] = None + """When asked, acknowledge being a virtual assistant.""" + + default_personality: Optional[bool] = None + """Professional call center rep baseline.""" + + echo_verification: Optional[bool] = None + """Repeat back and confirm important details (voice only).""" + + high_empathy: Optional[bool] = None + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: Optional[bool] = None + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: Optional[bool] = None + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: Optional[bool] = None + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: Optional[bool] = None + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: Optional[bool] = None + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class IvrOptionAction(BaseModel): type: Literal["hangup"] @@ -162,6 +201,13 @@ class PostCallAnalysisDataStringAnalysisData(BaseModel): type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -185,6 +231,13 @@ class PostCallAnalysisDataEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -202,6 +255,13 @@ class PostCallAnalysisDataBooleanAnalysisData(BaseModel): type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -219,6 +279,13 @@ class PostCallAnalysisDataNumberAnalysisData(BaseModel): type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -226,11 +293,40 @@ class PostCallAnalysisDataNumberAnalysisData(BaseModel): """ +class PostCallAnalysisDataCallPresetAnalysisData(BaseModel): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Literal["call_summary", "call_successful", "user_sentiment"] + """Preset identifier for voice agent analysis.""" + + type: Literal["system-presets"] + """Identifies this item as a system preset.""" + + conditional_prompt: Optional[str] = None + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: Optional[str] = None + """Prompt or description for this preset.""" + + required: Optional[bool] = None + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostCallAnalysisData: TypeAlias = Union[ PostCallAnalysisDataStringAnalysisData, PostCallAnalysisDataEnumAnalysisData, PostCallAnalysisDataBooleanAnalysisData, PostCallAnalysisDataNumberAnalysisData, + PostCallAnalysisDataCallPresetAnalysisData, ] @@ -501,6 +597,9 @@ class AgentResponse(BaseModel): agent output and user input. """ + handbook_config: Optional[HandbookConfig] = None + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: Optional[float] = None """Controls how sensitive the agent is to user interruptions. @@ -709,6 +808,12 @@ class AgentResponse(BaseModel): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] = None + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[UserDtmfOptions] = None version_description: Optional[str] = None diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index eaf136b3..08d4a10e 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -11,6 +11,7 @@ "AgentUpdateParams", "CustomSttConfig", "GuardrailConfig", + "HandbookConfig", "IvrOption", "IvrOptionAction", "PiiConfig", @@ -19,6 +20,7 @@ "PostCallAnalysisDataEnumAnalysisData", "PostCallAnalysisDataBooleanAnalysisData", "PostCallAnalysisDataNumberAnalysisData", + "PostCallAnalysisDataCallPresetAnalysisData", "PronunciationDictionary", "ResponseEngine", "ResponseEngineResponseEngineRetellLm", @@ -203,6 +205,9 @@ class AgentUpdateParams(TypedDict, total=False): agent output and user input. """ + handbook_config: HandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -413,6 +418,12 @@ class AgentUpdateParams(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[UserDtmfOptions] version_description: Optional[str] @@ -589,6 +600,43 @@ class GuardrailConfig(TypedDict, total=False): """ +class HandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class IvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -640,6 +688,13 @@ class PostCallAnalysisDataStringAnalysisData(TypedDict, total=False): type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -663,6 +718,13 @@ class PostCallAnalysisDataEnumAnalysisData(TypedDict, total=False): type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -680,6 +742,13 @@ class PostCallAnalysisDataBooleanAnalysisData(TypedDict, total=False): type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -697,6 +766,13 @@ class PostCallAnalysisDataNumberAnalysisData(TypedDict, total=False): type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -704,11 +780,40 @@ class PostCallAnalysisDataNumberAnalysisData(TypedDict, total=False): """ +class PostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostCallAnalysisData: TypeAlias = Union[ PostCallAnalysisDataStringAnalysisData, PostCallAnalysisDataEnumAnalysisData, PostCallAnalysisDataBooleanAnalysisData, PostCallAnalysisDataNumberAnalysisData, + PostCallAnalysisDataCallPresetAnalysisData, ] diff --git a/src/retell/types/batch_call_create_batch_call_params.py b/src/retell/types/batch_call_create_batch_call_params.py index f0aacbdc..62d1a0eb 100644 --- a/src/retell/types/batch_call_create_batch_call_params.py +++ b/src/retell/types/batch_call_create_batch_call_params.py @@ -14,6 +14,7 @@ "TaskAgentOverrideAgent", "TaskAgentOverrideAgentCustomSttConfig", "TaskAgentOverrideAgentGuardrailConfig", + "TaskAgentOverrideAgentHandbookConfig", "TaskAgentOverrideAgentIvrOption", "TaskAgentOverrideAgentIvrOptionAction", "TaskAgentOverrideAgentPiiConfig", @@ -22,6 +23,7 @@ "TaskAgentOverrideAgentPostCallAnalysisDataEnumAnalysisData", "TaskAgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData", "TaskAgentOverrideAgentPostCallAnalysisDataNumberAnalysisData", + "TaskAgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData", "TaskAgentOverrideAgentPronunciationDictionary", "TaskAgentOverrideAgentResponseEngine", "TaskAgentOverrideAgentResponseEngineResponseEngineRetellLm", @@ -127,6 +129,43 @@ class TaskAgentOverrideAgentGuardrailConfig(TypedDict, total=False): """ +class TaskAgentOverrideAgentHandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class TaskAgentOverrideAgentIvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -178,6 +217,13 @@ class TaskAgentOverrideAgentPostCallAnalysisDataStringAnalysisData(TypedDict, to type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -201,6 +247,13 @@ class TaskAgentOverrideAgentPostCallAnalysisDataEnumAnalysisData(TypedDict, tota type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -218,6 +271,13 @@ class TaskAgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData(TypedDict, t type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -235,6 +295,13 @@ class TaskAgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, to type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -242,11 +309,40 @@ class TaskAgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, to """ +class TaskAgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + TaskAgentOverrideAgentPostCallAnalysisData: TypeAlias = Union[ TaskAgentOverrideAgentPostCallAnalysisDataStringAnalysisData, TaskAgentOverrideAgentPostCallAnalysisDataEnumAnalysisData, TaskAgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData, TaskAgentOverrideAgentPostCallAnalysisDataNumberAnalysisData, + TaskAgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData, ] @@ -532,6 +628,9 @@ class TaskAgentOverrideAgent(TypedDict, total=False): agent output and user input. """ + handbook_config: TaskAgentOverrideAgentHandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -742,6 +841,12 @@ class TaskAgentOverrideAgent(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[TaskAgentOverrideAgentUserDtmfOptions] version_description: Optional[str] diff --git a/src/retell/types/call_create_phone_call_params.py b/src/retell/types/call_create_phone_call_params.py index 745be62b..cfa2db9d 100644 --- a/src/retell/types/call_create_phone_call_params.py +++ b/src/retell/types/call_create_phone_call_params.py @@ -13,6 +13,7 @@ "AgentOverrideAgent", "AgentOverrideAgentCustomSttConfig", "AgentOverrideAgentGuardrailConfig", + "AgentOverrideAgentHandbookConfig", "AgentOverrideAgentIvrOption", "AgentOverrideAgentIvrOptionAction", "AgentOverrideAgentPiiConfig", @@ -21,6 +22,7 @@ "AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData", "AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData", "AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData", + "AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData", "AgentOverrideAgentPronunciationDictionary", "AgentOverrideAgentResponseEngine", "AgentOverrideAgentResponseEngineResponseEngineRetellLm", @@ -146,6 +148,43 @@ class AgentOverrideAgentGuardrailConfig(TypedDict, total=False): """ +class AgentOverrideAgentHandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class AgentOverrideAgentIvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -197,6 +236,13 @@ class AgentOverrideAgentPostCallAnalysisDataStringAnalysisData(TypedDict, total= type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -220,6 +266,13 @@ class AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData(TypedDict, total=Fa type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -237,6 +290,13 @@ class AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData(TypedDict, total type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -254,6 +314,13 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -261,11 +328,40 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= """ +class AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + AgentOverrideAgentPostCallAnalysisData: TypeAlias = Union[ AgentOverrideAgentPostCallAnalysisDataStringAnalysisData, AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData, AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData, AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData, + AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData, ] @@ -551,6 +647,9 @@ class AgentOverrideAgent(TypedDict, total=False): agent output and user input. """ + handbook_config: AgentOverrideAgentHandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -761,6 +860,12 @@ class AgentOverrideAgent(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[AgentOverrideAgentUserDtmfOptions] version_description: Optional[str] diff --git a/src/retell/types/call_create_web_call_params.py b/src/retell/types/call_create_web_call_params.py index 109008de..bb465fcb 100644 --- a/src/retell/types/call_create_web_call_params.py +++ b/src/retell/types/call_create_web_call_params.py @@ -13,6 +13,7 @@ "AgentOverrideAgent", "AgentOverrideAgentCustomSttConfig", "AgentOverrideAgentGuardrailConfig", + "AgentOverrideAgentHandbookConfig", "AgentOverrideAgentIvrOption", "AgentOverrideAgentIvrOptionAction", "AgentOverrideAgentPiiConfig", @@ -21,6 +22,7 @@ "AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData", "AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData", "AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData", + "AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData", "AgentOverrideAgentPronunciationDictionary", "AgentOverrideAgentResponseEngine", "AgentOverrideAgentResponseEngineResponseEngineRetellLm", @@ -133,6 +135,43 @@ class AgentOverrideAgentGuardrailConfig(TypedDict, total=False): """ +class AgentOverrideAgentHandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class AgentOverrideAgentIvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -184,6 +223,13 @@ class AgentOverrideAgentPostCallAnalysisDataStringAnalysisData(TypedDict, total= type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -207,6 +253,13 @@ class AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData(TypedDict, total=Fa type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -224,6 +277,13 @@ class AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData(TypedDict, total type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -241,6 +301,13 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -248,11 +315,40 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= """ +class AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + AgentOverrideAgentPostCallAnalysisData: TypeAlias = Union[ AgentOverrideAgentPostCallAnalysisDataStringAnalysisData, AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData, AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData, AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData, + AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData, ] @@ -538,6 +634,9 @@ class AgentOverrideAgent(TypedDict, total=False): agent output and user input. """ + handbook_config: AgentOverrideAgentHandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -748,6 +847,12 @@ class AgentOverrideAgent(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[AgentOverrideAgentUserDtmfOptions] version_description: Optional[str] diff --git a/src/retell/types/call_register_phone_call_params.py b/src/retell/types/call_register_phone_call_params.py index 063942b0..fda51e42 100644 --- a/src/retell/types/call_register_phone_call_params.py +++ b/src/retell/types/call_register_phone_call_params.py @@ -13,6 +13,7 @@ "AgentOverrideAgent", "AgentOverrideAgentCustomSttConfig", "AgentOverrideAgentGuardrailConfig", + "AgentOverrideAgentHandbookConfig", "AgentOverrideAgentIvrOption", "AgentOverrideAgentIvrOptionAction", "AgentOverrideAgentPiiConfig", @@ -21,6 +22,7 @@ "AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData", "AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData", "AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData", + "AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData", "AgentOverrideAgentPronunciationDictionary", "AgentOverrideAgentResponseEngine", "AgentOverrideAgentResponseEngineResponseEngineRetellLm", @@ -124,6 +126,43 @@ class AgentOverrideAgentGuardrailConfig(TypedDict, total=False): """ +class AgentOverrideAgentHandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + echo_verification: bool + """Repeat back and confirm important details (voice only).""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + nato_phonetic_alphabet: bool + """Spell using NATO phonetic alphabet style (voice only).""" + + natural_filler_words: bool + """ + Sprinkle natural speech fillers like "um", "you know" for a more human, + conversational tone. + """ + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + smart_matching: bool + """ + Treat near-match similar words as same entity to reduce impact of transcription + error (voice only). + """ + + speech_normalization: bool + """Convert numbers/dates/currency to spoken forms (voice only).""" + + class AgentOverrideAgentIvrOptionAction(TypedDict, total=False): type: Required[Literal["hangup"]] @@ -175,6 +214,13 @@ class AgentOverrideAgentPostCallAnalysisDataStringAnalysisData(TypedDict, total= type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -198,6 +244,13 @@ class AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData(TypedDict, total=Fa type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -215,6 +268,13 @@ class AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData(TypedDict, total type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -232,6 +292,13 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -239,11 +306,40 @@ class AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData(TypedDict, total= """ +class AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData(TypedDict, total=False): + """System preset for post-call analysis (voice agents). + + Use in post_call_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["call_summary", "call_successful", "user_sentiment"]] + """Preset identifier for voice agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + AgentOverrideAgentPostCallAnalysisData: TypeAlias = Union[ AgentOverrideAgentPostCallAnalysisDataStringAnalysisData, AgentOverrideAgentPostCallAnalysisDataEnumAnalysisData, AgentOverrideAgentPostCallAnalysisDataBooleanAnalysisData, AgentOverrideAgentPostCallAnalysisDataNumberAnalysisData, + AgentOverrideAgentPostCallAnalysisDataCallPresetAnalysisData, ] @@ -529,6 +625,9 @@ class AgentOverrideAgent(TypedDict, total=False): agent output and user input. """ + handbook_config: AgentOverrideAgentHandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors.""" + interruption_sensitivity: float """Controls how sensitive the agent is to user interruptions. @@ -739,6 +838,12 @@ class AgentOverrideAgent(TypedDict, total=False): Default to fast mode. When set to custom, custom_stt_config must be provided. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + user_dtmf_options: Optional[AgentOverrideAgentUserDtmfOptions] version_description: Optional[str] diff --git a/src/retell/types/chat_agent_create_params.py b/src/retell/types/chat_agent_create_params.py index 00eab1e5..2709175c 100644 --- a/src/retell/types/chat_agent_create_params.py +++ b/src/retell/types/chat_agent_create_params.py @@ -14,12 +14,14 @@ "ResponseEngineResponseEngineCustomLm", "ResponseEngineResponseEngineConversationFlow", "GuardrailConfig", + "HandbookConfig", "PiiConfig", "PostChatAnalysisData", "PostChatAnalysisDataStringAnalysisData", "PostChatAnalysisDataEnumAnalysisData", "PostChatAnalysisDataBooleanAnalysisData", "PostChatAnalysisDataNumberAnalysisData", + "PostChatAnalysisDataChatPresetAnalysisData", ] @@ -85,6 +87,12 @@ class ChatAgentCreateParams(TypedDict, total=False): agent output and user input. """ + handbook_config: HandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + is_public: Optional[bool] """Whether the agent is public. @@ -185,6 +193,12 @@ class ChatAgentCreateParams(TypedDict, total=False): 86400000 (24 hours) will apply. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] """Which webhook events this agent should receive. @@ -278,6 +292,25 @@ class GuardrailConfig(TypedDict, total=False): """ +class HandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + class PiiConfig(TypedDict, total=False): """Configuration for PII scrubbing from transcripts and recordings.""" @@ -317,6 +350,13 @@ class PostChatAnalysisDataStringAnalysisData(TypedDict, total=False): type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -340,6 +380,13 @@ class PostChatAnalysisDataEnumAnalysisData(TypedDict, total=False): type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -357,6 +404,13 @@ class PostChatAnalysisDataBooleanAnalysisData(TypedDict, total=False): type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -374,6 +428,13 @@ class PostChatAnalysisDataNumberAnalysisData(TypedDict, total=False): type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -381,9 +442,38 @@ class PostChatAnalysisDataNumberAnalysisData(TypedDict, total=False): """ +class PostChatAnalysisDataChatPresetAnalysisData(TypedDict, total=False): + """System preset for post-chat analysis (chat agents). + + Use in post_chat_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["chat_summary", "chat_successful", "user_sentiment"]] + """Preset identifier for chat agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostChatAnalysisData: TypeAlias = Union[ PostChatAnalysisDataStringAnalysisData, PostChatAnalysisDataEnumAnalysisData, PostChatAnalysisDataBooleanAnalysisData, PostChatAnalysisDataNumberAnalysisData, + PostChatAnalysisDataChatPresetAnalysisData, ] diff --git a/src/retell/types/chat_agent_response.py b/src/retell/types/chat_agent_response.py index 7e0f5783..84ee6251 100644 --- a/src/retell/types/chat_agent_response.py +++ b/src/retell/types/chat_agent_response.py @@ -12,12 +12,14 @@ "ResponseEngineResponseEngineCustomLm", "ResponseEngineResponseEngineConversationFlow", "GuardrailConfig", + "HandbookConfig", "PiiConfig", "PostChatAnalysisData", "PostChatAnalysisDataStringAnalysisData", "PostChatAnalysisDataEnumAnalysisData", "PostChatAnalysisDataBooleanAnalysisData", "PostChatAnalysisDataNumberAnalysisData", + "PostChatAnalysisDataChatPresetAnalysisData", ] @@ -92,6 +94,25 @@ class GuardrailConfig(BaseModel): """ +class HandbookConfig(BaseModel): + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + + ai_disclosure: Optional[bool] = None + """When asked, acknowledge being a virtual assistant.""" + + default_personality: Optional[bool] = None + """Professional call center rep baseline.""" + + high_empathy: Optional[bool] = None + """Warm acknowledgment of caller concerns.""" + + scope_boundaries: Optional[bool] = None + """Stay within prompt/context scope, don't invent details.""" + + class PiiConfig(BaseModel): """Configuration for PII scrubbing from transcripts and recordings.""" @@ -129,6 +150,13 @@ class PostChatAnalysisDataStringAnalysisData(BaseModel): type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -152,6 +180,13 @@ class PostChatAnalysisDataEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -169,6 +204,13 @@ class PostChatAnalysisDataBooleanAnalysisData(BaseModel): type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -186,6 +228,13 @@ class PostChatAnalysisDataNumberAnalysisData(BaseModel): type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -193,11 +242,40 @@ class PostChatAnalysisDataNumberAnalysisData(BaseModel): """ +class PostChatAnalysisDataChatPresetAnalysisData(BaseModel): + """System preset for post-chat analysis (chat agents). + + Use in post_chat_analysis_data to override prompts or mark fields optional. + """ + + name: Literal["chat_summary", "chat_successful", "user_sentiment"] + """Preset identifier for chat agent analysis.""" + + type: Literal["system-presets"] + """Identifies this item as a system preset.""" + + conditional_prompt: Optional[str] = None + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: Optional[str] = None + """Prompt or description for this preset.""" + + required: Optional[bool] = None + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostChatAnalysisData: TypeAlias = Union[ PostChatAnalysisDataStringAnalysisData, PostChatAnalysisDataEnumAnalysisData, PostChatAnalysisDataBooleanAnalysisData, PostChatAnalysisDataNumberAnalysisData, + PostChatAnalysisDataChatPresetAnalysisData, ] @@ -272,6 +350,12 @@ class ChatAgentResponse(BaseModel): agent output and user input. """ + handbook_config: Optional[HandbookConfig] = None + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + is_public: Optional[bool] = None """Whether the agent is public. @@ -377,6 +461,12 @@ class ChatAgentResponse(BaseModel): 86400000 (24 hours) will apply. """ + timezone: Optional[str] = None + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + version: Optional[int] = None """The version of the chat agent.""" diff --git a/src/retell/types/chat_agent_update_params.py b/src/retell/types/chat_agent_update_params.py index 2e194b3c..6074ee7f 100644 --- a/src/retell/types/chat_agent_update_params.py +++ b/src/retell/types/chat_agent_update_params.py @@ -10,12 +10,14 @@ __all__ = [ "ChatAgentUpdateParams", "GuardrailConfig", + "HandbookConfig", "PiiConfig", "PostChatAnalysisData", "PostChatAnalysisDataStringAnalysisData", "PostChatAnalysisDataEnumAnalysisData", "PostChatAnalysisDataBooleanAnalysisData", "PostChatAnalysisDataNumberAnalysisData", + "PostChatAnalysisDataChatPresetAnalysisData", "ResponseEngine", "ResponseEngineResponseEngineRetellLm", "ResponseEngineResponseEngineCustomLm", @@ -81,6 +83,12 @@ class ChatAgentUpdateParams(TypedDict, total=False): agent output and user input. """ + handbook_config: HandbookConfig + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + is_public: Optional[bool] """Whether the agent is public. @@ -188,6 +196,12 @@ class ChatAgentUpdateParams(TypedDict, total=False): 86400000 (24 hours) will apply. """ + timezone: Optional[str] + """IANA timezone for the agent (e.g. + + America/New_York). Defaults to America/Los_Angeles if not set. + """ + webhook_events: Optional[List[Literal["chat_started", "chat_ended", "chat_analyzed"]]] """Which webhook events this agent should receive. @@ -244,6 +258,25 @@ class GuardrailConfig(TypedDict, total=False): """ +class HandbookConfig(TypedDict, total=False): + """Toggle behavior presets on/off to influence agent response style and behaviors. + + Voice-only presets are not available for chat agents. + """ + + ai_disclosure: bool + """When asked, acknowledge being a virtual assistant.""" + + default_personality: bool + """Professional call center rep baseline.""" + + high_empathy: bool + """Warm acknowledgment of caller concerns.""" + + scope_boundaries: bool + """Stay within prompt/context scope, don't invent details.""" + + class PiiConfig(TypedDict, total=False): """Configuration for PII scrubbing from transcripts and recordings.""" @@ -283,6 +316,13 @@ class PostChatAnalysisDataStringAnalysisData(TypedDict, total=False): type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -306,6 +346,13 @@ class PostChatAnalysisDataEnumAnalysisData(TypedDict, total=False): type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -323,6 +370,13 @@ class PostChatAnalysisDataBooleanAnalysisData(TypedDict, total=False): type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -340,6 +394,13 @@ class PostChatAnalysisDataNumberAnalysisData(TypedDict, total=False): type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -347,11 +408,40 @@ class PostChatAnalysisDataNumberAnalysisData(TypedDict, total=False): """ +class PostChatAnalysisDataChatPresetAnalysisData(TypedDict, total=False): + """System preset for post-chat analysis (chat agents). + + Use in post_chat_analysis_data to override prompts or mark fields optional. + """ + + name: Required[Literal["chat_summary", "chat_successful", "user_sentiment"]] + """Preset identifier for chat agent analysis.""" + + type: Required[Literal["system-presets"]] + """Identifies this item as a system preset.""" + + conditional_prompt: str + """Optional instruction to help decide whether this field needs to be populated. + + If not set, the field is always included. + """ + + description: str + """Prompt or description for this preset.""" + + required: bool + """If false, this field is optional in the analysis. + + If true or unset, the field is required. + """ + + PostChatAnalysisData: TypeAlias = Union[ PostChatAnalysisDataStringAnalysisData, PostChatAnalysisDataEnumAnalysisData, PostChatAnalysisDataBooleanAnalysisData, PostChatAnalysisDataNumberAnalysisData, + PostChatAnalysisDataChatPresetAnalysisData, ] diff --git a/src/retell/types/conversation_flow_component_create_params.py b/src/retell/types/conversation_flow_component_create_params.py index 065c0d9f..d7fbf16e 100644 --- a/src/retell/types/conversation_flow_component_create_params.py +++ b/src/retell/types/conversation_flow_component_create_params.py @@ -59,48 +59,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -531,6 +578,9 @@ "NodeCancelTransferNodeModelChoice", "BeginTagDisplayPosition", "Mcp", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -552,6 +602,9 @@ class ConversationFlowComponentCreateParams(TypedDict, total=False): mcps: Optional[Iterable[Mcp]] """A list of MCP server configurations to use for this component""" + notes: Optional[Iterable[Note]] + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] """ID of the starting node""" @@ -1001,7 +1054,474 @@ class NodeConversationNodeSkipResponseEdge(TypedDict, total=False): """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(TypedDict, total=False): +class NodeConversationNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + instruction: Required[NodeConversationNodeInstruction] + + type: Required[Literal["conversation"]] + """Type of the node""" + + always_edge: NodeConversationNodeAlwaysEdge + + display_position: NodeConversationNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[NodeConversationNodeEdge] + + finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + + finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + + global_node_setting: NodeConversationNodeGlobalNodeSetting + + interruption_sensitivity: Optional[float] + + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + + model_choice: NodeConversationNodeModelChoice + + name: str + """Optional name for display purposes""" + + responsiveness: Optional[float] + + skip_response_edge: NodeConversationNodeSkipResponseEdge + + voice_speed: Optional[float] + + +class NodeSubagentNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Always"] + """Must be "Always" for always edge""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" + + type: Required[Literal["prompt"]] + + +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeAlwaysEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition +] + + +class NodeSubagentNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeSubagentNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeSubagentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[NodeSubagentNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeSubagentNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" + + type: Required[Literal["prompt"]] + + +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeSkipResponseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1036,7 +1556,7 @@ class NodeConversationNodeToolEndCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): number: Required[str] """ The number to transfer to in E.164 format or a dynamic variable like @@ -1054,7 +1574,7 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """ -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): prompt: Required[str] """The prompt to be used to help infer the transfer destination. @@ -1067,13 +1587,13 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """The type of transfer destination.""" -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): type: Required[Literal["cold_transfer"]] """The type of the transfer.""" @@ -1101,7 +1621,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1113,7 +1633,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1122,7 +1642,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1131,13 +1651,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1146,7 +1666,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1155,13 +1675,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): type: Required[Literal["warm_transfer"]] """The type of the transfer.""" @@ -1171,7 +1691,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr enable_bridge_audio_cue: bool """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + ivr_option: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1187,7 +1707,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ private_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ) """ If set, when transfer is connected, will say the handoff message only to the @@ -1196,7 +1716,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -1218,7 +1738,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( TypedDict, total=False ): """The agent that will mediate the transfer decision.""" @@ -1235,7 +1755,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The version of the transfer agent to use.""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( TypedDict, total=False ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1246,7 +1766,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti Defaults to cancel_transfer. """ - transfer_agent: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + transfer_agent: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent """The agent that will mediate the transfer decision.""" transfer_timeout_ms: float @@ -1256,7 +1776,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1265,7 +1785,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1274,15 +1794,15 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): agentic_transfer_config: Required[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ] """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1296,7 +1816,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The music to play while the caller is being transferred.""" public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -1318,14 +1838,14 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1333,9 +1853,9 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): tools + state tools + state edges). """ - transfer_destination: Required[NodeConversationNodeToolTransferCallToolTransferDestination] + transfer_destination: Required[NodeSubagentNodeToolTransferCallToolTransferDestination] - transfer_option: Required[NodeConversationNodeToolTransferCallToolTransferOption] + transfer_option: Required[NodeSubagentNodeToolTransferCallToolTransferOption] type: Required[Literal["transfer_call"]] @@ -1374,7 +1894,7 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): +class NodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to check @@ -1414,7 +1934,7 @@ class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): +class NodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to book @@ -1454,7 +1974,7 @@ class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): +class NodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): agent_id: Required[str] """The id of the agent to swap to.""" @@ -1505,7 +2025,7 @@ class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): """Webhook setting for the agent swap, defaults to only source.""" -class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): +class NodeSubagentNodeToolPressDigitTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1530,14 +2050,14 @@ class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): """ -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): content: str """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Literal["predefined"] -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): prompt: str """The prompt to be used to help infer the SMS content. @@ -1548,13 +2068,13 @@ class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, type: Literal["inferred"] -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1562,7 +2082,7 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): tools + state tools + state edges). """ - sms_content: Required[NodeConversationNodeToolSendSMSToolSMSContent] + sms_content: Required[NodeSubagentNodeToolSendSMSToolSMSContent] type: Required[Literal["send_sms"]] @@ -1572,8 +2092,28 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + -class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): +class NodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -1596,7 +2136,7 @@ class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): """ -class NodeConversationNodeToolCustomTool(TypedDict, total=False): +class NodeSubagentNodeToolCustomTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1644,7 +2184,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] """Method to use for the request, default to POST.""" - parameters: NodeConversationNodeToolCustomToolParameters + parameters: NodeSubagentNodeToolCustomToolParameters """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -1687,7 +2227,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): """ -class NodeConversationNodeToolCodeTool(TypedDict, total=False): +class NodeSubagentNodeToolCodeTool(TypedDict, total=False): code: Required[str] """JavaScript code to execute in the sandbox.""" @@ -1744,7 +2284,7 @@ class NodeConversationNodeToolCodeTool(TypedDict, total=False): """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1754,6 +2294,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -1764,7 +2311,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): choices: Required[SequenceNotStr[str]] """The possible values of the variable, must be non empty array.""" @@ -1777,6 +2324,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1784,7 +2338,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1794,6 +2348,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1801,7 +2362,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1811,6 +2372,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1818,15 +2386,15 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa """ -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): description: Required[str] """ Describes what the tool does, sometimes can also include information about when @@ -1843,11 +2411,11 @@ class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False) type: Required[Literal["extract_dynamic_variable"]] - variables: Required[Iterable[NodeConversationNodeToolExtractDynamicVariableToolVariable]] + variables: Required[Iterable[NodeSubagentNodeToolExtractDynamicVariableToolVariable]] """The variables to be extracted.""" -class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1884,7 +2452,7 @@ class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1921,7 +2489,7 @@ class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolMcpTool(TypedDict, total=False): +class NodeSubagentNodeToolMcpTool(TypedDict, total=False): description: Required[str] """Description of the MCP tool.""" @@ -1974,67 +2542,67 @@ class NodeConversationNodeToolMcpTool(TypedDict, total=False): """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, ] -class NodeConversationNode(TypedDict, total=False): +class NodeSubagentNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[NodeConversationNodeInstruction] + instruction: Required[NodeSubagentNodeInstruction] - type: Required[Literal["conversation"]] + type: Required[Literal["subagent"]] """Type of the node""" - always_edge: NodeConversationNodeAlwaysEdge + always_edge: NodeSubagentNodeAlwaysEdge - display_position: NodeConversationNodeDisplayPosition + display_position: NodeSubagentNodeDisplayPosition """Position for frontend display""" - edges: Iterable[NodeConversationNodeEdge] + edges: Iterable[NodeSubagentNodeEdge] - finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + finetune_conversation_examples: Iterable[NodeSubagentNodeFinetuneConversationExample] - finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[NodeSubagentNodeFinetuneTransitionExample] - global_node_setting: NodeConversationNodeGlobalNodeSetting + global_node_setting: NodeSubagentNodeGlobalNodeSetting interruption_sensitivity: Optional[float] knowledge_base_ids: Optional[SequenceNotStr[str]] """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - model_choice: NodeConversationNodeModelChoice + model_choice: NodeSubagentNodeModelChoice name: str """Optional name for display purposes""" responsiveness: Optional[float] - skip_response_edge: NodeConversationNodeSkipResponseEdge + skip_response_edge: NodeSubagentNodeSkipResponseEdge tool_ids: Optional[SequenceNotStr[str]] """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[Iterable[NodeConversationNodeTool]] - """The tools owned by this conversation node. + tools: Optional[Iterable[NodeSubagentNodeTool]] + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -4629,6 +5197,13 @@ class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -4652,6 +5227,13 @@ class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=F type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -4669,6 +5251,13 @@ class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, tota type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -4686,6 +5275,13 @@ class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -6568,6 +7164,7 @@ class NodeCancelTransferNode(TypedDict, total=False): Node: TypeAlias = Union[ NodeConversationNode, + NodeSubagentNode, NodeEndNode, NodeFunctionNode, NodeCodeNode, @@ -6611,6 +7208,39 @@ class Mcp(TypedDict, total=False): """ +class NoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class NoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class Note(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[NoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[NoteSize] + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. diff --git a/src/retell/types/conversation_flow_component_response.py b/src/retell/types/conversation_flow_component_response.py index cb56f484..048cd0f9 100644 --- a/src/retell/types/conversation_flow_component_response.py +++ b/src/retell/types/conversation_flow_component_response.py @@ -59,48 +59,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -531,6 +578,9 @@ "NodeCancelTransferNodeModelChoice", "BeginTagDisplayPosition", "Mcp", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -975,7 +1025,468 @@ class NodeConversationNodeSkipResponseEdge(BaseModel): """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(BaseModel): +class NodeConversationNode(BaseModel): + id: str + """Unique identifier for the node""" + + instruction: NodeConversationNodeInstruction + + type: Literal["conversation"] + """Type of the node""" + + always_edge: Optional[NodeConversationNodeAlwaysEdge] = None + + display_position: Optional[NodeConversationNodeDisplayPosition] = None + """Position for frontend display""" + + edges: Optional[List[NodeConversationNodeEdge]] = None + + finetune_conversation_examples: Optional[List[NodeConversationNodeFinetuneConversationExample]] = None + + finetune_transition_examples: Optional[List[NodeConversationNodeFinetuneTransitionExample]] = None + + global_node_setting: Optional[NodeConversationNodeGlobalNodeSetting] = None + + interruption_sensitivity: Optional[float] = None + + knowledge_base_ids: Optional[List[str]] = None + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + + api_model_choice: Optional[NodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + + name: Optional[str] = None + """Optional name for display purposes""" + + responsiveness: Optional[float] = None + + skip_response_edge: Optional[NodeConversationNodeSkipResponseEdge] = None + + voice_speed: Optional[float] = None + + +class NodeSubagentNodeInstruction(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + prompt: Optional[Literal["Always"]] = None + """Must be "Always" for always edge""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Always"] + """Must be "Always" for always edge""" + + type: Literal["prompt"] + + +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeAlwaysEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeSubagentNodeAlwaysEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeSubagentNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition +] + + +class NodeSubagentNodeEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeSubagentNodeEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneConversationExample(BaseModel): + id: str + """Unique identifier for the example""" + + transcript: List[NodeSubagentNodeFinetuneConversationExampleTranscript] + """The example transcript to finetune how the conversation should be.""" + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" + + transcript: List[NodeSubagentNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: Optional[str] = None + """Optional destination node ID""" + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Optional[List[NodeSubagentNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Optional[List[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample]] = None + """Don't transition to this node""" + + positive_finetune_examples: Optional[List[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample]] = None + """Transition to this node""" + + +class NodeSubagentNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + + type: Literal["cascading"] + """Type of model choice""" + + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + prompt: Optional[Literal["Skip response"]] = None + """Must be "Skip response" for skip response edge""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + type: Literal["prompt"] + + +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeSkipResponseEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeSubagentNodeSkipResponseEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeSubagentNodeToolEndCallTool(BaseModel): name: str """Name of the tool. @@ -1010,7 +1521,7 @@ class NodeConversationNodeToolEndCallTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): number: str """ The number to transfer to in E.164 format or a dynamic variable like @@ -1028,7 +1539,7 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """ -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): prompt: str """The prompt to be used to help infer the transfer destination. @@ -1041,13 +1552,13 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """The type of transfer destination.""" -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): type: Literal["cold_transfer"] """The type of the transfer.""" @@ -1075,7 +1586,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1087,7 +1598,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -1096,7 +1607,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -1105,13 +1616,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -1120,7 +1631,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -1129,13 +1640,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): type: Literal["warm_transfer"] """The type of the transfer.""" @@ -1145,9 +1656,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr enable_bridge_audio_cue: Optional[bool] = None """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: Optional[NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption] = ( - None - ) + ivr_option: Optional[NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption] = None """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1163,7 +1672,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ private_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ] = None """ If set, when transfer is connected, will say the handoff message only to the @@ -1172,7 +1681,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ public_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ] = None """ If set, when transfer is successful, will say the handoff message to both the @@ -1194,7 +1703,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( BaseModel ): """The agent that will mediate the transfer decision.""" @@ -1211,7 +1720,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The version of the transfer agent to use.""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( BaseModel ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1223,7 +1732,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ transfer_agent: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent ] = None """The agent that will mediate the transfer decision.""" @@ -1234,7 +1743,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -1243,7 +1752,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -1252,15 +1761,15 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): agentic_transfer_config: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ) """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1274,7 +1783,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The music to play while the caller is being transferred.""" public_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption ] = None """ If set, when transfer is successful, will say the handoff message to both the @@ -1296,14 +1805,14 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNodeToolTransferCallTool(BaseModel): +class NodeSubagentNodeToolTransferCallTool(BaseModel): name: str """Name of the tool. @@ -1311,9 +1820,9 @@ class NodeConversationNodeToolTransferCallTool(BaseModel): tools + state tools + state edges). """ - transfer_destination: NodeConversationNodeToolTransferCallToolTransferDestination + transfer_destination: NodeSubagentNodeToolTransferCallToolTransferDestination - transfer_option: NodeConversationNodeToolTransferCallToolTransferOption + transfer_option: NodeSubagentNodeToolTransferCallToolTransferOption type: Literal["transfer_call"] @@ -1352,7 +1861,7 @@ class NodeConversationNodeToolTransferCallTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolCheckAvailabilityCalTool(BaseModel): +class NodeSubagentNodeToolCheckAvailabilityCalTool(BaseModel): cal_api_key: str """ Cal.com Api key that have access to the cal.com event you want to check @@ -1392,7 +1901,7 @@ class NodeConversationNodeToolCheckAvailabilityCalTool(BaseModel): """ -class NodeConversationNodeToolBookAppointmentCalTool(BaseModel): +class NodeSubagentNodeToolBookAppointmentCalTool(BaseModel): cal_api_key: str """ Cal.com Api key that have access to the cal.com event you want to book @@ -1432,7 +1941,7 @@ class NodeConversationNodeToolBookAppointmentCalTool(BaseModel): """ -class NodeConversationNodeToolAgentSwapTool(BaseModel): +class NodeSubagentNodeToolAgentSwapTool(BaseModel): agent_id: str """The id of the agent to swap to.""" @@ -1483,7 +1992,7 @@ class NodeConversationNodeToolAgentSwapTool(BaseModel): """Webhook setting for the agent swap, defaults to only source.""" -class NodeConversationNodeToolPressDigitTool(BaseModel): +class NodeSubagentNodeToolPressDigitTool(BaseModel): name: str """Name of the tool. @@ -1508,14 +2017,14 @@ class NodeConversationNodeToolPressDigitTool(BaseModel): """ -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): content: Optional[str] = None """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Optional[Literal["predefined"]] = None -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): prompt: Optional[str] = None """The prompt to be used to help infer the SMS content. @@ -1526,13 +2035,13 @@ class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel) type: Optional[Literal["inferred"]] = None -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class NodeConversationNodeToolSendSMSTool(BaseModel): +class NodeSubagentNodeToolSendSMSTool(BaseModel): name: str """Name of the tool. @@ -1540,7 +2049,7 @@ class NodeConversationNodeToolSendSMSTool(BaseModel): tools + state tools + state edges). """ - sms_content: NodeConversationNodeToolSendSMSToolSMSContent + sms_content: NodeSubagentNodeToolSendSMSToolSMSContent type: Literal["send_sms"] @@ -1550,8 +2059,28 @@ class NodeConversationNodeToolSendSMSTool(BaseModel): to call the tool. """ + execution_message_description: Optional[str] = None + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: Optional[bool] = None + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ -class NodeConversationNodeToolCustomToolParameters(BaseModel): + +class NodeSubagentNodeToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -1574,7 +2103,7 @@ class NodeConversationNodeToolCustomToolParameters(BaseModel): """ -class NodeConversationNodeToolCustomTool(BaseModel): +class NodeSubagentNodeToolCustomTool(BaseModel): name: str """Name of the tool. @@ -1622,7 +2151,7 @@ class NodeConversationNodeToolCustomTool(BaseModel): method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None """Method to use for the request, default to POST.""" - parameters: Optional[NodeConversationNodeToolCustomToolParameters] = None + parameters: Optional[NodeSubagentNodeToolCustomToolParameters] = None """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -1665,7 +2194,7 @@ class NodeConversationNodeToolCustomTool(BaseModel): """ -class NodeConversationNodeToolCodeTool(BaseModel): +class NodeSubagentNodeToolCodeTool(BaseModel): code: str """JavaScript code to execute in the sandbox.""" @@ -1722,7 +2251,7 @@ class NodeConversationNodeToolCodeTool(BaseModel): """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -1732,6 +2261,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -1742,7 +2278,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): choices: List[str] """The possible values of the variable, must be non empty array.""" @@ -1755,6 +2291,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1762,7 +2305,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -1772,6 +2315,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1779,7 +2329,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -1789,6 +2339,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1796,15 +2353,15 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa """ -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class NodeConversationNodeToolExtractDynamicVariableTool(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableTool(BaseModel): description: str """ Describes what the tool does, sometimes can also include information about when @@ -1821,11 +2378,11 @@ class NodeConversationNodeToolExtractDynamicVariableTool(BaseModel): type: Literal["extract_dynamic_variable"] - variables: List[NodeConversationNodeToolExtractDynamicVariableToolVariable] + variables: List[NodeSubagentNodeToolExtractDynamicVariableToolVariable] """The variables to be extracted.""" -class NodeConversationNodeToolBridgeTransferTool(BaseModel): +class NodeSubagentNodeToolBridgeTransferTool(BaseModel): name: str """Name of the tool. @@ -1862,7 +2419,7 @@ class NodeConversationNodeToolBridgeTransferTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolCancelTransferTool(BaseModel): +class NodeSubagentNodeToolCancelTransferTool(BaseModel): name: str """Name of the tool. @@ -1899,7 +2456,7 @@ class NodeConversationNodeToolCancelTransferTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolMcpTool(BaseModel): +class NodeSubagentNodeToolMcpTool(BaseModel): description: str """Description of the MCP tool.""" @@ -1952,67 +2509,67 @@ class NodeConversationNodeToolMcpTool(BaseModel): """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, ] -class NodeConversationNode(BaseModel): +class NodeSubagentNode(BaseModel): id: str """Unique identifier for the node""" - instruction: NodeConversationNodeInstruction + instruction: NodeSubagentNodeInstruction - type: Literal["conversation"] + type: Literal["subagent"] """Type of the node""" - always_edge: Optional[NodeConversationNodeAlwaysEdge] = None + always_edge: Optional[NodeSubagentNodeAlwaysEdge] = None - display_position: Optional[NodeConversationNodeDisplayPosition] = None + display_position: Optional[NodeSubagentNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[NodeConversationNodeEdge]] = None + edges: Optional[List[NodeSubagentNodeEdge]] = None - finetune_conversation_examples: Optional[List[NodeConversationNodeFinetuneConversationExample]] = None + finetune_conversation_examples: Optional[List[NodeSubagentNodeFinetuneConversationExample]] = None - finetune_transition_examples: Optional[List[NodeConversationNodeFinetuneTransitionExample]] = None + finetune_transition_examples: Optional[List[NodeSubagentNodeFinetuneTransitionExample]] = None - global_node_setting: Optional[NodeConversationNodeGlobalNodeSetting] = None + global_node_setting: Optional[NodeSubagentNodeGlobalNodeSetting] = None interruption_sensitivity: Optional[float] = None knowledge_base_ids: Optional[List[str]] = None """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - api_model_choice: Optional[NodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[NodeSubagentNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" responsiveness: Optional[float] = None - skip_response_edge: Optional[NodeConversationNodeSkipResponseEdge] = None + skip_response_edge: Optional[NodeSubagentNodeSkipResponseEdge] = None tool_ids: Optional[List[str]] = None """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[List[NodeConversationNodeTool]] = None - """The tools owned by this conversation node. + tools: Optional[List[NodeSubagentNodeTool]] = None + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -4569,6 +5126,13 @@ class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(BaseModel): type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -4592,6 +5156,13 @@ class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -4609,6 +5180,13 @@ class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(BaseModel): type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -4626,6 +5204,13 @@ class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(BaseModel): type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -6464,6 +7049,7 @@ class NodeCancelTransferNode(BaseModel): Node: TypeAlias = Union[ NodeConversationNode, + NodeSubagentNode, NodeEndNode, NodeFunctionNode, NodeCodeNode, @@ -6507,6 +7093,39 @@ class Mcp(BaseModel): """ +class NoteDisplayPosition(BaseModel): + """Position of the note on the canvas.""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class NoteSize(BaseModel): + """Dimensions of the note on the canvas.""" + + height: Optional[float] = None + + width: Optional[float] = None + + +class Note(BaseModel): + id: str + """Unique identifier for the note.""" + + content: str + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: NoteDisplayPosition + """Position of the note on the canvas.""" + + size: NoteSize + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. @@ -6735,6 +7354,9 @@ class ConversationFlowComponentResponse(BaseModel): mcps: Optional[List[Mcp]] = None """A list of MCP server configurations to use for this component""" + notes: Optional[List[Note]] = None + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] = None """ID of the starting node""" diff --git a/src/retell/types/conversation_flow_component_update_params.py b/src/retell/types/conversation_flow_component_update_params.py index 18aa62d1..3f22b7d1 100644 --- a/src/retell/types/conversation_flow_component_update_params.py +++ b/src/retell/types/conversation_flow_component_update_params.py @@ -61,48 +61,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -531,6 +578,9 @@ "NodeCancelTransferNodeInstructionNodeInstructionPrompt", "NodeCancelTransferNodeInstructionNodeInstructionStaticText", "NodeCancelTransferNodeModelChoice", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -552,6 +602,9 @@ class ConversationFlowComponentUpdateParams(TypedDict, total=False): nodes: Iterable[Node] """Nodes that make up the component""" + notes: Optional[Iterable[Note]] + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] """ID of the starting node""" @@ -1028,7 +1081,474 @@ class NodeConversationNodeSkipResponseEdge(TypedDict, total=False): """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(TypedDict, total=False): +class NodeConversationNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + instruction: Required[NodeConversationNodeInstruction] + + type: Required[Literal["conversation"]] + """Type of the node""" + + always_edge: NodeConversationNodeAlwaysEdge + + display_position: NodeConversationNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[NodeConversationNodeEdge] + + finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + + finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + + global_node_setting: NodeConversationNodeGlobalNodeSetting + + interruption_sensitivity: Optional[float] + + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + + model_choice: NodeConversationNodeModelChoice + + name: str + """Optional name for display purposes""" + + responsiveness: Optional[float] + + skip_response_edge: NodeConversationNodeSkipResponseEdge + + voice_speed: Optional[float] + + +class NodeSubagentNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Always"] + """Must be "Always" for always edge""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" + + type: Required[Literal["prompt"]] + + +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeAlwaysEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition +] + + +class NodeSubagentNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeSubagentNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeSubagentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[NodeSubagentNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeSubagentNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" + + type: Required[Literal["prompt"]] + + +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] + + +class NodeSubagentNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeSubagentNodeSkipResponseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1063,7 +1583,7 @@ class NodeConversationNodeToolEndCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): number: Required[str] """ The number to transfer to in E.164 format or a dynamic variable like @@ -1081,7 +1601,7 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """ -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): prompt: Required[str] """The prompt to be used to help infer the transfer destination. @@ -1094,13 +1614,13 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """The type of transfer destination.""" -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): type: Required[Literal["cold_transfer"]] """The type of the transfer.""" @@ -1128,7 +1648,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1140,7 +1660,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1149,7 +1669,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1158,13 +1678,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1173,7 +1693,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1182,13 +1702,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): type: Required[Literal["warm_transfer"]] """The type of the transfer.""" @@ -1198,7 +1718,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr enable_bridge_audio_cue: bool """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + ivr_option: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -1214,7 +1734,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ private_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ) """ If set, when transfer is connected, will say the handoff message only to the @@ -1223,7 +1743,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -1245,7 +1765,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( TypedDict, total=False ): """The agent that will mediate the transfer decision.""" @@ -1262,7 +1782,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The version of the transfer agent to use.""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( TypedDict, total=False ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1273,7 +1793,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti Defaults to cancel_transfer. """ - transfer_agent: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + transfer_agent: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent """The agent that will mediate the transfer decision.""" transfer_timeout_ms: float @@ -1283,7 +1803,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -1292,7 +1812,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -1301,15 +1821,15 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): agentic_transfer_config: Required[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ] """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -1323,7 +1843,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The music to play while the caller is being transferred.""" public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -1345,14 +1865,14 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1360,9 +1880,9 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): tools + state tools + state edges). """ - transfer_destination: Required[NodeConversationNodeToolTransferCallToolTransferDestination] + transfer_destination: Required[NodeSubagentNodeToolTransferCallToolTransferDestination] - transfer_option: Required[NodeConversationNodeToolTransferCallToolTransferOption] + transfer_option: Required[NodeSubagentNodeToolTransferCallToolTransferOption] type: Required[Literal["transfer_call"]] @@ -1401,7 +1921,7 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): +class NodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to check @@ -1441,7 +1961,7 @@ class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): +class NodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to book @@ -1481,7 +2001,7 @@ class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): +class NodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): agent_id: Required[str] """The id of the agent to swap to.""" @@ -1532,7 +2052,7 @@ class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): """Webhook setting for the agent swap, defaults to only source.""" -class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): +class NodeSubagentNodeToolPressDigitTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1557,14 +2077,14 @@ class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): """ -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): content: str """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Literal["predefined"] -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): prompt: str """The prompt to be used to help infer the SMS content. @@ -1575,13 +2095,13 @@ class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, type: Literal["inferred"] -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1589,7 +2109,7 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): tools + state tools + state edges). """ - sms_content: Required[NodeConversationNodeToolSendSMSToolSMSContent] + sms_content: Required[NodeSubagentNodeToolSendSMSToolSMSContent] type: Required[Literal["send_sms"]] @@ -1599,8 +2119,28 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + -class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): +class NodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -1623,7 +2163,7 @@ class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): """ -class NodeConversationNodeToolCustomTool(TypedDict, total=False): +class NodeSubagentNodeToolCustomTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1671,7 +2211,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] """Method to use for the request, default to POST.""" - parameters: NodeConversationNodeToolCustomToolParameters + parameters: NodeSubagentNodeToolCustomToolParameters """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -1714,7 +2254,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): """ -class NodeConversationNodeToolCodeTool(TypedDict, total=False): +class NodeSubagentNodeToolCodeTool(TypedDict, total=False): code: Required[str] """JavaScript code to execute in the sandbox.""" @@ -1771,7 +2311,7 @@ class NodeConversationNodeToolCodeTool(TypedDict, total=False): """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1781,6 +2321,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -1791,7 +2338,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): choices: Required[SequenceNotStr[str]] """The possible values of the variable, must be non empty array.""" @@ -1804,6 +2351,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1811,7 +2365,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1821,6 +2375,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1828,7 +2389,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -1838,6 +2399,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1845,15 +2413,15 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa """ -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): description: Required[str] """ Describes what the tool does, sometimes can also include information about when @@ -1870,11 +2438,11 @@ class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False) type: Required[Literal["extract_dynamic_variable"]] - variables: Required[Iterable[NodeConversationNodeToolExtractDynamicVariableToolVariable]] + variables: Required[Iterable[NodeSubagentNodeToolExtractDynamicVariableToolVariable]] """The variables to be extracted.""" -class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1911,7 +2479,7 @@ class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -1948,7 +2516,7 @@ class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolMcpTool(TypedDict, total=False): +class NodeSubagentNodeToolMcpTool(TypedDict, total=False): description: Required[str] """Description of the MCP tool.""" @@ -2001,67 +2569,67 @@ class NodeConversationNodeToolMcpTool(TypedDict, total=False): """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, ] -class NodeConversationNode(TypedDict, total=False): +class NodeSubagentNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[NodeConversationNodeInstruction] + instruction: Required[NodeSubagentNodeInstruction] - type: Required[Literal["conversation"]] + type: Required[Literal["subagent"]] """Type of the node""" - always_edge: NodeConversationNodeAlwaysEdge + always_edge: NodeSubagentNodeAlwaysEdge - display_position: NodeConversationNodeDisplayPosition + display_position: NodeSubagentNodeDisplayPosition """Position for frontend display""" - edges: Iterable[NodeConversationNodeEdge] + edges: Iterable[NodeSubagentNodeEdge] - finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + finetune_conversation_examples: Iterable[NodeSubagentNodeFinetuneConversationExample] - finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[NodeSubagentNodeFinetuneTransitionExample] - global_node_setting: NodeConversationNodeGlobalNodeSetting + global_node_setting: NodeSubagentNodeGlobalNodeSetting interruption_sensitivity: Optional[float] knowledge_base_ids: Optional[SequenceNotStr[str]] """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - model_choice: NodeConversationNodeModelChoice + model_choice: NodeSubagentNodeModelChoice name: str """Optional name for display purposes""" responsiveness: Optional[float] - skip_response_edge: NodeConversationNodeSkipResponseEdge + skip_response_edge: NodeSubagentNodeSkipResponseEdge tool_ids: Optional[SequenceNotStr[str]] """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[Iterable[NodeConversationNodeTool]] - """The tools owned by this conversation node. + tools: Optional[Iterable[NodeSubagentNodeTool]] + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -4656,6 +5224,13 @@ class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -4679,6 +5254,13 @@ class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=F type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -4696,6 +5278,13 @@ class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, tota type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -4713,6 +5302,13 @@ class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -6595,6 +7191,7 @@ class NodeCancelTransferNode(TypedDict, total=False): Node: TypeAlias = Union[ NodeConversationNode, + NodeSubagentNode, NodeEndNode, NodeFunctionNode, NodeCodeNode, @@ -6611,6 +7208,39 @@ class NodeCancelTransferNode(TypedDict, total=False): ] +class NoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class NoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class Note(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[NoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[NoteSize] + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. diff --git a/src/retell/types/conversation_flow_create_params.py b/src/retell/types/conversation_flow_create_params.py index 7cb64c4d..08b7c319 100644 --- a/src/retell/types/conversation_flow_create_params.py +++ b/src/retell/types/conversation_flow_create_params.py @@ -60,48 +60,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -582,48 +629,95 @@ "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "ComponentNodeConversationNodeTool", - "ComponentNodeConversationNodeToolEndCallTool", - "ComponentNodeConversationNodeToolTransferCallTool", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestination", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "ComponentNodeConversationNodeToolTransferCallToolTransferOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolCheckAvailabilityCalTool", - "ComponentNodeConversationNodeToolBookAppointmentCalTool", - "ComponentNodeConversationNodeToolAgentSwapTool", - "ComponentNodeConversationNodeToolPressDigitTool", - "ComponentNodeConversationNodeToolSendSMSTool", - "ComponentNodeConversationNodeToolSendSMSToolSMSContent", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "ComponentNodeConversationNodeToolCustomTool", - "ComponentNodeConversationNodeToolCustomToolParameters", - "ComponentNodeConversationNodeToolCodeTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "ComponentNodeConversationNodeToolBridgeTransferTool", - "ComponentNodeConversationNodeToolCancelTransferTool", - "ComponentNodeConversationNodeToolMcpTool", + "ComponentNodeSubagentNode", + "ComponentNodeSubagentNodeInstruction", + "ComponentNodeSubagentNodeAlwaysEdge", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeDisplayPosition", + "ComponentNodeSubagentNodeEdge", + "ComponentNodeSubagentNodeEdgeTransitionCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeFinetuneConversationExample", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscript", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeFinetuneTransitionExample", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSetting", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeModelChoice", + "ComponentNodeSubagentNodeSkipResponseEdge", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeTool", + "ComponentNodeSubagentNodeToolEndCallTool", + "ComponentNodeSubagentNodeToolTransferCallTool", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestination", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolCheckAvailabilityCalTool", + "ComponentNodeSubagentNodeToolBookAppointmentCalTool", + "ComponentNodeSubagentNodeToolAgentSwapTool", + "ComponentNodeSubagentNodeToolPressDigitTool", + "ComponentNodeSubagentNodeToolSendSMSTool", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContent", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "ComponentNodeSubagentNodeToolCustomTool", + "ComponentNodeSubagentNodeToolCustomToolParameters", + "ComponentNodeSubagentNodeToolCodeTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "ComponentNodeSubagentNodeToolBridgeTransferTool", + "ComponentNodeSubagentNodeToolCancelTransferTool", + "ComponentNodeSubagentNodeToolMcpTool", "ComponentNodeEndNode", "ComponentNodeEndNodeDisplayPosition", "ComponentNodeEndNodeGlobalNodeSetting", @@ -1054,6 +1148,9 @@ "ComponentNodeCancelTransferNodeModelChoice", "ComponentBeginTagDisplayPosition", "ComponentMcp", + "ComponentNote", + "ComponentNoteDisplayPosition", + "ComponentNoteSize", "ComponentTool", "ComponentToolCustomTool", "ComponentToolCustomToolParameters", @@ -1061,6 +1158,9 @@ "ComponentToolBookAppointmentCalTool", "KBConfig", "Mcp", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -1120,6 +1220,9 @@ class ConversationFlowCreateParams(TypedDict, total=False): Lower values make responses more deterministic. """ + notes: Optional[Iterable[Note]] + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] """ID of the start node in the conversation flow.""" @@ -1608,711 +1711,492 @@ class NodeConversationNodeSkipResponseEdge(TypedDict, total=False): """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - - type: Required[Literal["end_call"]] - - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class NodeConversationNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - execution_message_description: str - """Describes what to say to user when ending the call. + instruction: Required[NodeConversationNodeInstruction] - Only applicable when speak_during_execution is true. - """ + type: Required[Literal["conversation"]] + """Type of the node""" - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + always_edge: NodeConversationNodeAlwaysEdge - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ + display_position: NodeConversationNodeDisplayPosition + """Position for frontend display""" - speak_during_execution: bool - """If true, will speak during execution.""" + edges: Iterable[NodeConversationNodeEdge] + finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): - number: Required[str] - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ + finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] - type: Required[Literal["predefined"]] - """The type of transfer destination.""" + global_node_setting: NodeConversationNodeGlobalNodeSetting - extension: str - """Extension digits to dial after the main number connects. + interruption_sensitivity: Optional[float] - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + model_choice: NodeConversationNodeModelChoice -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): - prompt: Required[str] - """The prompt to be used to help infer the transfer destination. + name: str + """Optional name for display purposes""" - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. - """ + responsiveness: Optional[float] - type: Required[Literal["inferred"]] - """The type of transfer destination.""" + skip_response_edge: NodeConversationNodeSkipResponseEdge + voice_speed: Optional[float] -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, -] +class NodeSubagentNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): - type: Required[Literal["cold_transfer"]] - """The type of the transfer.""" + type: Required[Literal["prompt"]] + """Type of instruction""" - cold_transfer_mode: Literal["sip_refer", "sip_invite"] - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. - """ + type: Required[Literal["prompt"]] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. - If not set, falls back to the agent-level `ring_duration_ms`. - """ +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): - """IVR navigation option to run when doing human detection. + right: str + """Right side of the equation. - This prompt will guide the AI on how to navigate the IVR system. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Literal["prompt"] +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] + operator: Required[Literal["||", "&&"]] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Required[Literal["equation"]] - type: Literal["prompt"] + prompt: Literal["Always"] + """Must be "Always" for always edge""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" - type: Literal["static_message"] + type: Required[Literal["prompt"]] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - - type: Literal["prompt"] +class NodeSubagentNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[NodeSubagentNodeAlwaysEdgeTransitionCondition] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: str + """ID of the destination node""" - type: Literal["static_message"] +class NodeSubagentNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + x: float + y: float -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): - type: Required[Literal["warm_transfer"]] - """The type of the transfer.""" - agent_detection_timeout_ms: float - """The time to wait before considering transfer fails.""" +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" + type: Required[Literal["prompt"]] - ivr_option: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption - """IVR navigation option to run when doing human detection. - This prompt will guide the AI on how to navigate the IVR system. - """ +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - opt_out_human_detection: bool - """If set to true, will not perform human detection for the transfer. + right: str + """Right side of the equation. - Default to false. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - private_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption - ) - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ - public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption - ) - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ + operator: Required[Literal["||", "&&"]] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + type: Required[Literal["equation"]] - If not set, falls back to the agent-level `ring_duration_ms`. - """ +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition +] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - TypedDict, total=False -): - """The agent that will mediate the transfer decision.""" - agent_id: Required[str] - """The agent ID of the transfer agent. +class NodeSubagentNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ + transition_condition: Required[NodeSubagentNodeEdgeTransitionCondition] - agent_version: Required[float] - """The version of the transfer agent to use.""" + destination_node_id: str + """ID of the destination node""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( - TypedDict, total=False -): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] - """The action to take when the transfer agent times out without making a decision. + role: Required[Literal["agent", "user"]] - Defaults to cancel_transfer. - """ - transfer_agent: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - """The agent that will mediate the transfer decision.""" +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - transfer_timeout_ms: float - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ + name: Required[str] + role: Required[Literal["tool_call_invocation"]] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + tool_call_id: Required[str] - type: Literal["prompt"] +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + role: Required[Literal["tool_call_result"]] - type: Literal["static_message"] + tool_call_id: Required[str] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): - agentic_transfer_config: Required[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - ] - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class NodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - type: Required[Literal["agentic_warm_transfer"]] - """The type of the transfer.""" + transcript: Required[Iterable[NodeSubagentNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" - - public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - ) - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. - - If not set, falls back to the agent-level `ring_duration_ms`. - """ +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + role: Required[Literal["agent", "user"]] -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, -] +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): name: Required[str] - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ - transfer_destination: Required[NodeConversationNodeToolTransferCallToolTransferDestination] + role: Required[Literal["tool_call_invocation"]] - transfer_option: Required[NodeConversationNodeToolTransferCallToolTransferOption] + tool_call_id: Required[str] - type: Required[Literal["transfer_call"]] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + role: Required[Literal["tool_call_result"]] - execution_message_description: str - """Describes what to say to user when transferring the call. + tool_call_id: Required[str] - Only applicable when speak_during_execution is true. - """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - ignore_e164_validation: bool - """If true, the e.164 validation will be ignored for the from_number. +class NodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. - """ + transcript: Required[Iterable[NodeSubagentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" - speak_during_execution: bool - """If true, will speak during execution.""" + destination_node_id: str + """Optional destination node ID""" -class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to check - availability for. - """ +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - event_type_id: Required[Union[float, str]] - """ - Cal.com event type id number for the cal.com event you want to check - availability for. Can be a number or a dynamic variable in the format - `{{variable_name}}` that will be resolved at runtime. - """ + type: Required[Literal["prompt"]] - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" - type: Required[Literal["check_availability_cal"]] + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + right: str + """Right side of the equation. - timezone: str - """ - Timezone to be used when checking availability, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to book - appointment. - """ +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] - event_type_id: Required[Union[float, str]] - """Cal.com event type id number for the cal.com event you want to book appointment. + operator: Required[Literal["||", "&&"]] - Can be a number or a dynamic variable in the format `{{variable_name}}` that - will be resolved at runtime. - """ + type: Required[Literal["equation"]] - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] - type: Required[Literal["book_appointment_cal"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - timezone: str - """ - Timezone to be used when booking appointment, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ + transition_condition: Required[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] + destination_node_id: str + """ID of the destination node""" -class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): - agent_id: Required[str] - """The id of the agent to swap to.""" - name: Required[str] - """Name of the tool. +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ + role: Required[Literal["agent", "user"]] - post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] - """Post call analysis setting for the agent swap.""" - type: Required[Literal["agent_swap"]] +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - agent_version: float - """The version of the agent to swap to. + name: Required[str] - If not specified, will use the latest version. - """ + role: Required[Literal["tool_call_invocation"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + tool_call_id: Required[str] - execution_message_description: str - """The message for the agent to speak when executing agent swap.""" - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ + role: Required[Literal["tool_call_result"]] - keep_current_language: bool - """If true, keep the current language when swapping agents. Defaults to false.""" + tool_call_id: Required[str] - keep_current_voice: bool - """If true, keep the current voice when swapping agents. Defaults to false.""" - speak_during_execution: bool +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] - webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] - """Webhook setting for the agent swap, defaults to only source.""" +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" -class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - type: Required[Literal["press_digit"]] + role: Required[Literal["agent", "user"]] - delay_ms: int - """ - Delay in milliseconds before pressing the digit, because a lot of IVR systems - speak very slowly, and a delay can make sure the agent hears the full menu. - Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). - """ - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + name: Required[str] -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): - content: str - """The static message to be sent in the SMS. Can contain dynamic variables.""" + role: Required[Literal["tool_call_invocation"]] - type: Literal["predefined"] + tool_call_id: Required[str] -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): - prompt: str - """The prompt to be used to help infer the SMS content. +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right message to send. Can contain dynamic variables. - """ + role: Required[Literal["tool_call_result"]] - type: Literal["inferred"] + tool_call_id: Required[str] -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - sms_content: Required[NodeConversationNodeToolSendSMSToolSMSContent] - type: Required[Literal["send_sms"]] +class NodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" - description: str + cool_down: float """ - Describes what the tool does, sometimes can also include information about when - to call the tool. + The same global node won't be triggered again within the next N node + transitions. """ + go_back_conditions: Iterable[NodeSubagentNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. -class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): - """The parameters the functions accepts, described as a JSON Schema object. - - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + There would be no destination_node_id for these edges. """ - properties: Required[Dict[str, object]] - """ - The value of properties is an object, where each key is the name of a property - and each value is a schema used to validate that property. - """ + negative_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" - type: Required[Literal["object"]] - """Type must be "object" for a JSON Schema object.""" + positive_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" - required: SequenceNotStr[str] - """List of names of required property when generating this parameter. - LLM will do its best to generate the required properties in its function - arguments. Property must exist in properties. - """ +class NodeSubagentNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + type: Required[Literal["cascading"]] + """Type of model choice""" -class NodeConversationNodeToolCustomTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Required[Literal["custom"]] +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - url: Required[str] - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + type: Required[Literal["prompt"]] - args_at_root: bool - """ - If set to true, the parameters will be passed as root level JSON object instead - of nested under "args". - """ - description: str - """Describes what this tool does and when to call this tool.""" +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - execution_message_description: str - """The description for the sentence agent say during execution. + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] - headers: Dict[str, str] - """Headers to add to the request.""" + operator: Required[Literal["||", "&&"]] - method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] - """Method to use for the request, default to POST.""" + type: Required[Literal["equation"]] - parameters: NodeConversationNodeToolCustomToolParameters - """The parameters the functions accepts, described as a JSON Schema object. + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. Omitting parameters defines a function with - an empty parameter list. - """ - query_params: Dict[str, str] - """Query parameters to append to the request URL.""" +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the response body. + type: Required[Literal["prompt"]] - These values will be extracted from the response and made available as dynamic - variables for use. - """ - speak_after_execution: bool - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. - """ - timeout_ms: int - """The maximum time in milliseconds the tool can run before it's considered - timeout. +class NodeSubagentNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - If the tool times out, the agent would have that info. The minimum value allowed - is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, - this is set to 120,000 ms (2 min). - """ + transition_condition: Required[NodeSubagentNodeSkipResponseEdgeTransitionCondition] + destination_node_id: str + """ID of the destination node""" -class NodeConversationNodeToolCodeTool(TypedDict, total=False): - code: Required[str] - """JavaScript code to execute in the sandbox.""" +class NodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 (no space allowed). """ - type: Required[Literal["code"]] + type: Required[Literal["end_call"]] description: str - """Describes what this tool does and when to call this tool.""" + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ execution_message_description: str - """The description for the sentence agent say during execution. + """Describes what to say to user when ending the call. Only applicable when speak_during_execution is true. """ @@ -2325,502 +2209,1606 @@ class NodeConversationNodeToolCodeTool(TypedDict, total=False): execution_message_description directly. Defaults to "prompt". """ - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the code execution result. + speak_during_execution: bool + """If true, will speak during execution.""" - These mapped values will be extracted and added as dynamic variables. - """ - speak_after_execution: bool +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): + number: Required[str] """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. """ - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the tool. - """ + type: Required[Literal["predefined"]] + """The type of transfer destination.""" - timeout_ms: int - """The maximum time in milliseconds the code can run before it's considered - timeout. + extension: str + """Extension digits to dial after the main number connects. - Defaults to 30,000 ms (30 s). + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" - - name: Required[str] - """Name of the variable.""" - - type: Required[Literal["string"]] - """Type of the variable to extract.""" - - examples: SequenceNotStr[str] - """Examples of the variable value to teach model the style and syntax.""" - - required: bool - """Whether this data is required. +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): + prompt: Required[str] + """The prompt to be used to help infer the transfer destination. - If true and the data is not extracted, the call will be marked as unsuccessful. + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. """ + type: Required[Literal["inferred"]] + """The type of transfer destination.""" -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): - choices: Required[SequenceNotStr[str]] - """The possible values of the variable, must be non empty array.""" - description: Required[str] - """Description of the variable.""" +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["enum"]] - """Type of the variable to extract.""" +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): + type: Required[Literal["cold_transfer"]] + """The type of the transfer.""" - required: bool - """Whether this data is required. + cold_transfer_mode: Literal["sip_refer", "sip_invite"] + """The mode of the cold transfer. - If true and the data is not extracted, the call will be marked as unsuccessful. + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. """ + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. - name: Required[str] - """Name of the variable.""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - type: Required[Literal["boolean"]] - """Type of the variable to extract.""" - required: bool - """Whether this data is required. +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): + """IVR navigation option to run when doing human detection. - If true and the data is not extracted, the call will be marked as unsuccessful. + This prompt will guide the AI on how to navigate the IVR system. """ + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" + type: Literal["prompt"] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["number"]] - """Type of the variable to extract.""" +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - required: bool - """Whether this data is required. + type: Literal["prompt"] - If true and the data is not extracted, the call will be marked as unsuccessful. - """ + +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" + + type: Literal["static_message"] -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): - description: Required[str] - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - name: Required[str] - """Name of the tool. + type: Literal["prompt"] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Required[Literal["extract_dynamic_variable"]] +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - variables: Required[Iterable[NodeConversationNodeToolExtractDynamicVariableToolVariable]] - """The variables to be extracted.""" + type: Literal["static_message"] -class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). + +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): + type: Required[Literal["warm_transfer"]] + """The type of the transfer.""" + + agent_detection_timeout_ms: float + """The time to wait before considering transfer fails.""" + + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" + + ivr_option: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + """IVR navigation option to run when doing human detection. + + This prompt will guide the AI on how to navigate the IVR system. """ - type: Required[Literal["bridge_transfer"]] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" - description: str - """Describes what the tool does. + opt_out_human_detection: bool + """If set to true, will not perform human detection for the transfer. - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it bridges the original - caller to the transfer target and ends the transfer agent call. + Default to false. """ - execution_message_description: str - """Describes what to say to user when bridging the transfer. + private_handoff_option: ( + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + ) + """ + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. + """ - Only applicable when speak_during_execution is true. + public_handoff_option: ( + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + ) + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. + + If not set, falls back to the agent-level `ring_duration_ms`. """ - speak_during_execution: bool - """If true, will speak during execution.""" +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + TypedDict, total=False +): + """The agent that will mediate the transfer decision.""" -class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. + agent_id: Required[str] + """The agent ID of the transfer agent. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). """ - type: Required[Literal["cancel_transfer"]] + agent_version: Required[float] + """The version of the transfer agent to use.""" - description: str - """Describes what the tool does. - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it cancels the transfer, - returns the original caller to the main agent, and ends the transfer agent call. - """ +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( + TypedDict, total=False +): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - execution_message_description: str - """Describes what to say to user when cancelling the transfer. + action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] + """The action to take when the transfer agent times out without making a decision. - Only applicable when speak_during_execution is true. + Defaults to cancel_transfer. """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + transfer_agent: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + """The agent that will mediate the transfer decision.""" - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + transfer_timeout_ms: float + """ + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). """ - speak_during_execution: bool - """If true, will speak during execution.""" +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + + type: Literal["prompt"] -class NodeConversationNodeToolMcpTool(TypedDict, total=False): - description: Required[str] - """Description of the MCP tool.""" - name: Required[str] - """Name of the MCP tool.""" +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - type: Required[Literal["mcp"]] + type: Literal["static_message"] - execution_message_description: str - """The description for the sentence agent say during execution. - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". - """ +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): + agentic_transfer_config: Required[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + ] + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - input_schema: Dict[str, str] - """The input schema of the MCP tool.""" + type: Required[Literal["agentic_warm_transfer"]] + """The type of the transfer.""" - mcp_id: str - """Unique id of the MCP.""" + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" - response_variables: Dict[str, str] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" + + public_handoff_option: ( + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ) """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. """ - speak_after_execution: bool + show_transferee_as_caller: bool """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. """ - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. + + If not set, falls back to the agent-level `ring_duration_ms`. """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" +class NodeSubagentNodeToolTransferCallTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. - instruction: Required[NodeConversationNodeInstruction] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ - type: Required[Literal["conversation"]] - """Type of the node""" + transfer_destination: Required[NodeSubagentNodeToolTransferCallToolTransferDestination] - always_edge: NodeConversationNodeAlwaysEdge + transfer_option: Required[NodeSubagentNodeToolTransferCallToolTransferOption] - display_position: NodeConversationNodeDisplayPosition - """Position for frontend display""" + type: Required[Literal["transfer_call"]] - edges: Iterable[NodeConversationNodeEdge] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" - finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + execution_message_description: str + """Describes what to say to user when transferring the call. - global_node_setting: NodeConversationNodeGlobalNodeSetting + Only applicable when speak_during_execution is true. + """ - interruption_sensitivity: Optional[float] + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - knowledge_base_ids: Optional[SequenceNotStr[str]] - """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - model_choice: NodeConversationNodeModelChoice + ignore_e164_validation: bool + """If true, the e.164 validation will be ignored for the from_number. - name: str - """Optional name for display purposes""" + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ - responsiveness: Optional[float] + speak_during_execution: bool + """If true, will speak during execution.""" - skip_response_edge: NodeConversationNodeSkipResponseEdge - tool_ids: Optional[SequenceNotStr[str]] +class NodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): + cal_api_key: Required[str] """ - The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + Cal.com Api key that have access to the cal.com event you want to check + availability for. """ - tools: Optional[Iterable[NodeConversationNodeTool]] - """The tools owned by this conversation node. - - This includes other tool types like transfer_call, agent_swap, etc. + event_type_id: Required[Union[float, str]] + """ + Cal.com event type id number for the cal.com event you want to check + availability for. Can be a number or a dynamic variable in the format + `{{variable_name}}` that will be resolved at runtime. """ - voice_speed: Optional[float] - - -class NodeEndNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" - - x: float - - y: float + name: Required[str] + """Name of the tool. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ -class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + type: Required[Literal["check_availability_cal"]] - type: Required[Literal["prompt"]] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + timezone: str + """ + Timezone to be used when checking availability, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ -class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] +class NodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): + cal_api_key: Required[str] + """ + Cal.com Api key that have access to the cal.com event you want to book + appointment. + """ - right: str - """Right side of the equation. + event_type_id: Required[Union[float, str]] + """Cal.com event type id number for the cal.com event you want to book appointment. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Can be a number or a dynamic variable in the format `{{variable_name}}` that + will be resolved at runtime. """ + name: Required[str] + """Name of the tool. -class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - type: Required[Literal["equation"]] + type: Required[Literal["book_appointment_cal"]] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ -NodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] + timezone: str + """ + Timezone to be used when booking appointment, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ -class NodeEndNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" +class NodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): + agent_id: Required[str] + """The id of the agent to swap to.""" - transition_condition: Required[NodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition] + name: Required[str] + """Name of the tool. - destination_node_id: str - """ID of the destination node""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] + """Post call analysis setting for the agent swap.""" -class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + type: Required[Literal["agent_swap"]] - role: Required[Literal["agent", "user"]] + agent_version: float + """The version of the agent to swap to. + If not specified, will use the latest version. + """ -class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - name: Required[str] + execution_message_description: str + """The message for the agent to speak when executing agent swap.""" - role: Required[Literal["tool_call_invocation"]] + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - tool_call_id: Required[str] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + keep_current_language: bool + """If true, keep the current language when swapping agents. Defaults to false.""" -class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + keep_current_voice: bool + """If true, keep the current voice when swapping agents. Defaults to false.""" - role: Required[Literal["tool_call_result"]] + speak_during_execution: bool - tool_call_id: Required[str] + webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] + """Webhook setting for the agent swap, defaults to only source.""" -NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] +class NodeSubagentNodeToolPressDigitTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ -class NodeEndNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + type: Required[Literal["press_digit"]] + delay_ms: int + """ + Delay in milliseconds before pressing the digit, because a lot of IVR systems + speak very slowly, and a delay can make sure the agent hears the full menu. + Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). + """ -class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - role: Required[Literal["agent", "user"]] +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): + content: str + """The static message to be sent in the SMS. Can contain dynamic variables.""" -class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + type: Literal["predefined"] - name: Required[str] - role: Required[Literal["tool_call_invocation"]] +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): + prompt: str + """The prompt to be used to help infer the SMS content. - tool_call_id: Required[str] + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right message to send. Can contain dynamic variables. + """ + type: Literal["inferred"] -class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, +] - tool_call_id: Required[str] +class NodeSubagentNodeToolSendSMSTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + sms_content: Required[NodeSubagentNodeToolSendSMSToolSMSContent] -class NodeEndNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + type: Required[Literal["send_sms"]] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ -class NodeEndNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" + execution_message_description: str + """Describes what to say before sending the SMS. - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. + Only applicable when speak_during_execution is true. """ - go_back_conditions: Iterable[NodeEndNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - There would be no destination_node_id for these edges. + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". """ - negative_finetune_examples: Iterable[NodeEndNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. - positive_finetune_examples: Iterable[NodeEndNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" + If omitted, defaults to true (same as end_call / transfer_call tools). + """ -class NodeEndNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" +class NodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): + """The parameters the functions accepts, described as a JSON Schema object. - type: Required[Literal["prompt"]] - """Type of instruction""" + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + """ + properties: Required[Dict[str, object]] + """ + The value of properties is an object, where each key is the name of a property + and each value is a schema used to validate that property. + """ -class NodeEndNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" + type: Required[Literal["object"]] + """Type must be "object" for a JSON Schema object.""" - type: Required[Literal["static_text"]] - """Type of instruction""" + required: SequenceNotStr[str] + """List of names of required property when generating this parameter. + LLM will do its best to generate the required properties in its function + arguments. Property must exist in properties. + """ -NodeEndNodeInstruction: TypeAlias = Union[ - NodeEndNodeInstructionNodeInstructionPrompt, NodeEndNodeInstructionNodeInstructionStaticText -] +class NodeSubagentNodeToolCustomTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -class NodeEndNodeModelChoice(TypedDict, total=False): + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["custom"]] + + url: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + args_at_root: bool + """ + If set to true, the parameters will be passed as root level JSON object instead + of nested under "args". + """ + + description: str + """Describes what this tool does and when to call this tool.""" + + execution_message_description: str + """The description for the sentence agent say during execution. + + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + headers: Dict[str, str] + """Headers to add to the request.""" + + method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] + """Method to use for the request, default to POST.""" + + parameters: NodeSubagentNodeToolCustomToolParameters + """The parameters the functions accepts, described as a JSON Schema object. + + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. Omitting parameters defines a function with + an empty parameter list. + """ + + query_params: Dict[str, str] + """Query parameters to append to the request URL.""" + + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the response body. + + These values will be extracted from the response and made available as dynamic + variables for use. + """ + + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ + + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ + + timeout_ms: int + """The maximum time in milliseconds the tool can run before it's considered + timeout. + + If the tool times out, the agent would have that info. The minimum value allowed + is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, + this is set to 120,000 ms (2 min). + """ + + +class NodeSubagentNodeToolCodeTool(TypedDict, total=False): + code: Required[str] + """JavaScript code to execute in the sandbox.""" + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["code"]] + + description: str + """Describes what this tool does and when to call this tool.""" + + execution_message_description: str + """The description for the sentence agent say during execution. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the code execution result. + + These mapped values will be extracted and added as dynamic variables. + """ + + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. + """ + + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the tool. + """ + + timeout_ms: int + """The maximum time in milliseconds the code can run before it's considered + timeout. + + Defaults to 30,000 ms (30 s). + """ + + +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["string"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + examples: SequenceNotStr[str] + """Examples of the variable value to teach model the style and syntax.""" + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[SequenceNotStr[str]] + """The possible values of the variable, must be non empty array.""" + + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class NodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["extract_dynamic_variable"]] + + variables: Required[Iterable[NodeSubagentNodeToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" + + +class NodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["bridge_transfer"]] + + description: str + """Describes what the tool does. + + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it bridges the original + caller to the transfer target and ends the transfer agent call. + """ + + execution_message_description: str + """Describes what to say to user when bridging the transfer. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, will speak during execution.""" + + +class NodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["cancel_transfer"]] + + description: str + """Describes what the tool does. + + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it cancels the transfer, + returns the original caller to the main agent, and ends the transfer agent call. + """ + + execution_message_description: str + """Describes what to say to user when cancelling the transfer. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, will speak during execution.""" + + +class NodeSubagentNodeToolMcpTool(TypedDict, total=False): + description: Required[str] + """Description of the MCP tool.""" + + name: Required[str] + """Name of the MCP tool.""" + + type: Required[Literal["mcp"]] + + execution_message_description: str + """The description for the sentence agent say during execution. + + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + input_schema: Dict[str, str] + """The input schema of the MCP tool.""" + + mcp_id: str + """Unique id of the MCP.""" + + response_variables: Dict[str, str] + """ + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response + """ + + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ + + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ + + +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, +] + + +class NodeSubagentNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + instruction: Required[NodeSubagentNodeInstruction] + + type: Required[Literal["subagent"]] + """Type of the node""" + + always_edge: NodeSubagentNodeAlwaysEdge + + display_position: NodeSubagentNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[NodeSubagentNodeEdge] + + finetune_conversation_examples: Iterable[NodeSubagentNodeFinetuneConversationExample] + + finetune_transition_examples: Iterable[NodeSubagentNodeFinetuneTransitionExample] + + global_node_setting: NodeSubagentNodeGlobalNodeSetting + + interruption_sensitivity: Optional[float] + + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + + model_choice: NodeSubagentNodeModelChoice + + name: str + """Optional name for display purposes""" + + responsiveness: Optional[float] + + skip_response_edge: NodeSubagentNodeSkipResponseEdge + + tool_ids: Optional[SequenceNotStr[str]] + """ + The tool ids of the tools defined in main conversation flow or component that + can be used in this subagent node. + """ + + tools: Optional[Iterable[NodeSubagentNodeTool]] + """The tools owned by this subagent node. + + This includes other tool types like transfer_call, agent_swap, etc. + """ + + voice_speed: Optional[float] + + +class NodeEndNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeEndNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeEndNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeEndNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeEndNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[NodeEndNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[NodeEndNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeEndNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeEndNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeEndNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +NodeEndNodeInstruction: TypeAlias = Union[ + NodeEndNodeInstructionNodeInstructionPrompt, NodeEndNodeInstructionNodeInstructionStaticText +] + + +class NodeEndNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class NodeEndNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + type: Required[Literal["end"]] + """Type of the node""" + + display_position: NodeEndNodeDisplayPosition + """Position for frontend display""" + + global_node_setting: NodeEndNodeGlobalNodeSetting + + instruction: NodeEndNodeInstruction + """What to say when ending the call, only used when speak during execution""" + + model_choice: NodeEndNodeModelChoice + + name: str + """Optional name for display purposes""" + + speak_during_execution: bool + """If true, will speak during execution""" + + +class NodeFunctionNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeFunctionNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeFunctionNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeFunctionNodeEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeFunctionNodeEdgeTransitionConditionPromptCondition, NodeFunctionNodeEdgeTransitionConditionEquationCondition +] + + +class NodeFunctionNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeFunctionNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeFunctionNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeFunctionNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Else"] + """Must be "Else" for else edge""" + + +class NodeFunctionNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +NodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeFunctionNodeElseEdgeTransitionConditionPromptCondition, + NodeFunctionNodeElseEdgeTransitionConditionEquationCondition, + NodeFunctionNodeElseEdgeTransitionConditionUnionMember2, +] + + +class NodeFunctionNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeFunctionNodeElseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeFunctionNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeFunctionNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeFunctionNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeFunctionNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[NodeFunctionNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeFunctionNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeFunctionNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +NodeFunctionNodeInstruction: TypeAlias = Union[ + NodeFunctionNodeInstructionNodeInstructionPrompt, NodeFunctionNodeInstructionNodeInstructionStaticText +] + + +class NodeFunctionNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -2851,31 +3839,45 @@ class NodeEndNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeEndNode(TypedDict, total=False): +class NodeFunctionNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - type: Required[Literal["end"]] + tool_id: Required[str] + """Tool ID for function nodes""" + + tool_type: Required[Literal["local", "shared"]] + """Tool type for function nodes""" + + type: Required[Literal["function"]] """Type of the node""" - display_position: NodeEndNodeDisplayPosition + wait_for_result: Required[bool] + """Whether to wait for tool result""" + + display_position: NodeFunctionNodeDisplayPosition """Position for frontend display""" - global_node_setting: NodeEndNodeGlobalNodeSetting + edges: Iterable[NodeFunctionNodeEdge] - instruction: NodeEndNodeInstruction - """What to say when ending the call, only used when speak during execution""" + else_edge: NodeFunctionNodeElseEdge - model_choice: NodeEndNodeModelChoice + finetune_transition_examples: Iterable[NodeFunctionNodeFinetuneTransitionExample] + + global_node_setting: NodeFunctionNodeGlobalNodeSetting + + instruction: NodeFunctionNodeInstruction + + model_choice: NodeFunctionNodeModelChoice name: str """Optional name for display purposes""" speak_during_execution: bool - """If true, will speak during execution""" + """Whether to speak during tool execution""" -class NodeFunctionNodeDisplayPosition(TypedDict, total=False): +class NodeCodeNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -2883,14 +3885,14 @@ class NodeFunctionNodeDisplayPosition(TypedDict, total=False): y: float -class NodeFunctionNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeCodeNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeCodeNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -2904,37 +3906,37 @@ class NodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(TypedDict """ -class NodeFunctionNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeFunctionNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeCodeNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeCodeNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeFunctionNodeEdgeTransitionConditionPromptCondition, NodeFunctionNodeEdgeTransitionConditionEquationCondition +NodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeCodeNodeEdgeTransitionConditionPromptCondition, NodeCodeNodeEdgeTransitionConditionEquationCondition ] -class NodeFunctionNodeEdge(TypedDict, total=False): +class NodeCodeNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeFunctionNodeEdgeTransitionCondition] + transition_condition: Required[NodeCodeNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeFunctionNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeCodeNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -2948,8 +3950,8 @@ class NodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(Typed """ -class NodeFunctionNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation]] +class NodeCodeNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] @@ -2959,37 +3961,37 @@ class NodeFunctionNodeElseEdgeTransitionConditionEquationCondition(TypedDict, to """Must be "Else" for else edge""" -class NodeFunctionNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class NodeCodeNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Else"]] """Must be "Else" for else edge""" type: Required[Literal["prompt"]] -NodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeFunctionNodeElseEdgeTransitionConditionPromptCondition, - NodeFunctionNodeElseEdgeTransitionConditionEquationCondition, - NodeFunctionNodeElseEdgeTransitionConditionUnionMember2, +NodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeCodeNodeElseEdgeTransitionConditionPromptCondition, + NodeCodeNodeElseEdgeTransitionConditionEquationCondition, + NodeCodeNodeElseEdgeTransitionConditionUnionMember2, ] -class NodeFunctionNodeElseEdge(TypedDict, total=False): +class NodeCodeNodeElseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeFunctionNodeElseEdgeTransitionCondition] + transition_condition: Required[NodeCodeNodeElseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -2999,7 +4001,7 @@ class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, tool_call_id: Required[str] -class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -3007,34 +4009,32 @@ class NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, tool_call_id: Required[str] -NodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodeFunctionNodeFinetuneTransitionExample(TypedDict, total=False): +class NodeCodeNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[NodeFunctionNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[NodeCodeNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -3048,9 +4048,9 @@ class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquatio """ -class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -3058,29 +4058,29 @@ class NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquatio type: Required[Literal["equation"]] -NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeFunctionNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -3090,7 +4090,7 @@ class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMem tool_call_id: Required[str] -class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -3098,25 +4098,25 @@ class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMem tool_call_id: Required[str] -NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -3126,7 +4126,7 @@ class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMem tool_call_id: Required[str] -class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -3134,19 +4134,19 @@ class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMem tool_call_id: Required[str] -NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeFunctionNodeGlobalNodeSetting(TypedDict, total=False): +class NodeCodeNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -3156,20 +4156,20 @@ class NodeFunctionNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeFunctionNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeCodeNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeCodeNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeCodeNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeFunctionNodeInstructionNodeInstructionPrompt(TypedDict, total=False): +class NodeCodeNodeInstructionNodeInstructionPrompt(TypedDict, total=False): text: Required[str] """The prompt text for the instruction""" @@ -3177,7 +4177,7 @@ class NodeFunctionNodeInstructionNodeInstructionPrompt(TypedDict, total=False): """Type of instruction""" -class NodeFunctionNodeInstructionNodeInstructionStaticText(TypedDict, total=False): +class NodeCodeNodeInstructionNodeInstructionStaticText(TypedDict, total=False): text: Required[str] """The static text for the instruction""" @@ -3185,12 +4185,12 @@ class NodeFunctionNodeInstructionNodeInstructionStaticText(TypedDict, total=Fals """Type of instruction""" -NodeFunctionNodeInstruction: TypeAlias = Union[ - NodeFunctionNodeInstructionNodeInstructionPrompt, NodeFunctionNodeInstructionNodeInstructionStaticText +NodeCodeNodeInstruction: TypeAlias = Union[ + NodeCodeNodeInstructionNodeInstructionPrompt, NodeCodeNodeInstructionNodeInstructionStaticText ] -class NodeFunctionNodeModelChoice(TypedDict, total=False): +class NodeCodeNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -3221,104 +4221,62 @@ class NodeFunctionNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeFunctionNode(TypedDict, total=False): +class NodeCodeNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - tool_id: Required[str] - """Tool ID for function nodes""" - - tool_type: Required[Literal["local", "shared"]] - """Tool type for function nodes""" + code: Required[str] + """JavaScript code to execute in the sandbox.""" - type: Required[Literal["function"]] + type: Required[Literal["code"]] """Type of the node""" wait_for_result: Required[bool] - """Whether to wait for tool result""" - - display_position: NodeFunctionNodeDisplayPosition - """Position for frontend display""" - - edges: Iterable[NodeFunctionNodeEdge] - - else_edge: NodeFunctionNodeElseEdge - - finetune_transition_examples: Iterable[NodeFunctionNodeFinetuneTransitionExample] - - global_node_setting: NodeFunctionNodeGlobalNodeSetting - - instruction: NodeFunctionNodeInstruction - - model_choice: NodeFunctionNodeModelChoice - - name: str - """Optional name for display purposes""" - - speak_during_execution: bool - """Whether to speak during tool execution""" - + """Whether to wait for code execution result""" -class NodeCodeNodeDisplayPosition(TypedDict, total=False): + display_position: NodeCodeNodeDisplayPosition """Position for frontend display""" - x: float - - y: float - - -class NodeCodeNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class NodeCodeNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - - right: str - """Right side of the equation. + edges: Iterable[NodeCodeNodeEdge] - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ + else_edge: NodeCodeNodeElseEdge + finetune_transition_examples: Iterable[NodeCodeNodeFinetuneTransitionExample] -class NodeCodeNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeCodeNodeEdgeTransitionConditionEquationConditionEquation]] + global_node_setting: NodeCodeNodeGlobalNodeSetting - operator: Required[Literal["||", "&&"]] + instruction: NodeCodeNodeInstruction - type: Required[Literal["equation"]] + model_choice: NodeCodeNodeModelChoice + name: str + """Optional name for display purposes""" -NodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeCodeNodeEdgeTransitionConditionPromptCondition, NodeCodeNodeEdgeTransitionConditionEquationCondition -] + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the code execution result. + These mapped values will be extracted and added as dynamic variables. + """ -class NodeCodeNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + speak_during_execution: bool + """Whether to speak during code execution""" - transition_condition: Required[NodeCodeNodeEdgeTransitionCondition] + timeout_ms: int + """The maximum time in milliseconds the code can run before it's considered + timeout. - destination_node_id: str - """ID of the destination node""" + Defaults to 30,000 ms (30 s). + """ -class NodeCodeNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeTransferCallNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -3332,333 +4290,342 @@ class NodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict """ -class NodeCodeNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation]] +class NodeTransferCallNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" -class NodeCodeNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class NodeTransferCallNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Transfer failed"]] + """Must be "Transfer failed" for transfer failed edge""" type: Required[Literal["prompt"]] -NodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeCodeNodeElseEdgeTransitionConditionPromptCondition, - NodeCodeNodeElseEdgeTransitionConditionEquationCondition, - NodeCodeNodeElseEdgeTransitionConditionUnionMember2, +NodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeTransferCallNodeEdgeTransitionConditionPromptCondition, + NodeTransferCallNodeEdgeTransitionConditionEquationCondition, + NodeTransferCallNodeEdgeTransitionConditionUnionMember2, ] -class NodeCodeNodeElseEdge(TypedDict, total=False): +class NodeTransferCallNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeCodeNodeElseEdgeTransitionCondition] + transition_condition: Required[NodeTransferCallNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -NodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, -] - +class NodeTransferCallNodeTransferDestinationTransferDestinationPredefined(TypedDict, total=False): + number: Required[str] + """ + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. + """ -class NodeCodeNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" + type: Required[Literal["predefined"]] + """The type of transfer destination.""" - transcript: Required[Iterable[NodeCodeNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" + extension: str + """Extension digits to dial after the main number connects. - destination_node_id: str - """Optional destination node ID""" + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. + """ -class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeTransferCallNodeTransferDestinationTransferDestinationInferred(TypedDict, total=False): prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - - right: str - """Right side of the equation. + """The prompt to be used to help infer the transfer destination. - The right side of the equation not required when "exists" or "not_exist" are - selected. + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. """ + type: Required[Literal["inferred"]] + """The type of transfer destination.""" -class NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] - type: Required[Literal["equation"]] +NodeTransferCallNodeTransferDestination: TypeAlias = Union[ + NodeTransferCallNodeTransferDestinationTransferDestinationPredefined, + NodeTransferCallNodeTransferDestinationTransferDestinationInferred, +] -NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] +class NodeTransferCallNodeTransferOptionTransferOptionColdTransfer(TypedDict, total=False): + type: Required[Literal["cold_transfer"]] + """The type of the transfer.""" + cold_transfer_mode: Literal["sip_refer", "sip_invite"] + """The mode of the cold transfer. -class NodeCodeNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. + """ - transition_condition: Required[NodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition] + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ - destination_node_id: str - """ID of the destination node""" + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. + If not set, falls back to the agent-level `ring_duration_ms`. + """ -class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - role: Required[Literal["agent", "user"]] +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): + """IVR navigation option to run when doing human detection. + This prompt will guide the AI on how to navigate the IVR system. + """ -class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - name: Required[str] + type: Literal["prompt"] - role: Required[Literal["tool_call_invocation"]] - tool_call_id: Required[str] +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["prompt"] -class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - tool_call_id: Required[str] + type: Literal["static_message"] -NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + type: Literal["prompt"] - role: Required[Literal["agent", "user"]] +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" -class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + type: Literal["static_message"] - name: Required[str] - role: Required[Literal["tool_call_invocation"]] +NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - tool_call_id: Required[str] +class NodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): + type: Required[Literal["warm_transfer"]] + """The type of the transfer.""" -class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + agent_detection_timeout_ms: float + """The time to wait before considering transfer fails.""" - role: Required[Literal["tool_call_result"]] + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" - tool_call_id: Required[str] + ivr_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption + """IVR navigation option to run when doing human detection. + This prompt will guide the AI on how to navigate the IVR system. + """ -NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" + opt_out_human_detection: bool + """If set to true, will not perform human detection for the transfer. -class NodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + Default to false. + """ + private_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption + """ + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. + """ -class NodeCodeNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" + public_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - cool_down: float + show_transferee_as_caller: bool """ - The same global node won't be triggered again within the next N node - transitions. + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. """ - go_back_conditions: Iterable[NodeCodeNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. - There would be no destination_node_id for these edges. + If not set, falls back to the agent-level `ring_duration_ms`. """ - negative_finetune_examples: Iterable[NodeCodeNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - - positive_finetune_examples: Iterable[NodeCodeNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" +class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + TypedDict, total=False +): + """The agent that will mediate the transfer decision.""" -class NodeCodeNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" + agent_id: Required[str] + """The agent ID of the transfer agent. - type: Required[Literal["prompt"]] - """Type of instruction""" + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). + """ + agent_version: Required[float] + """The version of the transfer agent to use.""" -class NodeCodeNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - type: Required[Literal["static_text"]] - """Type of instruction""" +class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig(TypedDict, total=False): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" + action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] + """The action to take when the transfer agent times out without making a decision. -NodeCodeNodeInstruction: TypeAlias = Union[ - NodeCodeNodeInstructionNodeInstructionPrompt, NodeCodeNodeInstructionNodeInstructionStaticText -] + Defaults to cancel_transfer. + """ + transfer_agent: ( + NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + ) + """The agent that will mediate the transfer decision.""" -class NodeCodeNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - ] - """The LLM model to use""" + transfer_timeout_ms: float + """ + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). + """ - type: Required[Literal["cascading"]] - """Type of model choice""" - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" +class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["prompt"] -class NodeCodeNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" - code: Required[str] - """JavaScript code to execute in the sandbox.""" +class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - type: Required[Literal["code"]] - """Type of the node""" + type: Literal["static_message"] - wait_for_result: Required[bool] - """Whether to wait for code execution result""" - display_position: NodeCodeNodeDisplayPosition - """Position for frontend display""" +NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - edges: Iterable[NodeCodeNodeEdge] - else_edge: NodeCodeNodeElseEdge +class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): + agentic_transfer_config: Required[ + NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + ] + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - finetune_transition_examples: Iterable[NodeCodeNodeFinetuneTransitionExample] + type: Required[Literal["agentic_warm_transfer"]] + """The type of the transfer.""" - global_node_setting: NodeCodeNodeGlobalNodeSetting + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" - instruction: NodeCodeNodeInstruction + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" - model_choice: NodeCodeNodeModelChoice + public_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - name: str - """Optional name for display purposes""" + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the code execution result. + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. - These mapped values will be extracted and added as dynamic variables. + If not set, falls back to the agent-level `ring_duration_ms`. """ - speak_during_execution: bool - """Whether to speak during code execution""" - timeout_ms: int - """The maximum time in milliseconds the code can run before it's considered - timeout. +NodeTransferCallNodeTransferOption: TypeAlias = Union[ + NodeTransferCallNodeTransferOptionTransferOptionColdTransfer, + NodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, + NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, +] - Defaults to 30,000 ms (30 s). - """ +class NodeTransferCallNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" -class NodeTransferCallNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + x: float + + y: float + + +class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -3672,340 +4639,330 @@ class NodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(Typed """ -class NodeTransferCallNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" + +NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] -class NodeTransferCallNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Transfer failed"]] - """Must be "Transfer failed" for transfer failed edge""" +class NodeTransferCallNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - type: Required[Literal["prompt"]] + transition_condition: Required[NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition] + destination_node_id: str + """ID of the destination node""" -NodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeTransferCallNodeEdgeTransitionConditionPromptCondition, - NodeTransferCallNodeEdgeTransitionConditionEquationCondition, - NodeTransferCallNodeEdgeTransitionConditionUnionMember2, + +class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeTransferCallNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" +class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + - transition_condition: Required[NodeTransferCallNodeEdgeTransitionCondition] +class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - destination_node_id: str - """ID of the destination node""" + role: Required[Literal["agent", "user"]] -class NodeTransferCallNodeTransferDestinationTransferDestinationPredefined(TypedDict, total=False): - number: Required[str] - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ +class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - type: Required[Literal["predefined"]] - """The type of transfer destination.""" + name: Required[str] - extension: str - """Extension digits to dial after the main number connects. + role: Required[Literal["tool_call_invocation"]] - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ + tool_call_id: Required[str] -class NodeTransferCallNodeTransferDestinationTransferDestinationInferred(TypedDict, total=False): - prompt: Required[str] - """The prompt to be used to help infer the transfer destination. +class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. - """ + role: Required[Literal["tool_call_result"]] - type: Required[Literal["inferred"]] - """The type of transfer destination.""" + tool_call_id: Required[str] -NodeTransferCallNodeTransferDestination: TypeAlias = Union[ - NodeTransferCallNodeTransferDestinationTransferDestinationPredefined, - NodeTransferCallNodeTransferDestinationTransferDestinationInferred, +NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeTransferCallNodeTransferOptionTransferOptionColdTransfer(TypedDict, total=False): - type: Required[Literal["cold_transfer"]] - """The type of the transfer.""" +class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - cold_transfer_mode: Literal["sip_refer", "sip_invite"] - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class NodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" - show_transferee_as_caller: bool + cool_down: float """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. + The same global node won't be triggered again within the next N node + transitions. """ - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + go_back_conditions: Iterable[NodeTransferCallNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. - If not set, falls back to the agent-level `ring_duration_ms`. + There would be no destination_node_id for these edges. """ + negative_finetune_examples: Iterable[NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): - """IVR navigation option to run when doing human detection. + positive_finetune_examples: Iterable[NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" - This prompt will guide the AI on how to navigate the IVR system. - """ - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" +class NodeTransferCallNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" - type: Literal["prompt"] + type: Required[Literal["prompt"]] + """Type of instruction""" -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" +class NodeTransferCallNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" - type: Literal["prompt"] + type: Required[Literal["static_text"]] + """Type of instruction""" -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" +NodeTransferCallNodeInstruction: TypeAlias = Union[ + NodeTransferCallNodeInstructionNodeInstructionPrompt, NodeTransferCallNodeInstructionNodeInstructionStaticText +] - type: Literal["static_message"] +class NodeTransferCallNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" -NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, -] + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" +class NodeTransferCallNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - type: Literal["prompt"] + edge: Required[NodeTransferCallNodeEdge] + transfer_destination: Required[NodeTransferCallNodeTransferDestination] -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + transfer_option: Required[NodeTransferCallNodeTransferOption] - type: Literal["static_message"] + type: Required[Literal["transfer_call"]] + """Type of the node""" + custom_sip_headers: Dict[str, str] + """Custom SIP headers for transfer calls""" -NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + display_position: NodeTransferCallNodeDisplayPosition + """Position for frontend display""" + global_node_setting: NodeTransferCallNodeGlobalNodeSetting -class NodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): - type: Required[Literal["warm_transfer"]] - """The type of the transfer.""" + ignore_e164_validation: bool + """If true, the e.164 validation will be ignored for the from_number. - agent_detection_timeout_ms: float - """The time to wait before considering transfer fails.""" + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" + instruction: NodeTransferCallNodeInstruction + """What to say when transferring the call, only used when speak during execution""" - ivr_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption - """IVR navigation option to run when doing human detection. + model_choice: NodeTransferCallNodeModelChoice - This prompt will guide the AI on how to navigate the IVR system. - """ + name: str + """Optional name for display purposes""" - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" + speak_during_execution: bool + """If true, will speak during execution""" - opt_out_human_detection: bool - """If set to true, will not perform human detection for the transfer. - Default to false. - """ +class NodePressDigitNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" - private_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ + type: Required[Literal["prompt"]] + """Type of instruction""" - public_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ +class NodePressDigitNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + x: float - If not set, falls back to the agent-level `ring_duration_ms`. - """ + y: float -class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - TypedDict, total=False -): - """The agent that will mediate the transfer decision.""" +class NodePressDigitNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - agent_id: Required[str] - """The agent ID of the transfer agent. + type: Required[Literal["prompt"]] - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ - agent_version: Required[float] - """The version of the transfer agent to use.""" +class NodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig(TypedDict, total=False): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] - """The action to take when the transfer agent times out without making a decision. +class NodePressDigitNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodePressDigitNodeEdgeTransitionConditionEquationConditionEquation]] - Defaults to cancel_transfer. - """ + operator: Required[Literal["||", "&&"]] - transfer_agent: ( - NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - ) - """The agent that will mediate the transfer decision.""" + type: Required[Literal["equation"]] - transfer_timeout_ms: float - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ +NodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ + NodePressDigitNodeEdgeTransitionConditionPromptCondition, NodePressDigitNodeEdgeTransitionConditionEquationCondition +] -class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Literal["prompt"] +class NodePressDigitNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[NodePressDigitNodeEdgeTransitionCondition] -class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: str + """ID of the destination node""" - type: Literal["static_message"] +class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] -NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + role: Required[Literal["agent", "user"]] -class NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): - agentic_transfer_config: Required[ - NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - ] - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - type: Required[Literal["agentic_warm_transfer"]] - """The type of the transfer.""" + name: Required[str] - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" + role: Required[Literal["tool_call_invocation"]] - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" + tool_call_id: Required[str] - public_handoff_option: NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ +class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + role: Required[Literal["tool_call_result"]] - If not set, falls back to the agent-level `ring_duration_ms`. - """ + tool_call_id: Required[str] -NodeTransferCallNodeTransferOption: TypeAlias = Union[ - NodeTransferCallNodeTransferOptionTransferOptionColdTransfer, - NodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, - NodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, +NodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodeTransferCallNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class NodePressDigitNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - x: float + transcript: Required[Iterable[NodePressDigitNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" - y: float + destination_node_id: str + """Optional destination node ID""" -class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -4021,9 +4978,9 @@ class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -4031,29 +4988,29 @@ class NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu type: Required[Literal["equation"]] -NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeTransferCallNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4063,7 +5020,7 @@ class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4071,25 +5028,25 @@ class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4099,7 +5056,7 @@ class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4107,19 +5064,19 @@ class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): +class NodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4129,41 +5086,20 @@ class NodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeTransferCallNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodePressDigitNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeTransferCallNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class NodeTransferCallNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -NodeTransferCallNodeInstruction: TypeAlias = Union[ - NodeTransferCallNodeInstructionNodeInstructionPrompt, NodeTransferCallNodeInstructionNodeInstructionStaticText -] - - -class NodeTransferCallNodeModelChoice(TypedDict, total=False): +class NodePressDigitNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4194,56 +5130,90 @@ class NodeTransferCallNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeTransferCallNode(TypedDict, total=False): +class NodePressDigitNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - edge: Required[NodeTransferCallNodeEdge] - - transfer_destination: Required[NodeTransferCallNodeTransferDestination] - - transfer_option: Required[NodeTransferCallNodeTransferOption] + instruction: Required[NodePressDigitNodeInstruction] - type: Required[Literal["transfer_call"]] + type: Required[Literal["press_digit"]] """Type of the node""" - custom_sip_headers: Dict[str, str] - """Custom SIP headers for transfer calls""" + delay_ms: int + """Delay in milliseconds before pressing the digit""" - display_position: NodeTransferCallNodeDisplayPosition + display_position: NodePressDigitNodeDisplayPosition """Position for frontend display""" - global_node_setting: NodeTransferCallNodeGlobalNodeSetting + edges: Iterable[NodePressDigitNodeEdge] - ignore_e164_validation: bool - """If true, the e.164 validation will be ignored for the from_number. + finetune_transition_examples: Iterable[NodePressDigitNodeFinetuneTransitionExample] - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. + global_node_setting: NodePressDigitNodeGlobalNodeSetting + + model_choice: NodePressDigitNodeModelChoice + + name: str + """Optional name for display purposes""" + + +class NodeBranchNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - instruction: NodeTransferCallNodeInstruction - """What to say when transferring the call, only used when speak during execution""" - model_choice: NodeTransferCallNodeModelChoice +class NodeBranchNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Else"] + """Must be "Else" for else edge""" + + +class NodeBranchNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] - name: str - """Optional name for display purposes""" - speak_during_execution: bool - """If true, will speak during execution""" +NodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeBranchNodeElseEdgeTransitionConditionPromptCondition, + NodeBranchNodeElseEdgeTransitionConditionEquationCondition, + NodeBranchNodeElseEdgeTransitionConditionUnionMember2, +] -class NodePressDigitNodeInstruction(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" +class NodeBranchNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - type: Required[Literal["prompt"]] - """Type of instruction""" + transition_condition: Required[NodeBranchNodeElseEdgeTransitionCondition] + destination_node_id: str + """ID of the destination node""" -class NodePressDigitNodeDisplayPosition(TypedDict, total=False): + +class NodeBranchNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -4251,14 +5221,14 @@ class NodePressDigitNodeDisplayPosition(TypedDict, total=False): y: float -class NodePressDigitNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeBranchNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeBranchNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4272,36 +5242,36 @@ class NodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(TypedDi """ -class NodePressDigitNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodePressDigitNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeBranchNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeBranchNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ - NodePressDigitNodeEdgeTransitionConditionPromptCondition, NodePressDigitNodeEdgeTransitionConditionEquationCondition +NodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeBranchNodeEdgeTransitionConditionPromptCondition, NodeBranchNodeEdgeTransitionConditionEquationCondition ] -class NodePressDigitNodeEdge(TypedDict, total=False): +class NodeBranchNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodePressDigitNodeEdgeTransitionCondition] + transition_condition: Required[NodeBranchNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4311,7 +5281,7 @@ class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDic tool_call_id: Required[str] -class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4319,32 +5289,32 @@ class NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDic tool_call_id: Required[str] -NodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodePressDigitNodeFinetuneTransitionExample(TypedDict, total=False): +class NodeBranchNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[NodePressDigitNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[NodeBranchNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -4360,9 +5330,9 @@ class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquat """ -class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -4370,29 +5340,29 @@ class NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquat type: Required[Literal["equation"]] -NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodePressDigitNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4402,7 +5372,7 @@ class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionM tool_call_id: Required[str] -class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4410,25 +5380,25 @@ class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionM tool_call_id: Required[str] -NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4438,7 +5408,7 @@ class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionM tool_call_id: Required[str] -class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4446,19 +5416,19 @@ class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionM tool_call_id: Required[str] -NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): +class NodeBranchNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4468,20 +5438,20 @@ class NodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodePressDigitNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeBranchNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeBranchNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeBranchNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodePressDigitNodeModelChoice(TypedDict, total=False): +class NodeBranchNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4512,41 +5482,38 @@ class NodePressDigitNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodePressDigitNode(TypedDict, total=False): +class NodeBranchNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[NodePressDigitNodeInstruction] + else_edge: Required[NodeBranchNodeElseEdge] - type: Required[Literal["press_digit"]] + type: Required[Literal["branch"]] """Type of the node""" - delay_ms: int - """Delay in milliseconds before pressing the digit""" - - display_position: NodePressDigitNodeDisplayPosition + display_position: NodeBranchNodeDisplayPosition """Position for frontend display""" - edges: Iterable[NodePressDigitNodeEdge] + edges: Iterable[NodeBranchNodeEdge] - finetune_transition_examples: Iterable[NodePressDigitNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[NodeBranchNodeFinetuneTransitionExample] - global_node_setting: NodePressDigitNodeGlobalNodeSetting + global_node_setting: NodeBranchNodeGlobalNodeSetting - model_choice: NodePressDigitNodeModelChoice + model_choice: NodeBranchNodeModelChoice name: str """Optional name for display purposes""" -class NodeBranchNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeSMSNodeFailedEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4560,57 +5527,70 @@ class NodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDi """ -class NodeBranchNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation]] +class NodeSMSNodeFailedEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" + prompt: Literal["Failed to send"] + """Must be "failed to send" for SMS failed edge""" -class NodeBranchNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class NodeSMSNodeFailedEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Failed to send"]] + """Must be "failed to send" for SMS failed edge""" type: Required[Literal["prompt"]] -NodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeBranchNodeElseEdgeTransitionConditionPromptCondition, - NodeBranchNodeElseEdgeTransitionConditionEquationCondition, - NodeBranchNodeElseEdgeTransitionConditionUnionMember2, +NodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ + NodeSMSNodeFailedEdgeTransitionConditionPromptCondition, + NodeSMSNodeFailedEdgeTransitionConditionEquationCondition, + NodeSMSNodeFailedEdgeTransitionConditionUnionMember2, ] -class NodeBranchNodeElseEdge(TypedDict, total=False): +class NodeSMSNodeFailedEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeBranchNodeElseEdgeTransitionCondition] + transition_condition: Required[NodeSMSNodeFailedEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeBranchNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class NodeSMSNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" - x: float + type: Required[Literal["prompt"]] + """Type of instruction""" - y: float +class NodeSMSNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" -class NodeBranchNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + type: Required[Literal["static_text"]] + """Type of instruction""" + + +NodeSMSNodeInstruction: TypeAlias = Union[ + NodeSMSNodeInstructionNodeInstructionPrompt, NodeSMSNodeInstructionNodeInstructionStaticText +] + + +class NodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeBranchNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4624,81 +5604,57 @@ class NodeBranchNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, """ -class NodeBranchNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeBranchNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] + prompt: Literal["Sent successfully"] + """Must be "sent successfully" for SMS success edge""" -NodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeBranchNodeEdgeTransitionConditionPromptCondition, NodeBranchNodeEdgeTransitionConditionEquationCondition -] - - -class NodeBranchNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - - transition_condition: Required[NodeBranchNodeEdgeTransitionCondition] - - destination_node_id: str - """ID of the destination node""" - - -class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +class NodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Sent successfully"]] + """Must be "sent successfully" for SMS success edge""" - tool_call_id: Required[str] + type: Required[Literal["prompt"]] -NodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ + NodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, + NodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, + NodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, ] -class NodeBranchNodeFinetuneTransitionExample(TypedDict, total=False): +class NodeSMSNodeSuccessEdge(TypedDict, total=False): id: Required[str] - """Unique identifier for the example""" + """Unique identifier for the edge""" - transcript: Required[Iterable[NodeBranchNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" + transition_condition: Required[NodeSMSNodeSuccessEdgeTransitionCondition] destination_node_id: str - """Optional destination node ID""" + """ID of the destination node""" -class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeSMSNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4712,9 +5668,9 @@ class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationC """ -class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -4722,29 +5678,29 @@ class NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationC type: Required[Literal["equation"]] -NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeBranchNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4754,7 +5710,7 @@ class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMembe tool_call_id: Required[str] -class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4762,25 +5718,25 @@ class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMembe tool_call_id: Required[str] -NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4790,7 +5746,7 @@ class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMembe tool_call_id: Required[str] -class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4798,19 +5754,19 @@ class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMembe tool_call_id: Required[str] -NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeBranchNodeGlobalNodeSetting(TypedDict, total=False): +class NodeSMSNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4820,20 +5776,20 @@ class NodeBranchNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeBranchNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeSMSNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeBranchNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeSMSNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeBranchNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeSMSNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeBranchNodeModelChoice(TypedDict, total=False): +class NodeSMSNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4864,115 +5820,156 @@ class NodeBranchNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeBranchNode(TypedDict, total=False): +class NodeSMSNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - else_edge: Required[NodeBranchNodeElseEdge] + failed_edge: Required[NodeSMSNodeFailedEdge] - type: Required[Literal["branch"]] - """Type of the node""" + instruction: Required[NodeSMSNodeInstruction] - display_position: NodeBranchNodeDisplayPosition - """Position for frontend display""" + success_edge: Required[NodeSMSNodeSuccessEdge] - edges: Iterable[NodeBranchNodeEdge] + type: Required[Literal["sms"]] + """Type of the node""" - finetune_transition_examples: Iterable[NodeBranchNodeFinetuneTransitionExample] + display_position: NodeSMSNodeDisplayPosition + """Position for frontend display""" - global_node_setting: NodeBranchNodeGlobalNodeSetting + global_node_setting: NodeSMSNodeGlobalNodeSetting - model_choice: NodeBranchNodeModelChoice + model_choice: NodeSMSNodeModelChoice name: str """Optional name for display purposes""" -class NodeSMSNodeFailedEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" +class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" - type: Required[Literal["prompt"]] + name: Required[str] + """Name of the variable.""" + type: Required[Literal["string"]] + """Type of the variable to extract.""" -class NodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + examples: SequenceNotStr[str] + """Examples of the variable value to teach model the style and syntax.""" - right: str - """Right side of the equation. + required: bool + """Whether this data is required. - The right side of the equation not required when "exists" or "not_exist" are - selected. + If true and the data is not extracted, the call will be marked as unsuccessful. """ -class NodeSMSNodeFailedEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation]] +class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[SequenceNotStr[str]] + """The possible values of the variable, must be non empty array.""" - operator: Required[Literal["||", "&&"]] + description: Required[str] + """Description of the variable.""" - type: Required[Literal["equation"]] + name: Required[str] + """Name of the variable.""" - prompt: Literal["Failed to send"] - """Must be "failed to send" for SMS failed edge""" + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ -class NodeSMSNodeFailedEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Failed to send"]] - """Must be "failed to send" for SMS failed edge""" + required: bool + """Whether this data is required. - type: Required[Literal["prompt"]] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -NodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ - NodeSMSNodeFailedEdgeTransitionConditionPromptCondition, - NodeSMSNodeFailedEdgeTransitionConditionEquationCondition, - NodeSMSNodeFailedEdgeTransitionConditionUnionMember2, -] +class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + name: Required[str] + """Name of the variable.""" -class NodeSMSNodeFailedEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" - transition_condition: Required[NodeSMSNodeFailedEdgeTransitionCondition] + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ - destination_node_id: str - """ID of the destination node""" + required: bool + """Whether this data is required. + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -class NodeSMSNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - type: Required[Literal["prompt"]] - """Type of instruction""" +class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + name: Required[str] + """Name of the variable.""" -class NodeSMSNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" + type: Required[Literal["number"]] + """Type of the variable to extract.""" - type: Required[Literal["static_text"]] - """Type of instruction""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool + """Whether this data is required. -NodeSMSNodeInstruction: TypeAlias = Union[ - NodeSMSNodeInstructionNodeInstructionPrompt, NodeSMSNodeInstructionNodeInstructionStaticText + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +NodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeVariableStringAnalysisData, + NodeExtractDynamicVariablesNodeVariableEnumAnalysisData, + NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, + NodeExtractDynamicVariablesNodeVariableNumberAnalysisData, ] -class NodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4986,57 +5983,38 @@ class NodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(TypedDi """ -class NodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation]] +class NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Sent successfully"] - """Must be "sent successfully" for SMS success edge""" - - -class NodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Sent successfully"]] - """Must be "sent successfully" for SMS success edge""" - - type: Required[Literal["prompt"]] - -NodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ - NodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, - NodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, - NodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, +NodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, + NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, ] -class NodeSMSNodeSuccessEdge(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeSMSNodeSuccessEdgeTransitionCondition] - - destination_node_id: str - """ID of the destination node""" - - -class NodeSMSNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" - - x: float + transition_condition: Required[NodeExtractDynamicVariablesNodeEdgeTransitionCondition] - y: float + destination_node_id: str + """ID of the destination node""" -class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5050,39 +6028,48 @@ class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCond """ -class NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] +class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] + prompt: Literal["Else"] + """Must be "Else" for else edge""" -NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, + +class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +NodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, + NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, + NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, ] -class NodeSMSNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeElseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeExtractDynamicVariablesNodeElseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5092,7 +6079,7 @@ class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( tool_call_id: Required[str] -class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5100,275 +6087,251 @@ class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( tool_call_id: Required[str] -NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] +class NodeExtractDynamicVariablesNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - tool_call_id: Required[str] + transcript: Required[Iterable[NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + destination_node_id: str + """Optional destination node ID""" -NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] +class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" -class NodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + type: Required[Literal["prompt"]] -class NodeSMSNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" +class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. - """ + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - go_back_conditions: Iterable[NodeSMSNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. + right: str + """Right side of the equation. - There would be no destination_node_id for these edges. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - negative_finetune_examples: Iterable[NodeSMSNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - - positive_finetune_examples: Iterable[NodeSMSNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" - -class NodeSMSNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", +class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ + NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation ] ] - """The LLM model to use""" - type: Required[Literal["cascading"]] - """Type of model choice""" - - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" + operator: Required[Literal["||", "&&"]] + type: Required[Literal["equation"]] -class NodeSMSNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" - failed_edge: Required[NodeSMSNodeFailedEdge] +NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] - instruction: Required[NodeSMSNodeInstruction] - success_edge: Required[NodeSMSNodeSuccessEdge] +class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - type: Required[Literal["sms"]] - """Type of the node""" + transition_condition: Required[NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition] - display_position: NodeSMSNodeDisplayPosition - """Position for frontend display""" + destination_node_id: str + """ID of the destination node""" - global_node_setting: NodeSMSNodeGlobalNodeSetting - model_choice: NodeSMSNodeModelChoice +class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] - name: str - """Optional name for display purposes""" + role: Required[Literal["agent", "user"]] -class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" +class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] name: Required[str] - """Name of the variable.""" - type: Required[Literal["string"]] - """Type of the variable to extract.""" - - examples: SequenceNotStr[str] - """Examples of the variable value to teach model the style and syntax.""" + role: Required[Literal["tool_call_invocation"]] - required: bool - """Whether this data is required. + tool_call_id: Required[str] - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] -class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=False): - choices: Required[SequenceNotStr[str]] - """The possible values of the variable, must be non empty array.""" + role: Required[Literal["tool_call_result"]] - description: Required[str] - """Description of the variable.""" + tool_call_id: Required[str] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["enum"]] - """Type of the variable to extract.""" +NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] - required: bool - """Whether this data is required. - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" -class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" +class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] - name: Required[str] - """Name of the variable.""" + role: Required[Literal["agent", "user"]] - type: Required[Literal["boolean"]] - """Type of the variable to extract.""" - required: bool - """Whether this data is required. +class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] - If true and the data is not extracted, the call will be marked as unsuccessful. - """ + name: Required[str] + role: Required[Literal["tool_call_invocation"]] -class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" + tool_call_id: Required[str] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["number"]] - """Type of the variable to extract.""" +class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] - required: bool - """Whether this data is required. + role: Required[Literal["tool_call_result"]] - If true and the data is not extracted, the call will be marked as unsuccessful. - """ + tool_call_id: Required[str] -NodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeVariableStringAnalysisData, - NodeExtractDynamicVariablesNodeVariableEnumAnalysisData, - NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, - NodeExtractDynamicVariablesNodeVariableNumberAnalysisData, +NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeExtractDynamicVariablesNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - x: float - y: float +class NodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ -class NodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + go_back_conditions: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. - type: Required[Literal["prompt"]] + There would be no destination_node_id for these edges. + """ + negative_finetune_examples: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" -class NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" + positive_finetune_examples: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - right: str - """Right side of the equation. +class NodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ + type: Required[Literal["cascading"]] + """Type of model choice""" + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" -class NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation]] - operator: Required[Literal["||", "&&"]] +class NodeExtractDynamicVariablesNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - type: Required[Literal["equation"]] + type: Required[Literal["extract_dynamic_variables"]] + """Type of the node""" + + variables: Required[Iterable[NodeExtractDynamicVariablesNodeVariable]] + display_position: NodeExtractDynamicVariablesNodeDisplayPosition + """Position for frontend display""" -NodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, - NodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, -] + edges: Iterable[NodeExtractDynamicVariablesNodeEdge] + else_edge: NodeExtractDynamicVariablesNodeElseEdge -class NodeExtractDynamicVariablesNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + finetune_transition_examples: Iterable[NodeExtractDynamicVariablesNodeFinetuneTransitionExample] - transition_condition: Required[NodeExtractDynamicVariablesNodeEdgeTransitionCondition] + global_node_setting: NodeExtractDynamicVariablesNodeGlobalNodeSetting - destination_node_id: str - """ID of the destination node""" + model_choice: NodeExtractDynamicVariablesNodeModelChoice + + name: str + """Optional name for display purposes""" -class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeAgentSwapNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5382,93 +6345,59 @@ class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditio """ -class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation]] +class NodeAgentSwapNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" -class NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class NodeAgentSwapNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Transfer failed"]] + """Must be "Transfer failed" for transfer failed edge""" type: Required[Literal["prompt"]] -NodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, - NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, - NodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, +NodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeAgentSwapNodeEdgeTransitionConditionPromptCondition, + NodeAgentSwapNodeEdgeTransitionConditionEquationCondition, + NodeAgentSwapNodeEdgeTransitionConditionUnionMember2, ] -class NodeExtractDynamicVariablesNodeElseEdge(TypedDict, total=False): +class NodeAgentSwapNodeEdge(TypedDict, total=False): + """Edge to transition to if agent swap fails""" + id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeExtractDynamicVariablesNodeElseEdgeTransitionCondition] + transition_condition: Required[NodeAgentSwapNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, -] - - -class NodeExtractDynamicVariablesNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" +class NodeAgentSwapNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" - transcript: Required[Iterable[NodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" + x: float - destination_node_id: str - """Optional destination node ID""" + y: float -class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -5484,13 +6413,9 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionC """ -class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[ - NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] + Iterable[NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -5498,33 +6423,29 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionC type: Required[Literal["equation"]] -NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeAgentSwapNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5534,9 +6455,7 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTra tool_call_id: Required[str] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5544,29 +6463,25 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTra tool_call_id: Required[str] -NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5576,29 +6491,27 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: Required[str] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] tool_call_id: Required[str] - -NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, + +NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total=False): +class NodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -5608,20 +6521,41 @@ class NodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeAgentSwapNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False): +class NodeAgentSwapNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeAgentSwapNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +NodeAgentSwapNodeInstruction: TypeAlias = Union[ + NodeAgentSwapNodeInstructionNodeInstructionPrompt, NodeAgentSwapNodeInstructionNodeInstructionStaticText +] + + +class NodeAgentSwapNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -5652,40 +6586,70 @@ class NodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeExtractDynamicVariablesNode(TypedDict, total=False): +class NodeAgentSwapNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - type: Required[Literal["extract_dynamic_variables"]] + agent_id: Required[str] + """The ID of the agent to swap to""" + + edge: Required[NodeAgentSwapNodeEdge] + """Edge to transition to if agent swap fails""" + + post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] + """Post call analysis setting for the agent swap""" + + type: Required[Literal["agent_swap"]] """Type of the node""" - variables: Required[Iterable[NodeExtractDynamicVariablesNodeVariable]] + agent_version: float + """The version of the agent to swap to. - display_position: NodeExtractDynamicVariablesNodeDisplayPosition + If not specified, will use the latest version + """ + + display_position: NodeAgentSwapNodeDisplayPosition """Position for frontend display""" - edges: Iterable[NodeExtractDynamicVariablesNodeEdge] + global_node_setting: NodeAgentSwapNodeGlobalNodeSetting - else_edge: NodeExtractDynamicVariablesNodeElseEdge + instruction: NodeAgentSwapNodeInstruction + """What to say when swapping agents, only used when speak during execution""" - finetune_transition_examples: Iterable[NodeExtractDynamicVariablesNodeFinetuneTransitionExample] + keep_current_language: bool + """If true, keep the current language when swapping agents. Defaults to false.""" - global_node_setting: NodeExtractDynamicVariablesNodeGlobalNodeSetting + keep_current_voice: bool + """If true, keep the current voice when swapping agents. Defaults to false.""" - model_choice: NodeExtractDynamicVariablesNodeModelChoice + model_choice: NodeAgentSwapNodeModelChoice name: str """Optional name for display purposes""" + speak_during_execution: bool + """If true, will speak during execution""" + + webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] + """Webhook setting for the agent swap, defaults to only source.""" -class NodeAgentSwapNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + +class NodeMcpNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeMcpNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeMcpNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5699,61 +6663,135 @@ class NodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(TypedDic """ -class NodeAgentSwapNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeMcpNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeMcpNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" +NodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeMcpNodeEdgeTransitionConditionPromptCondition, NodeMcpNodeEdgeTransitionConditionEquationCondition +] -class NodeAgentSwapNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Transfer failed"]] - """Must be "Transfer failed" for transfer failed edge""" + +class NodeMcpNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeMcpNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeMcpNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" type: Required[Literal["prompt"]] -NodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeAgentSwapNodeEdgeTransitionConditionPromptCondition, - NodeAgentSwapNodeEdgeTransitionConditionEquationCondition, - NodeAgentSwapNodeEdgeTransitionConditionUnionMember2, -] +class NodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] -class NodeAgentSwapNodeEdge(TypedDict, total=False): - """Edge to transition to if agent swap fails""" + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeMcpNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Else"] + """Must be "Else" for else edge""" + + +class NodeMcpNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +NodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeMcpNodeElseEdgeTransitionConditionPromptCondition, + NodeMcpNodeElseEdgeTransitionConditionEquationCondition, + NodeMcpNodeElseEdgeTransitionConditionUnionMember2, +] + +class NodeMcpNodeElseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeAgentSwapNodeEdgeTransitionCondition] + transition_condition: Required[NodeMcpNodeElseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeAgentSwapNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - x: float + role: Required[Literal["agent", "user"]] - y: float +class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] -class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeMcpNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeMcpNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5767,9 +6805,9 @@ class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquati """ -class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -5777,29 +6815,29 @@ class NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquati type: Required[Literal["equation"]] -NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeAgentSwapNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5809,7 +6847,7 @@ class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMe tool_call_id: Required[str] -class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5817,25 +6855,25 @@ class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMe tool_call_id: Required[str] -NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5845,7 +6883,7 @@ class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMe tool_call_id: Required[str] -class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5853,19 +6891,19 @@ class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMe tool_call_id: Required[str] -NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): +class NodeMcpNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -5875,20 +6913,20 @@ class NodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeAgentSwapNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeMcpNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeMcpNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeMcpNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeAgentSwapNodeInstructionNodeInstructionPrompt(TypedDict, total=False): +class NodeMcpNodeInstructionNodeInstructionPrompt(TypedDict, total=False): text: Required[str] """The prompt text for the instruction""" @@ -5896,7 +6934,7 @@ class NodeAgentSwapNodeInstructionNodeInstructionPrompt(TypedDict, total=False): """Type of instruction""" -class NodeAgentSwapNodeInstructionNodeInstructionStaticText(TypedDict, total=False): +class NodeMcpNodeInstructionNodeInstructionStaticText(TypedDict, total=False): text: Required[str] """The static text for the instruction""" @@ -5904,12 +6942,12 @@ class NodeAgentSwapNodeInstructionNodeInstructionStaticText(TypedDict, total=Fal """Type of instruction""" -NodeAgentSwapNodeInstruction: TypeAlias = Union[ - NodeAgentSwapNodeInstructionNodeInstructionPrompt, NodeAgentSwapNodeInstructionNodeInstructionStaticText +NodeMcpNodeInstruction: TypeAlias = Union[ + NodeMcpNodeInstructionNodeInstructionPrompt, NodeMcpNodeInstructionNodeInstructionStaticText ] -class NodeAgentSwapNodeModelChoice(TypedDict, total=False): +class NodeMcpNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -5940,55 +6978,110 @@ class NodeAgentSwapNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeAgentSwapNode(TypedDict, total=False): +class NodeMcpNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - agent_id: Required[str] - """The ID of the agent to swap to""" - - edge: Required[NodeAgentSwapNodeEdge] - """Edge to transition to if agent swap fails""" + mcp_id: Required[str] + """Unique ID of the MCP server""" - post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] - """Post call analysis setting for the agent swap""" + mcp_tool_name: Required[str] + """Name of the MCP tool to call""" - type: Required[Literal["agent_swap"]] + type: Required[Literal["mcp"]] """Type of the node""" - agent_version: float - """The version of the agent to swap to. - - If not specified, will use the latest version - """ + wait_for_result: Required[bool] + """If true, will wait for result before transitioning to next node""" - display_position: NodeAgentSwapNodeDisplayPosition + display_position: NodeMcpNodeDisplayPosition """Position for frontend display""" - global_node_setting: NodeAgentSwapNodeGlobalNodeSetting + edges: Iterable[NodeMcpNodeEdge] - instruction: NodeAgentSwapNodeInstruction - """What to say when swapping agents, only used when speak during execution""" + else_edge: NodeMcpNodeElseEdge - keep_current_language: bool - """If true, keep the current language when swapping agents. Defaults to false.""" + finetune_transition_examples: Iterable[NodeMcpNodeFinetuneTransitionExample] - keep_current_voice: bool - """If true, keep the current voice when swapping agents. Defaults to false.""" + global_node_setting: NodeMcpNodeGlobalNodeSetting - model_choice: NodeAgentSwapNodeModelChoice + instruction: NodeMcpNodeInstruction + """What to say when calling the function, only used when speak during execution""" + + model_choice: NodeMcpNodeModelChoice name: str """Optional name for display purposes""" + response_variables: Dict[str, str] + """ + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response + """ + speak_during_execution: bool """If true, will speak during execution""" - webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] - """Webhook setting for the agent swap, defaults to only source.""" +class NodeComponentNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" -class NodeMcpNodeDisplayPosition(TypedDict, total=False): + type: Required[Literal["prompt"]] + + +class NodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeComponentNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Else"] + """Must be "Else" for else edge""" + + +class NodeComponentNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +NodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ + NodeComponentNodeElseEdgeTransitionConditionPromptCondition, + NodeComponentNodeElseEdgeTransitionConditionEquationCondition, + NodeComponentNodeElseEdgeTransitionConditionUnionMember2, +] + + +class NodeComponentNodeElseEdge(TypedDict, total=False): + """Default edge when no other conditions are met""" + + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeComponentNodeElseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeComponentNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -5996,14 +7089,14 @@ class NodeMcpNodeDisplayPosition(TypedDict, total=False): y: float -class NodeMcpNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeComponentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeMcpNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeComponentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -6017,37 +7110,81 @@ class NodeMcpNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, tot """ -class NodeMcpNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeMcpNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeComponentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeComponentNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeMcpNodeEdgeTransitionConditionPromptCondition, NodeMcpNodeEdgeTransitionConditionEquationCondition +NodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeComponentNodeEdgeTransitionConditionPromptCondition, NodeComponentNodeEdgeTransitionConditionEquationCondition ] -class NodeMcpNodeEdge(TypedDict, total=False): +class NodeComponentNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeMcpNodeEdgeTransitionCondition] + transition_condition: Required[NodeComponentNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeMcpNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeComponentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeComponentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -6061,48 +7198,75 @@ class NodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, """ -class NodeMcpNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation]] +class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" - - -class NodeMcpNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" - - type: Required[Literal["prompt"]] - -NodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeMcpNodeElseEdgeTransitionConditionPromptCondition, - NodeMcpNodeElseEdgeTransitionConditionEquationCondition, - NodeMcpNodeElseEdgeTransitionConditionUnionMember2, +NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeMcpNodeElseEdge(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeMcpNodeElseEdgeTransitionCondition] + transition_condition: Required[NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6112,7 +7276,7 @@ class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, tota tool_call_id: Required[str] -class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6120,32 +7284,93 @@ class NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, tota tool_call_id: Required[str] -NodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeMcpNodeFinetuneTransitionExample(TypedDict, total=False): +class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeComponentNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[NodeComponentNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[NodeComponentNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeComponentNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeComponentNode(TypedDict, total=False): id: Required[str] - """Unique identifier for the example""" + """Unique identifier for the node""" - transcript: Required[Iterable[NodeMcpNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" + component_id: Required[str] + """The reference ID of the component""" - destination_node_id: str - """Optional destination node ID""" + component_type: Required[Literal["local", "shared"]] + """Type of component: + - local: stored in conversation flow's components array + - shared: stored in stand-alone conversation-flow-component table + """ -class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + else_edge: Required[NodeComponentNodeElseEdge] + """Default edge when no other conditions are met""" + + type: Required[Literal["component"]] + """Type of the node""" + + display_position: NodeComponentNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[NodeComponentNodeEdge] + """Array of edges for conditional transitions""" + + finetune_transition_examples: Iterable[NodeComponentNodeFinetuneTransitionExample] + + global_node_setting: NodeComponentNodeGlobalNodeSetting + + name: str + """Optional name for display purposes""" + + +class NodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -6159,9 +7384,11 @@ class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCond """ -class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): equations: Required[ - Iterable[NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -6169,29 +7396,29 @@ class NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCond type: Required[Literal["equation"]] -NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeMcpNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6201,7 +7428,7 @@ class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( tool_call_id: Required[str] -class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6209,25 +7436,25 @@ class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( tool_call_id: Required[str] -NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6237,7 +7464,7 @@ class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( tool_call_id: Required[str] -class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6245,19 +7472,19 @@ class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( tool_call_id: Required[str] -NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeMcpNodeGlobalNodeSetting(TypedDict, total=False): +class NodeBridgeTransferNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -6267,20 +7494,20 @@ class NodeMcpNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeMcpNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeBridgeTransferNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeMcpNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeMcpNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeMcpNodeInstructionNodeInstructionPrompt(TypedDict, total=False): +class NodeBridgeTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): text: Required[str] """The prompt text for the instruction""" @@ -6288,154 +7515,78 @@ class NodeMcpNodeInstructionNodeInstructionPrompt(TypedDict, total=False): """Type of instruction""" -class NodeMcpNodeInstructionNodeInstructionStaticText(TypedDict, total=False): +class NodeBridgeTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -NodeMcpNodeInstruction: TypeAlias = Union[ - NodeMcpNodeInstructionNodeInstructionPrompt, NodeMcpNodeInstructionNodeInstructionStaticText -] - - -class NodeMcpNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - ] - """The LLM model to use""" - - type: Required[Literal["cascading"]] - """Type of model choice""" - - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" - - -class NodeMcpNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" - - mcp_id: Required[str] - """Unique ID of the MCP server""" - - mcp_tool_name: Required[str] - """Name of the MCP tool to call""" - - type: Required[Literal["mcp"]] - """Type of the node""" - - wait_for_result: Required[bool] - """If true, will wait for result before transitioning to next node""" - - display_position: NodeMcpNodeDisplayPosition - """Position for frontend display""" - - edges: Iterable[NodeMcpNodeEdge] - - else_edge: NodeMcpNodeElseEdge - - finetune_transition_examples: Iterable[NodeMcpNodeFinetuneTransitionExample] - - global_node_setting: NodeMcpNodeGlobalNodeSetting - - instruction: NodeMcpNodeInstruction - """What to say when calling the function, only used when speak during execution""" - - model_choice: NodeMcpNodeModelChoice - - name: str - """Optional name for display purposes""" - - response_variables: Dict[str, str] - """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response - """ - - speak_during_execution: bool - """If true, will speak during execution""" - - -class NodeComponentNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class NodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + """The static text for the instruction""" - right: str - """Right side of the equation. + type: Required[Literal["static_text"]] + """Type of instruction""" - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +NodeBridgeTransferNodeInstruction: TypeAlias = Union[ + NodeBridgeTransferNodeInstructionNodeInstructionPrompt, NodeBridgeTransferNodeInstructionNodeInstructionStaticText +] -class NodeComponentNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation]] - operator: Required[Literal["||", "&&"]] +class NodeBridgeTransferNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" - type: Required[Literal["equation"]] + type: Required[Literal["cascading"]] + """Type of model choice""" - prompt: Literal["Else"] - """Must be "Else" for else edge""" + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" -class NodeComponentNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class NodeBridgeTransferNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - type: Required[Literal["prompt"]] + type: Required[Literal["bridge_transfer"]] + """Type of the node - initiates a warm transfer by bridging the call""" + display_position: NodeBridgeTransferNodeDisplayPosition + """Position for frontend display""" -NodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ - NodeComponentNodeElseEdgeTransitionConditionPromptCondition, - NodeComponentNodeElseEdgeTransitionConditionEquationCondition, - NodeComponentNodeElseEdgeTransitionConditionUnionMember2, -] + global_node_setting: NodeBridgeTransferNodeGlobalNodeSetting + instruction: NodeBridgeTransferNodeInstruction + """Describes what to say to user when bridging the transfer. -class NodeComponentNodeElseEdge(TypedDict, total=False): - """Default edge when no other conditions are met""" + Only applicable when speak_during_execution is true. + """ - id: Required[str] - """Unique identifier for the edge""" + model_choice: NodeBridgeTransferNodeModelChoice - transition_condition: Required[NodeComponentNodeElseEdgeTransitionCondition] + name: str + """Optional name for display purposes""" - destination_node_id: str - """ID of the destination node""" + speak_during_execution: bool + """If true, will speak during execution""" -class NodeComponentNodeDisplayPosition(TypedDict, total=False): +class NodeCancelTransferNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -6443,14 +7594,16 @@ class NodeComponentNodeDisplayPosition(TypedDict, total=False): y: float -class NodeComponentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeComponentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -6464,36 +7617,41 @@ class NodeComponentNodeEdgeTransitionConditionEquationConditionEquation(TypedDic """ -class NodeComponentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeComponentNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeComponentNodeEdgeTransitionConditionPromptCondition, NodeComponentNodeEdgeTransitionConditionEquationCondition +NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeComponentNodeEdge(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeComponentNodeEdgeTransitionCondition] + transition_condition: Required[NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6503,7 +7661,7 @@ class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict tool_call_id: Required[str] -class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6511,203 +7669,262 @@ class NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict tool_call_id: Required[str] -NodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeComponentNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" +class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - transcript: Required[Iterable[NodeComponentNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" - destination_node_id: str - """Optional destination node ID""" +class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + role: Required[Literal["agent", "user"]] -class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - type: Required[Literal["prompt"]] +class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + name: Required[str] -class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" + role: Required[Literal["tool_call_invocation"]] - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + tool_call_id: Required[str] - right: str - """Right side of the equation. - The right side of the equation not required when "exists" or "not_exist" are - selected. +class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. """ + go_back_conditions: Iterable[NodeCancelTransferNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. -class NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] + There would be no destination_node_id for these edges. + """ - operator: Required[Literal["||", "&&"]] + negative_finetune_examples: Iterable[NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" - type: Required[Literal["equation"]] + positive_finetune_examples: Iterable[NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" -NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] +class NodeCancelTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + type: Required[Literal["prompt"]] + """Type of instruction""" -class NodeComponentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - transition_condition: Required[NodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition] +class NodeCancelTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" - destination_node_id: str - """ID of the destination node""" + type: Required[Literal["static_text"]] + """Type of instruction""" -class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] +NodeCancelTransferNodeInstruction: TypeAlias = Union[ + NodeCancelTransferNodeInstructionNodeInstructionPrompt, NodeCancelTransferNodeInstructionNodeInstructionStaticText +] - role: Required[Literal["agent", "user"]] +class NodeCancelTransferNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" -class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + type: Required[Literal["cascading"]] + """Type of model choice""" - name: Required[str] + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" - role: Required[Literal["tool_call_invocation"]] - tool_call_id: Required[str] +class NodeCancelTransferNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + type: Required[Literal["cancel_transfer"]] + """Type of the node - cancels the warm transfer and ends the transfer agent call""" -class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + display_position: NodeCancelTransferNodeDisplayPosition + """Position for frontend display""" - role: Required[Literal["tool_call_result"]] + global_node_setting: NodeCancelTransferNodeGlobalNodeSetting - tool_call_id: Required[str] + instruction: NodeCancelTransferNodeInstruction + """Describes what to say to user when cancelling the transfer. + Only applicable when speak_during_execution is true. + """ -NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] + model_choice: NodeCancelTransferNodeModelChoice + name: str + """Optional name for display purposes""" -class NodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + speak_during_execution: bool + """If true, will speak during execution""" -class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] +Node: TypeAlias = Union[ + NodeConversationNode, + NodeSubagentNode, + NodeEndNode, + NodeFunctionNode, + NodeCodeNode, + NodeTransferCallNode, + NodePressDigitNode, + NodeBranchNode, + NodeSMSNode, + NodeExtractDynamicVariablesNode, + NodeAgentSwapNode, + NodeMcpNode, + NodeComponentNode, + NodeBridgeTransferNode, + NodeCancelTransferNode, +] - role: Required[Literal["agent", "user"]] +class BeginTagDisplayPosition(TypedDict, total=False): + """Display position for the begin tag in the frontend.""" -class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + x: float - name: Required[str] + y: float - role: Required[Literal["tool_call_invocation"]] - tool_call_id: Required[str] +class ComponentNodeConversationNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + type: Required[Literal["prompt"]] + """Type of instruction""" -class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +class ComponentNodeConversationNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" - tool_call_id: Required[str] + type: Required[Literal["static_text"]] + """Type of instruction""" -NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeConversationNodeInstruction: TypeAlias = Union[ + ComponentNodeConversationNodeInstructionNodeInstructionPrompt, + ComponentNodeConversationNodeInstructionNodeInstructionStaticText, ] -class NodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" +class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + type: Required[Literal["prompt"]] -class NodeComponentNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. - """ +class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - go_back_conditions: Iterable[NodeComponentNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - There would be no destination_node_id for these edges. + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - negative_finetune_examples: Iterable[NodeComponentNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeComponentNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" +class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] + operator: Required[Literal["||", "&&"]] -class NodeComponentNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" + type: Required[Literal["equation"]] - component_id: Required[str] - """The reference ID of the component""" + prompt: Literal["Always"] + """Must be "Always" for always edge""" - component_type: Required[Literal["local", "shared"]] - """Type of component: - - local: stored in conversation flow's components array - - shared: stored in stand-alone conversation-flow-component table - """ +class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" - else_edge: Required[NodeComponentNodeElseEdge] - """Default edge when no other conditions are met""" + type: Required[Literal["prompt"]] - type: Required[Literal["component"]] - """Type of the node""" - display_position: NodeComponentNodeDisplayPosition - """Position for frontend display""" +ComponentNodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, + ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, + ComponentNodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, +] - edges: Iterable[NodeComponentNodeEdge] - """Array of edges for conditional transitions""" - finetune_transition_examples: Iterable[NodeComponentNodeFinetuneTransitionExample] +class ComponentNodeConversationNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - global_node_setting: NodeComponentNodeGlobalNodeSetting + transition_condition: Required[ComponentNodeConversationNodeAlwaysEdgeTransitionCondition] - name: str - """Optional name for display purposes""" + destination_node_id: str + """ID of the destination node""" -class NodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeConversationNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -6715,16 +7932,14 @@ class NodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): y: float -class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeConversationNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class ComponentNodeConversationNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -6738,77 +7953,37 @@ class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionE """ -class NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] +class ComponentNodeConversationNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeConversationNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeConversationNodeEdgeTransitionConditionPromptCondition, + ComponentNodeConversationNodeEdgeTransitionConditionEquationCondition, ] -class NodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeConversationNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeConversationNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] - - -class NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6818,144 +7993,81 @@ class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUn tool_call_id: Required[str] -class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] - tool_call_id: Required[str] - - -NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] - - -class NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class NodeBridgeTransferNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" - - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. - """ - - go_back_conditions: Iterable[NodeBridgeTransferNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. - - There would be no destination_node_id for these edges. - """ - - negative_finetune_examples: Iterable[NodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - - positive_finetune_examples: Iterable[NodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" - - -class NodeBridgeTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" + tool_call_id: Required[str] -class NodeBridgeTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" +ComponentNodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, + ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, + ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +] - type: Required[Literal["static_text"]] - """Type of instruction""" +class ComponentNodeConversationNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" -NodeBridgeTransferNodeInstruction: TypeAlias = Union[ - NodeBridgeTransferNodeInstructionNodeInstructionPrompt, NodeBridgeTransferNodeInstructionNodeInstructionStaticText -] + transcript: Required[Iterable[ComponentNodeConversationNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" -class NodeBridgeTransferNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - ] - """The LLM model to use""" +class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - type: Required[Literal["cascading"]] - """Type of model choice""" + role: Required[Literal["agent", "user"]] - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" +class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class NodeBridgeTransferNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" + name: Required[str] - type: Required[Literal["bridge_transfer"]] - """Type of the node - initiates a warm transfer by bridging the call""" + role: Required[Literal["tool_call_invocation"]] - display_position: NodeBridgeTransferNodeDisplayPosition - """Position for frontend display""" + tool_call_id: Required[str] - global_node_setting: NodeBridgeTransferNodeGlobalNodeSetting - instruction: NodeBridgeTransferNodeInstruction - """Describes what to say to user when bridging the transfer. +class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - Only applicable when speak_during_execution is true. - """ + role: Required[Literal["tool_call_result"]] - model_choice: NodeBridgeTransferNodeModelChoice + tool_call_id: Required[str] - name: str - """Optional name for display purposes""" - speak_during_execution: bool - """If true, will speak during execution""" +ComponentNodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +] -class NodeCancelTransferNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class ComponentNodeConversationNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - x: float + transcript: Required[Iterable[ComponentNodeConversationNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" - y: float + destination_node_id: str + """Optional destination node ID""" -class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -6971,11 +8083,13 @@ class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionE """ -class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( +class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( TypedDict, total=False ): equations: Required[ - Iterable[NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[ + ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] ] operator: Required[Literal["||", "&&"]] @@ -6983,29 +8097,33 @@ class NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionE type: Required[Literal["equation"]] -NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeCancelTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): arguments: Required[str] name: Required[str] @@ -7015,7 +8133,9 @@ class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUn tool_call_id: Required[str] -class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7023,25 +8143,29 @@ class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUn tool_call_id: Required[str] -NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): arguments: Required[str] name: Required[str] @@ -7051,7 +8175,9 @@ class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUn tool_call_id: Required[str] -class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7059,19 +8185,19 @@ class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUn tool_call_id: Required[str] -NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeConversationNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -7081,41 +8207,20 @@ class NodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeCancelTransferNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeConversationNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeCancelTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class NodeCancelTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -NodeCancelTransferNodeInstruction: TypeAlias = Union[ - NodeCancelTransferNodeInstructionNodeInstructionPrompt, NodeCancelTransferNodeInstructionNodeInstructionStaticText -] - - -class NodeCancelTransferNodeModelChoice(TypedDict, total=False): +class ComponentNodeConversationNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -7146,60 +8251,104 @@ class NodeCancelTransferNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeCancelTransferNode(TypedDict, total=False): +class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + +class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" + + type: Required[Literal["prompt"]] + + +ComponentNodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, + ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, + ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, +] + + +class ComponentNodeConversationNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeConversationNodeSkipResponseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeConversationNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - type: Required[Literal["cancel_transfer"]] - """Type of the node - cancels the warm transfer and ends the transfer agent call""" + instruction: Required[ComponentNodeConversationNodeInstruction] + + type: Required[Literal["conversation"]] + """Type of the node""" + + always_edge: ComponentNodeConversationNodeAlwaysEdge - display_position: NodeCancelTransferNodeDisplayPosition + display_position: ComponentNodeConversationNodeDisplayPosition """Position for frontend display""" - global_node_setting: NodeCancelTransferNodeGlobalNodeSetting - - instruction: NodeCancelTransferNodeInstruction - """Describes what to say to user when cancelling the transfer. + edges: Iterable[ComponentNodeConversationNodeEdge] - Only applicable when speak_during_execution is true. - """ + finetune_conversation_examples: Iterable[ComponentNodeConversationNodeFinetuneConversationExample] - model_choice: NodeCancelTransferNodeModelChoice + finetune_transition_examples: Iterable[ComponentNodeConversationNodeFinetuneTransitionExample] - name: str - """Optional name for display purposes""" + global_node_setting: ComponentNodeConversationNodeGlobalNodeSetting - speak_during_execution: bool - """If true, will speak during execution""" + interruption_sensitivity: Optional[float] + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" -Node: TypeAlias = Union[ - NodeConversationNode, - NodeEndNode, - NodeFunctionNode, - NodeCodeNode, - NodeTransferCallNode, - NodePressDigitNode, - NodeBranchNode, - NodeSMSNode, - NodeExtractDynamicVariablesNode, - NodeAgentSwapNode, - NodeMcpNode, - NodeComponentNode, - NodeBridgeTransferNode, - NodeCancelTransferNode, -] + model_choice: ComponentNodeConversationNodeModelChoice + name: str + """Optional name for display purposes""" -class BeginTagDisplayPosition(TypedDict, total=False): - """Display position for the begin tag in the frontend.""" + responsiveness: Optional[float] - x: float + skip_response_edge: ComponentNodeConversationNodeSkipResponseEdge - y: float + voice_speed: Optional[float] -class ComponentNodeConversationNodeInstructionNodeInstructionPrompt(TypedDict, total=False): +class ComponentNodeSubagentNodeInstruction(TypedDict, total=False): text: Required[str] """The prompt text for the instruction""" @@ -7207,28 +8356,14 @@ class ComponentNodeConversationNodeInstructionNodeInstructionPrompt(TypedDict, t """Type of instruction""" -class ComponentNodeConversationNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeConversationNodeInstruction: TypeAlias = Union[ - ComponentNodeConversationNodeInstructionNodeInstructionPrompt, - ComponentNodeConversationNodeInstructionNodeInstructionStaticText, -] - - -class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7242,8 +8377,8 @@ class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditio """ -class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] @@ -7253,31 +8388,31 @@ class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationConditio """Must be "Always" for always edge""" -class ComponentNodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Always"]] """Must be "Always" for always edge""" type: Required[Literal["prompt"]] -ComponentNodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, - ComponentNodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, - ComponentNodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, +ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class ComponentNodeConversationNodeAlwaysEdge(TypedDict, total=False): +class ComponentNodeSubagentNodeAlwaysEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeConversationNodeAlwaysEdgeTransitionCondition] + transition_condition: Required[ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeConversationNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeSubagentNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -7285,14 +8420,14 @@ class ComponentNodeConversationNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodeConversationNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7306,37 +8441,37 @@ class ComponentNodeConversationNodeEdgeTransitionConditionEquationConditionEquat """ -class ComponentNodeConversationNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeConversationNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -ComponentNodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeConversationNodeEdgeTransitionConditionPromptCondition, - ComponentNodeConversationNodeEdgeTransitionConditionEquationCondition, +ComponentNodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeConversationNodeEdge(TypedDict, total=False): +class ComponentNodeSubagentNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeConversationNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeSubagentNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7346,7 +8481,7 @@ class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMem tool_call_id: Required[str] -class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7354,28 +8489,28 @@ class ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMem tool_call_id: Required[str] -ComponentNodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ - ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, - ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, - ComponentNodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +ComponentNodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeFinetuneConversationExample(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodeConversationNodeFinetuneConversationExampleTranscript]] + transcript: Required[Iterable[ComponentNodeSubagentNodeFinetuneConversationExampleTranscript]] """The example transcript to finetune how the conversation should be.""" -class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7385,7 +8520,7 @@ class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMembe tool_call_id: Required[str] -class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7393,25 +8528,25 @@ class ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMembe tool_call_id: Required[str] -ComponentNodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeFinetuneTransitionExample(TypedDict, total=False): +class ComponentNodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodeConversationNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( TypedDict, total=False ): prompt: Required[str] @@ -7420,7 +8555,7 @@ class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCon type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -7436,13 +8571,11 @@ class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCon """ -class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( TypedDict, total=False ): equations: Required[ - Iterable[ - ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] + Iterable[ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -7450,33 +8583,29 @@ class ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCon type: Required[Literal["equation"]] -ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeConversationNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7486,9 +8615,7 @@ class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTrans tool_call_id: Required[str] -class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7496,29 +8623,25 @@ class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTrans tool_call_id: Required[str] -ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7528,9 +8651,7 @@ class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTrans tool_call_id: Required[str] -class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7538,19 +8659,19 @@ class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTrans tool_call_id: Required[str] -ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeConversationNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -7560,20 +8681,20 @@ class ComponentNodeConversationNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeConversationNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeConversationNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeConversationNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeConversationNodeModelChoice(TypedDict, total=False): +class ComponentNodeSubagentNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -7604,14 +8725,14 @@ class ComponentNodeConversationNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7625,10 +8746,8 @@ class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCo """ -class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] - ] +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] @@ -7638,31 +8757,31 @@ class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCo """Must be "Skip response" for skip response edge""" -class ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Skip response"]] """Must be "Skip response" for skip response edge""" type: Required[Literal["prompt"]] -ComponentNodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, - ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, - ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, +ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeConversationNodeSkipResponseEdge(TypedDict, total=False): +class ComponentNodeSubagentNodeSkipResponseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeConversationNodeSkipResponseEdgeTransitionCondition] + transition_condition: Required[ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeConversationNodeToolEndCallTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -7697,7 +8816,7 @@ class ComponentNodeConversationNodeToolEndCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined( +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined( TypedDict, total=False ): number: Required[str] @@ -7717,7 +8836,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransf """ -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred( +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred( TypedDict, total=False ): prompt: Required[str] @@ -7732,13 +8851,13 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransf """The type of transfer destination.""" -ComponentNodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +ComponentNodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): type: Required[Literal["cold_transfer"]] """The type of the transfer.""" @@ -7766,7 +8885,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption( TypedDict, total=False ): """IVR navigation option to run when doing human detection. @@ -7780,7 +8899,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["prompt"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -7789,7 +8908,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["prompt"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -7798,13 +8917,13 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["static_message"] -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -7813,7 +8932,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["prompt"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -7822,13 +8941,13 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["static_message"] -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): type: Required[Literal["warm_transfer"]] """The type of the transfer.""" @@ -7838,7 +8957,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt enable_bridge_audio_cue: bool """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + ivr_option: ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -7854,7 +8973,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ private_handoff_option: ( - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ) """ If set, when transfer is connected, will say the handoff message only to the @@ -7863,7 +8982,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ public_handoff_option: ( - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -7885,7 +9004,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( TypedDict, total=False ): """The agent that will mediate the transfer decision.""" @@ -7902,7 +9021,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """The version of the transfer agent to use.""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( TypedDict, total=False ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -7913,7 +9032,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt Defaults to cancel_transfer. """ - transfer_agent: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + transfer_agent: ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent """The agent that will mediate the transfer decision.""" transfer_timeout_ms: float @@ -7923,7 +9042,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -7932,7 +9051,7 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["prompt"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -7941,17 +9060,17 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt type: Literal["static_message"] -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer( +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer( TypedDict, total=False ): agentic_transfer_config: Required[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ] """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -7964,7 +9083,9 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] """The music to play while the caller is being transferred.""" - public_handoff_option: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + public_handoff_option: ( + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ) """ If set, when transfer is successful, will say the handoff message to both the transferee and the agent receiving the transfer. Can leave either a static @@ -7985,14 +9106,14 @@ class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOpt """ -ComponentNodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +ComponentNodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class ComponentNodeConversationNodeToolTransferCallTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolTransferCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8000,9 +9121,9 @@ class ComponentNodeConversationNodeToolTransferCallTool(TypedDict, total=False): tools + state tools + state edges). """ - transfer_destination: Required[ComponentNodeConversationNodeToolTransferCallToolTransferDestination] + transfer_destination: Required[ComponentNodeSubagentNodeToolTransferCallToolTransferDestination] - transfer_option: Required[ComponentNodeConversationNodeToolTransferCallToolTransferOption] + transfer_option: Required[ComponentNodeSubagentNodeToolTransferCallToolTransferOption] type: Required[Literal["transfer_call"]] @@ -8041,7 +9162,7 @@ class ComponentNodeConversationNodeToolTransferCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class ComponentNodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to check @@ -8081,7 +9202,7 @@ class ComponentNodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total """ -class ComponentNodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to book @@ -8121,7 +9242,7 @@ class ComponentNodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=F """ -class ComponentNodeConversationNodeToolAgentSwapTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): agent_id: Required[str] """The id of the agent to swap to.""" @@ -8172,7 +9293,7 @@ class ComponentNodeConversationNodeToolAgentSwapTool(TypedDict, total=False): """Webhook setting for the agent swap, defaults to only source.""" -class ComponentNodeConversationNodeToolPressDigitTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolPressDigitTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8197,14 +9318,14 @@ class ComponentNodeConversationNodeToolPressDigitTool(TypedDict, total=False): """ -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): content: str """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Literal["predefined"] -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): prompt: str """The prompt to be used to help infer the SMS content. @@ -8215,13 +9336,13 @@ class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(T type: Literal["inferred"] -ComponentNodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +ComponentNodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class ComponentNodeConversationNodeToolSendSMSTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolSendSMSTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8229,7 +9350,7 @@ class ComponentNodeConversationNodeToolSendSMSTool(TypedDict, total=False): tools + state tools + state edges). """ - sms_content: Required[ComponentNodeConversationNodeToolSendSMSToolSMSContent] + sms_content: Required[ComponentNodeSubagentNodeToolSendSMSToolSMSContent] type: Required[Literal["send_sms"]] @@ -8239,8 +9360,28 @@ class ComponentNodeConversationNodeToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + -class ComponentNodeConversationNodeToolCustomToolParameters(TypedDict, total=False): +class ComponentNodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -8263,7 +9404,7 @@ class ComponentNodeConversationNodeToolCustomToolParameters(TypedDict, total=Fal """ -class ComponentNodeConversationNodeToolCustomTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolCustomTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8311,7 +9452,7 @@ class ComponentNodeConversationNodeToolCustomTool(TypedDict, total=False): method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] """Method to use for the request, default to POST.""" - parameters: ComponentNodeConversationNodeToolCustomToolParameters + parameters: ComponentNodeSubagentNodeToolCustomToolParameters """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -8354,7 +9495,7 @@ class ComponentNodeConversationNodeToolCustomTool(TypedDict, total=False): """ -class ComponentNodeConversationNodeToolCodeTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolCodeTool(TypedDict, total=False): code: Required[str] """JavaScript code to execute in the sandbox.""" @@ -8411,7 +9552,7 @@ class ComponentNodeConversationNodeToolCodeTool(TypedDict, total=False): """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8421,6 +9562,13 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringA type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -8431,7 +9579,7 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringA """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): choices: Required[SequenceNotStr[str]] """The possible values of the variable, must be non empty array.""" @@ -8444,6 +9592,13 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAna type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8451,7 +9606,7 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAna """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8461,6 +9616,13 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBoolean type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8468,7 +9630,7 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBoolean """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8478,6 +9640,13 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberA type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8485,15 +9654,15 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberA """ -ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class ComponentNodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): description: Required[str] """ Describes what the tool does, sometimes can also include information about when @@ -8510,11 +9679,11 @@ class ComponentNodeConversationNodeToolExtractDynamicVariableTool(TypedDict, tot type: Required[Literal["extract_dynamic_variable"]] - variables: Required[Iterable[ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable]] + variables: Required[Iterable[ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable]] """The variables to be extracted.""" -class ComponentNodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8551,7 +9720,7 @@ class ComponentNodeConversationNodeToolBridgeTransferTool(TypedDict, total=False """If true, will speak during execution.""" -class ComponentNodeConversationNodeToolCancelTransferTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8588,7 +9757,7 @@ class ComponentNodeConversationNodeToolCancelTransferTool(TypedDict, total=False """If true, will speak during execution.""" -class ComponentNodeConversationNodeToolMcpTool(TypedDict, total=False): +class ComponentNodeSubagentNodeToolMcpTool(TypedDict, total=False): description: Required[str] """Description of the MCP tool.""" @@ -8641,67 +9810,67 @@ class ComponentNodeConversationNodeToolMcpTool(TypedDict, total=False): """ -ComponentNodeConversationNodeTool: TypeAlias = Union[ - ComponentNodeConversationNodeToolEndCallTool, - ComponentNodeConversationNodeToolTransferCallTool, - ComponentNodeConversationNodeToolCheckAvailabilityCalTool, - ComponentNodeConversationNodeToolBookAppointmentCalTool, - ComponentNodeConversationNodeToolAgentSwapTool, - ComponentNodeConversationNodeToolPressDigitTool, - ComponentNodeConversationNodeToolSendSMSTool, - ComponentNodeConversationNodeToolCustomTool, - ComponentNodeConversationNodeToolCodeTool, - ComponentNodeConversationNodeToolExtractDynamicVariableTool, - ComponentNodeConversationNodeToolBridgeTransferTool, - ComponentNodeConversationNodeToolCancelTransferTool, - ComponentNodeConversationNodeToolMcpTool, +ComponentNodeSubagentNodeTool: TypeAlias = Union[ + ComponentNodeSubagentNodeToolEndCallTool, + ComponentNodeSubagentNodeToolTransferCallTool, + ComponentNodeSubagentNodeToolCheckAvailabilityCalTool, + ComponentNodeSubagentNodeToolBookAppointmentCalTool, + ComponentNodeSubagentNodeToolAgentSwapTool, + ComponentNodeSubagentNodeToolPressDigitTool, + ComponentNodeSubagentNodeToolSendSMSTool, + ComponentNodeSubagentNodeToolCustomTool, + ComponentNodeSubagentNodeToolCodeTool, + ComponentNodeSubagentNodeToolExtractDynamicVariableTool, + ComponentNodeSubagentNodeToolBridgeTransferTool, + ComponentNodeSubagentNodeToolCancelTransferTool, + ComponentNodeSubagentNodeToolMcpTool, ] -class ComponentNodeConversationNode(TypedDict, total=False): +class ComponentNodeSubagentNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[ComponentNodeConversationNodeInstruction] + instruction: Required[ComponentNodeSubagentNodeInstruction] - type: Required[Literal["conversation"]] + type: Required[Literal["subagent"]] """Type of the node""" - always_edge: ComponentNodeConversationNodeAlwaysEdge + always_edge: ComponentNodeSubagentNodeAlwaysEdge - display_position: ComponentNodeConversationNodeDisplayPosition + display_position: ComponentNodeSubagentNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodeConversationNodeEdge] + edges: Iterable[ComponentNodeSubagentNodeEdge] - finetune_conversation_examples: Iterable[ComponentNodeConversationNodeFinetuneConversationExample] + finetune_conversation_examples: Iterable[ComponentNodeSubagentNodeFinetuneConversationExample] - finetune_transition_examples: Iterable[ComponentNodeConversationNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[ComponentNodeSubagentNodeFinetuneTransitionExample] - global_node_setting: ComponentNodeConversationNodeGlobalNodeSetting + global_node_setting: ComponentNodeSubagentNodeGlobalNodeSetting interruption_sensitivity: Optional[float] knowledge_base_ids: Optional[SequenceNotStr[str]] """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - model_choice: ComponentNodeConversationNodeModelChoice + model_choice: ComponentNodeSubagentNodeModelChoice name: str """Optional name for display purposes""" responsiveness: Optional[float] - skip_response_edge: ComponentNodeConversationNodeSkipResponseEdge + skip_response_edge: ComponentNodeSubagentNodeSkipResponseEdge tool_ids: Optional[SequenceNotStr[str]] """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[Iterable[ComponentNodeConversationNodeTool]] - """The tools owned by this conversation node. + tools: Optional[Iterable[ComponentNodeSubagentNodeTool]] + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -11342,6 +12511,13 @@ class ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDi type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -11365,6 +12541,13 @@ class ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -11382,6 +12565,13 @@ class ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedD type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -11399,6 +12589,13 @@ class ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDi type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -13344,6 +14541,7 @@ class ComponentNodeCancelTransferNode(TypedDict, total=False): ComponentNode: TypeAlias = Union[ ComponentNodeConversationNode, + ComponentNodeSubagentNode, ComponentNodeEndNode, ComponentNodeFunctionNode, ComponentNodeCodeNode, @@ -13387,6 +14585,39 @@ class ComponentMcp(TypedDict, total=False): """ +class ComponentNoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class ComponentNoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class ComponentNote(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[ComponentNoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[ComponentNoteSize] + """Dimensions of the note on the canvas.""" + + class ComponentToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. @@ -13608,6 +14839,9 @@ class Component(TypedDict, total=False): mcps: Optional[Iterable[ComponentMcp]] """A list of MCP server configurations to use for this component""" + notes: Optional[Iterable[ComponentNote]] + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] """ID of the starting node""" @@ -13644,6 +14878,39 @@ class Mcp(TypedDict, total=False): """ +class NoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class NoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class Note(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[NoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[NoteSize] + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. diff --git a/src/retell/types/conversation_flow_response.py b/src/retell/types/conversation_flow_response.py index 707bcb34..9f66bff3 100644 --- a/src/retell/types/conversation_flow_response.py +++ b/src/retell/types/conversation_flow_response.py @@ -61,48 +61,95 @@ "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "ComponentNodeConversationNodeTool", - "ComponentNodeConversationNodeToolEndCallTool", - "ComponentNodeConversationNodeToolTransferCallTool", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestination", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "ComponentNodeConversationNodeToolTransferCallToolTransferOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolCheckAvailabilityCalTool", - "ComponentNodeConversationNodeToolBookAppointmentCalTool", - "ComponentNodeConversationNodeToolAgentSwapTool", - "ComponentNodeConversationNodeToolPressDigitTool", - "ComponentNodeConversationNodeToolSendSMSTool", - "ComponentNodeConversationNodeToolSendSMSToolSMSContent", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "ComponentNodeConversationNodeToolCustomTool", - "ComponentNodeConversationNodeToolCustomToolParameters", - "ComponentNodeConversationNodeToolCodeTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "ComponentNodeConversationNodeToolBridgeTransferTool", - "ComponentNodeConversationNodeToolCancelTransferTool", - "ComponentNodeConversationNodeToolMcpTool", + "ComponentNodeSubagentNode", + "ComponentNodeSubagentNodeInstruction", + "ComponentNodeSubagentNodeAlwaysEdge", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeDisplayPosition", + "ComponentNodeSubagentNodeEdge", + "ComponentNodeSubagentNodeEdgeTransitionCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeFinetuneConversationExample", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscript", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeFinetuneTransitionExample", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSetting", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeModelChoice", + "ComponentNodeSubagentNodeSkipResponseEdge", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeTool", + "ComponentNodeSubagentNodeToolEndCallTool", + "ComponentNodeSubagentNodeToolTransferCallTool", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestination", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolCheckAvailabilityCalTool", + "ComponentNodeSubagentNodeToolBookAppointmentCalTool", + "ComponentNodeSubagentNodeToolAgentSwapTool", + "ComponentNodeSubagentNodeToolPressDigitTool", + "ComponentNodeSubagentNodeToolSendSMSTool", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContent", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "ComponentNodeSubagentNodeToolCustomTool", + "ComponentNodeSubagentNodeToolCustomToolParameters", + "ComponentNodeSubagentNodeToolCodeTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "ComponentNodeSubagentNodeToolBridgeTransferTool", + "ComponentNodeSubagentNodeToolCancelTransferTool", + "ComponentNodeSubagentNodeToolMcpTool", "ComponentNodeEndNode", "ComponentNodeEndNodeDisplayPosition", "ComponentNodeEndNodeGlobalNodeSetting", @@ -533,6 +580,9 @@ "ComponentNodeCancelTransferNodeModelChoice", "ComponentBeginTagDisplayPosition", "ComponentMcp", + "ComponentNote", + "ComponentNoteDisplayPosition", + "ComponentNoteSize", "ComponentTool", "ComponentToolCustomTool", "ComponentToolCustomToolParameters", @@ -591,48 +641,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -1061,6 +1158,9 @@ "NodeCancelTransferNodeInstructionNodeInstructionPrompt", "NodeCancelTransferNodeInstructionNodeInstructionStaticText", "NodeCancelTransferNodeModelChoice", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -1522,713 +1622,489 @@ class ComponentNodeConversationNodeSkipResponseEdge(BaseModel): """ID of the destination node""" -class ComponentNodeConversationNodeToolEndCallTool(BaseModel): - name: str - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - - type: Literal["end_call"] - - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeConversationNode(BaseModel): + id: str + """Unique identifier for the node""" - execution_message_description: Optional[str] = None - """Describes what to say to user when ending the call. + instruction: ComponentNodeConversationNodeInstruction - Only applicable when speak_during_execution is true. - """ + type: Literal["conversation"] + """Type of the node""" - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. + always_edge: Optional[ComponentNodeConversationNodeAlwaysEdge] = None - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ + display_position: Optional[ComponentNodeConversationNodeDisplayPosition] = None + """Position for frontend display""" - speak_during_execution: Optional[bool] = None - """If true, will speak during execution.""" + edges: Optional[List[ComponentNodeConversationNodeEdge]] = None + finetune_conversation_examples: Optional[List[ComponentNodeConversationNodeFinetuneConversationExample]] = None -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): - number: str - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ + finetune_transition_examples: Optional[List[ComponentNodeConversationNodeFinetuneTransitionExample]] = None - type: Literal["predefined"] - """The type of transfer destination.""" + global_node_setting: Optional[ComponentNodeConversationNodeGlobalNodeSetting] = None - extension: Optional[str] = None - """Extension digits to dial after the main number connects. + interruption_sensitivity: Optional[float] = None - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ + knowledge_base_ids: Optional[List[str]] = None + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + api_model_choice: Optional[ComponentNodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): - prompt: str - """The prompt to be used to help infer the transfer destination. + name: Optional[str] = None + """Optional name for display purposes""" - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. - """ + responsiveness: Optional[float] = None - type: Literal["inferred"] - """The type of transfer destination.""" + skip_response_edge: Optional[ComponentNodeConversationNodeSkipResponseEdge] = None + voice_speed: Optional[float] = None -ComponentNodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, -] +class ComponentNodeSubagentNodeInstruction(BaseModel): + text: str + """The prompt text for the instruction""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): - type: Literal["cold_transfer"] - """The type of the transfer.""" + type: Literal["prompt"] + """Type of instruction""" - cold_transfer_mode: Optional[Literal["sip_refer", "sip_invite"]] = None - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. - """ + type: Literal["prompt"] - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. - If not set, falls back to the agent-level `ring_duration_ms`. - """ +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): - """IVR navigation option to run when doing human detection. + right: Optional[str] = None + """Right side of the equation. - This prompt will guide the AI on how to navigate the IVR system. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Optional[Literal["prompt"]] = None +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation] + operator: Literal["||", "&&"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["equation"] - type: Optional[Literal["prompt"]] = None + prompt: Optional[Literal["Always"]] = None + """Must be "Always" for always edge""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Always"] + """Must be "Always" for always edge""" - type: Optional[Literal["static_message"]] = None + type: Literal["prompt"] -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - - type: Optional[Literal["prompt"]] = None +class ComponentNodeSubagentNodeAlwaysEdge(BaseModel): + id: str + """Unique identifier for the edge""" + transition_condition: ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: Optional[str] = None + """ID of the destination node""" - type: Optional[Literal["static_message"]] = None +class ComponentNodeSubagentNodeDisplayPosition(BaseModel): + """Position for frontend display""" -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + x: Optional[float] = None + y: Optional[float] = None -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): - type: Literal["warm_transfer"] - """The type of the transfer.""" - agent_detection_timeout_ms: Optional[float] = None - """The time to wait before considering transfer fails.""" +class ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - enable_bridge_audio_cue: Optional[bool] = None - """Whether to play an audio cue when bridging the call. Defaults to true.""" + type: Literal["prompt"] - ivr_option: Optional[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption - ] = None - """IVR navigation option to run when doing human detection. - This prompt will guide the AI on how to navigate the IVR system. - """ +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None - """The music to play while the caller is being transferred.""" + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - opt_out_human_detection: Optional[bool] = None - """If set to true, will not perform human detection for the transfer. + right: Optional[str] = None + """Right side of the equation. - Default to false. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - private_handoff_option: Optional[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption - ] = None - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ - public_handoff_option: Optional[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption - ] = None - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation] - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ + operator: Literal["||", "&&"] - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. + type: Literal["equation"] - If not set, falls back to the agent-level `ring_duration_ms`. - """ +ComponentNodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition, +] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - BaseModel -): - """The agent that will mediate the transfer decision.""" - agent_id: str - """The agent ID of the transfer agent. +class ComponentNodeSubagentNodeEdge(BaseModel): + id: str + """Unique identifier for the edge""" - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ + transition_condition: ComponentNodeSubagentNodeEdgeTransitionCondition - agent_version: float - """The version of the transfer agent to use.""" + destination_node_id: Optional[str] = None + """ID of the destination node""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( - BaseModel -): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(BaseModel): + content: str - action_on_timeout: Optional[Literal["bridge_transfer", "cancel_transfer"]] = None - """The action to take when the transfer agent times out without making a decision. + role: Literal["agent", "user"] - Defaults to cancel_transfer. - """ - transfer_agent: Optional[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - ] = None - """The agent that will mediate the transfer decision.""" +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(BaseModel): + arguments: str - transfer_timeout_ms: Optional[float] = None - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ + name: str + role: Literal["tool_call_invocation"] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + tool_call_id: str - type: Optional[Literal["prompt"]] = None +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(BaseModel): + content: str -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" + role: Literal["tool_call_result"] - type: Optional[Literal["static_message"]] = None + tool_call_id: str -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +ComponentNodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): - agentic_transfer_config: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class ComponentNodeSubagentNodeFinetuneConversationExample(BaseModel): + id: str + """Unique identifier for the example""" - type: Literal["agentic_warm_transfer"] - """The type of the transfer.""" + transcript: List[ComponentNodeSubagentNodeFinetuneConversationExampleTranscript] + """The example transcript to finetune how the conversation should be.""" - enable_bridge_audio_cue: Optional[bool] = None - """Whether to play an audio cue when bridging the call. Defaults to true.""" - on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None - """The music to play while the caller is being transferred.""" - - public_handoff_option: Optional[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - ] = None - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. - - If not set, falls back to the agent-level `ring_duration_ms`. - """ +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str + role: Literal["agent", "user"] -ComponentNodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, -] +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str -class ComponentNodeConversationNodeToolTransferCallTool(BaseModel): name: str - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ - transfer_destination: ComponentNodeConversationNodeToolTransferCallToolTransferDestination + role: Literal["tool_call_invocation"] - transfer_option: ComponentNodeConversationNodeToolTransferCallToolTransferOption + tool_call_id: str - type: Literal["transfer_call"] - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers to be added to the call.""" +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + role: Literal["tool_call_result"] - execution_message_description: Optional[str] = None - """Describes what to say to user when transferring the call. + tool_call_id: str - Only applicable when speak_during_execution is true. - """ - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. +ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - ignore_e164_validation: Optional[bool] = None - """If true, the e.164 validation will be ignored for the from_number. +class ComponentNodeSubagentNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. - """ + transcript: List[ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" - speak_during_execution: Optional[bool] = None - """If true, will speak during execution.""" + destination_node_id: Optional[str] = None + """Optional destination node ID""" -class ComponentNodeConversationNodeToolCheckAvailabilityCalTool(BaseModel): - cal_api_key: str - """ - Cal.com Api key that have access to the cal.com event you want to check - availability for. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - event_type_id: Union[float, str] - """ - Cal.com event type id number for the cal.com event you want to check - availability for. Can be a number or a dynamic variable in the format - `{{variable_name}}` that will be resolved at runtime. - """ + type: Literal["prompt"] - name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - type: Literal["check_availability_cal"] + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + right: Optional[str] = None + """Right side of the equation. - timezone: Optional[str] = None - """ - Timezone to be used when checking availability, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class ComponentNodeConversationNodeToolBookAppointmentCalTool(BaseModel): - cal_api_key: str - """ - Cal.com Api key that have access to the cal.com event you want to book - appointment. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] - event_type_id: Union[float, str] - """Cal.com event type id number for the cal.com event you want to book appointment. + operator: Literal["||", "&&"] - Can be a number or a dynamic variable in the format `{{variable_name}}` that - will be resolved at runtime. - """ + type: Literal["equation"] - name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] - type: Literal["book_appointment_cal"] - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" - timezone: Optional[str] = None - """ - Timezone to be used when booking appointment, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ + transition_condition: ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition + destination_node_id: Optional[str] = None + """ID of the destination node""" -class ComponentNodeConversationNodeToolAgentSwapTool(BaseModel): - agent_id: str - """The id of the agent to swap to.""" - name: str - """Name of the tool. +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ + role: Literal["agent", "user"] - post_call_analysis_setting: Literal["both_agents", "only_destination_agent"] - """Post call analysis setting for the agent swap.""" - type: Literal["agent_swap"] +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str - agent_version: Optional[float] = None - """The version of the agent to swap to. + name: str - If not specified, will use the latest version. - """ + role: Literal["tool_call_invocation"] - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + tool_call_id: str - execution_message_description: Optional[str] = None - """The message for the agent to speak when executing agent swap.""" - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ + role: Literal["tool_call_result"] - keep_current_language: Optional[bool] = None - """If true, keep the current language when swapping agents. Defaults to false.""" + tool_call_id: str - keep_current_voice: Optional[bool] = None - """If true, keep the current voice when swapping agents. Defaults to false.""" - speak_during_execution: Optional[bool] = None +ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] - webhook_setting: Optional[Literal["both_agents", "only_destination_agent", "only_source_agent"]] = None - """Webhook setting for the agent swap, defaults to only source.""" +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" -class ComponentNodeConversationNodeToolPressDigitTool(BaseModel): - name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str - type: Literal["press_digit"] + role: Literal["agent", "user"] - delay_ms: Optional[int] = None - """ - Delay in milliseconds before pressing the digit, because a lot of IVR systems - speak very slowly, and a delay can make sure the agent hears the full menu. - Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). - """ - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + name: str -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): - content: Optional[str] = None - """The static message to be sent in the SMS. Can contain dynamic variables.""" + role: Literal["tool_call_invocation"] - type: Optional[Literal["predefined"]] = None + tool_call_id: str -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): - prompt: Optional[str] = None - """The prompt to be used to help infer the SMS content. +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right message to send. Can contain dynamic variables. - """ + role: Literal["tool_call_result"] - type: Optional[Literal["inferred"]] = None + tool_call_id: str -ComponentNodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeConversationNodeToolSendSMSTool(BaseModel): - name: str - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" - sms_content: ComponentNodeConversationNodeToolSendSMSToolSMSContent - type: Literal["send_sms"] +class ComponentNodeSubagentNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" - description: Optional[str] = None + cool_down: Optional[float] = None """ - Describes what the tool does, sometimes can also include information about when - to call the tool. + The same global node won't be triggered again within the next N node + transitions. """ + go_back_conditions: Optional[List[ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. -class ComponentNodeConversationNodeToolCustomToolParameters(BaseModel): - """The parameters the functions accepts, described as a JSON Schema object. - - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + There would be no destination_node_id for these edges. """ - properties: Dict[str, object] - """ - The value of properties is an object, where each key is the name of a property - and each value is a schema used to validate that property. - """ + negative_finetune_examples: Optional[List[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample]] = None + """Don't transition to this node""" - type: Literal["object"] - """Type must be "object" for a JSON Schema object.""" + positive_finetune_examples: Optional[List[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample]] = None + """Transition to this node""" - required: Optional[List[str]] = None - """List of names of required property when generating this parameter. - LLM will do its best to generate the required properties in its function - arguments. Property must exist in properties. - """ +class ComponentNodeSubagentNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + type: Literal["cascading"] + """Type of model choice""" -class ComponentNodeConversationNodeToolCustomTool(BaseModel): - name: str - """Name of the tool. + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Literal["custom"] +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - url: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + type: Literal["prompt"] - args_at_root: Optional[bool] = None - """ - If set to true, the parameters will be passed as root level JSON object instead - of nested under "args". - """ - description: Optional[str] = None - """Describes what this tool does and when to call this tool.""" +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - execution_message_description: Optional[str] = None - """The description for the sentence agent say during execution. + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] - headers: Optional[Dict[str, str]] = None - """Headers to add to the request.""" + operator: Literal["||", "&&"] - method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None - """Method to use for the request, default to POST.""" + type: Literal["equation"] - parameters: Optional[ComponentNodeConversationNodeToolCustomToolParameters] = None - """The parameters the functions accepts, described as a JSON Schema object. + prompt: Optional[Literal["Skip response"]] = None + """Must be "Skip response" for skip response edge""" - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. Omitting parameters defines a function with - an empty parameter list. - """ - query_params: Optional[Dict[str, str]] = None - """Query parameters to append to the request URL.""" +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" - response_variables: Optional[Dict[str, str]] = None - """A mapping of variable names to JSON paths in the response body. + type: Literal["prompt"] - These values will be extracted from the response and made available as dynamic - variables for use. - """ - speak_after_execution: Optional[bool] = None - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ +ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] - speak_during_execution: Optional[bool] = None - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. - """ - timeout_ms: Optional[int] = None - """The maximum time in milliseconds the tool can run before it's considered - timeout. +class ComponentNodeSubagentNodeSkipResponseEdge(BaseModel): + id: str + """Unique identifier for the edge""" - If the tool times out, the agent would have that info. The minimum value allowed - is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, - this is set to 120,000 ms (2 min). - """ + transition_condition: ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition + destination_node_id: Optional[str] = None + """ID of the destination node""" -class ComponentNodeConversationNodeToolCodeTool(BaseModel): - code: str - """JavaScript code to execute in the sandbox.""" +class ComponentNodeSubagentNodeToolEndCallTool(BaseModel): name: str """Name of the tool. Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 (no space allowed). """ - type: Literal["code"] + type: Literal["end_call"] description: Optional[str] = None - """Describes what this tool does and when to call this tool.""" + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ execution_message_description: Optional[str] = None - """The description for the sentence agent say during execution. + """Describes what to say to user when ending the call. Only applicable when speak_during_execution is true. """ @@ -2241,868 +2117,1236 @@ class ComponentNodeConversationNodeToolCodeTool(BaseModel): execution_message_description directly. Defaults to "prompt". """ - response_variables: Optional[Dict[str, str]] = None - """A mapping of variable names to JSON paths in the code execution result. + speak_during_execution: Optional[bool] = None + """If true, will speak during execution.""" - These mapped values will be extracted and added as dynamic variables. - """ - speak_after_execution: Optional[bool] = None +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): + number: str """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. """ - speak_during_execution: Optional[bool] = None - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the tool. - """ + type: Literal["predefined"] + """The type of transfer destination.""" - timeout_ms: Optional[int] = None - """The maximum time in milliseconds the code can run before it's considered - timeout. + extension: Optional[str] = None + """Extension digits to dial after the main number connects. - Defaults to 30,000 ms (30 s). + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): - description: str - """Description of the variable.""" - - name: str - """Name of the variable.""" - - type: Literal["string"] - """Type of the variable to extract.""" - - examples: Optional[List[str]] = None - """Examples of the variable value to teach model the style and syntax.""" - - required: Optional[bool] = None - """Whether this data is required. +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): + prompt: str + """The prompt to be used to help infer the transfer destination. - If true and the data is not extracted, the call will be marked as unsuccessful. + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. """ + type: Literal["inferred"] + """The type of transfer destination.""" -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): - choices: List[str] - """The possible values of the variable, must be non empty array.""" - description: str - """Description of the variable.""" +ComponentNodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +] - name: str - """Name of the variable.""" - type: Literal["enum"] - """Type of the variable to extract.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): + type: Literal["cold_transfer"] + """The type of the transfer.""" - required: Optional[bool] = None - """Whether this data is required. + cold_transfer_mode: Optional[Literal["sip_refer", "sip_invite"]] = None + """The mode of the cold transfer. - If true and the data is not extracted, the call will be marked as unsuccessful. + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. """ + show_transferee_as_caller: Optional[bool] = None + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): - description: str - """Description of the variable.""" + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. - name: str - """Name of the variable.""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - type: Literal["boolean"] - """Type of the variable to extract.""" - required: Optional[bool] = None - """Whether this data is required. +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): + """IVR navigation option to run when doing human detection. - If true and the data is not extracted, the call will be marked as unsuccessful. + This prompt will guide the AI on how to navigate the IVR system. """ + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): - description: str - """Description of the variable.""" + type: Optional[Literal["prompt"]] = None - name: str - """Name of the variable.""" - type: Literal["number"] - """Type of the variable to extract.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( + BaseModel +): + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - required: Optional[bool] = None - """Whether this data is required. + type: Optional[Literal["prompt"]] = None - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" -ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, -] + type: Optional[Literal["static_message"]] = None -class ComponentNodeConversationNodeToolExtractDynamicVariableTool(BaseModel): - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +] - name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + BaseModel +): + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Literal["extract_dynamic_variable"] + type: Optional[Literal["prompt"]] = None - variables: List[ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable] - """The variables to be extracted.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodeConversationNodeToolBridgeTransferTool(BaseModel): - name: str - """Name of the tool. + type: Optional[Literal["static_message"]] = None - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Literal["bridge_transfer"] +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - description: Optional[str] = None - """Describes what the tool does. - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it bridges the original - caller to the transfer target and ends the transfer agent call. - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): + type: Literal["warm_transfer"] + """The type of the transfer.""" - execution_message_description: Optional[str] = None - """Describes what to say to user when bridging the transfer. + agent_detection_timeout_ms: Optional[float] = None + """The time to wait before considering transfer fails.""" - Only applicable when speak_during_execution is true. - """ + enable_bridge_audio_cue: Optional[bool] = None + """Whether to play an audio cue when bridging the call. Defaults to true.""" - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. + ivr_option: Optional[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + ] = None + """IVR navigation option to run when doing human detection. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + This prompt will guide the AI on how to navigate the IVR system. """ - speak_during_execution: Optional[bool] = None - """If true, will speak during execution.""" - + on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None + """The music to play while the caller is being transferred.""" -class ComponentNodeConversationNodeToolCancelTransferTool(BaseModel): - name: str - """Name of the tool. + opt_out_human_detection: Optional[bool] = None + """If set to true, will not perform human detection for the transfer. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). + Default to false. """ - type: Literal["cancel_transfer"] - - description: Optional[str] = None - """Describes what the tool does. - - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it cancels the transfer, - returns the original caller to the main agent, and ends the transfer agent call. + private_handoff_option: Optional[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + ] = None """ - - execution_message_description: Optional[str] = None - """Describes what to say to user when cancelling the transfer. - - Only applicable when speak_during_execution is true. + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. """ - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. - - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + public_handoff_option: Optional[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + ] = None + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. """ - speak_during_execution: Optional[bool] = None - """If true, will speak during execution.""" + show_transferee_as_caller: Optional[bool] = None + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. -class ComponentNodeConversationNodeToolMcpTool(BaseModel): - description: str - """Description of the MCP tool.""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - name: str - """Name of the MCP tool.""" - type: Literal["mcp"] +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + BaseModel +): + """The agent that will mediate the transfer decision.""" - execution_message_description: Optional[str] = None - """The description for the sentence agent say during execution. + agent_id: str + """The agent ID of the transfer agent. - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). """ - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. + agent_version: float + """The version of the transfer agent to use.""" - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - input_schema: Optional[Dict[str, str]] = None - """The input schema of the MCP tool.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( + BaseModel +): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - mcp_id: Optional[str] = None - """Unique id of the MCP.""" + action_on_timeout: Optional[Literal["bridge_transfer", "cancel_transfer"]] = None + """The action to take when the transfer agent times out without making a decision. - response_variables: Optional[Dict[str, str]] = None - """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response + Defaults to cancel_transfer. """ - speak_after_execution: Optional[bool] = None - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ + transfer_agent: Optional[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + ] = None + """The agent that will mediate the transfer decision.""" - speak_during_execution: Optional[bool] = None + transfer_timeout_ms: Optional[float] = None """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). """ -ComponentNodeConversationNodeTool: TypeAlias = Union[ - ComponentNodeConversationNodeToolEndCallTool, - ComponentNodeConversationNodeToolTransferCallTool, - ComponentNodeConversationNodeToolCheckAvailabilityCalTool, - ComponentNodeConversationNodeToolBookAppointmentCalTool, - ComponentNodeConversationNodeToolAgentSwapTool, - ComponentNodeConversationNodeToolPressDigitTool, - ComponentNodeConversationNodeToolSendSMSTool, - ComponentNodeConversationNodeToolCustomTool, - ComponentNodeConversationNodeToolCodeTool, - ComponentNodeConversationNodeToolExtractDynamicVariableTool, - ComponentNodeConversationNodeToolBridgeTransferTool, - ComponentNodeConversationNodeToolCancelTransferTool, - ComponentNodeConversationNodeToolMcpTool, -] - - -class ComponentNodeConversationNode(BaseModel): - id: str - """Unique identifier for the node""" - - instruction: ComponentNodeConversationNodeInstruction - - type: Literal["conversation"] - """Type of the node""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + BaseModel +): + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - always_edge: Optional[ComponentNodeConversationNodeAlwaysEdge] = None + type: Optional[Literal["prompt"]] = None - display_position: Optional[ComponentNodeConversationNodeDisplayPosition] = None - """Position for frontend display""" - edges: Optional[List[ComponentNodeConversationNodeEdge]] = None +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" - finetune_conversation_examples: Optional[List[ComponentNodeConversationNodeFinetuneConversationExample]] = None + type: Optional[Literal["static_message"]] = None - finetune_transition_examples: Optional[List[ComponentNodeConversationNodeFinetuneTransitionExample]] = None - global_node_setting: Optional[ComponentNodeConversationNodeGlobalNodeSetting] = None +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - interruption_sensitivity: Optional[float] = None - knowledge_base_ids: Optional[List[str]] = None - """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): + agentic_transfer_config: ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - api_model_choice: Optional[ComponentNodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + type: Literal["agentic_warm_transfer"] + """The type of the transfer.""" - name: Optional[str] = None - """Optional name for display purposes""" + enable_bridge_audio_cue: Optional[bool] = None + """Whether to play an audio cue when bridging the call. Defaults to true.""" - responsiveness: Optional[float] = None + on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None + """The music to play while the caller is being transferred.""" - skip_response_edge: Optional[ComponentNodeConversationNodeSkipResponseEdge] = None + public_handoff_option: Optional[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ] = None + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - tool_ids: Optional[List[str]] = None + show_transferee_as_caller: Optional[bool] = None """ - The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. """ - tools: Optional[List[ComponentNodeConversationNodeTool]] = None - """The tools owned by this conversation node. + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. - This includes other tool types like transfer_call, agent_swap, etc. + If not set, falls back to the agent-level `ring_duration_ms`. """ - voice_speed: Optional[float] = None +ComponentNodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +] -class ComponentNodeEndNodeDisplayPosition(BaseModel): - """Position for frontend display""" - x: Optional[float] = None +class ComponentNodeSubagentNodeToolTransferCallTool(BaseModel): + name: str + """Name of the tool. - y: Optional[float] = None + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + transfer_destination: ComponentNodeSubagentNodeToolTransferCallToolTransferDestination -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" + transfer_option: ComponentNodeSubagentNodeToolTransferCallToolTransferOption - type: Literal["prompt"] + type: Literal["transfer_call"] + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + execution_message_description: Optional[str] = None + """Describes what to say to user when transferring the call. - right: Optional[str] = None - """Right side of the equation. + Only applicable when speak_during_execution is true. + """ - The right side of the equation not required when "exists" or "not_exist" are - selected. + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". """ + ignore_e164_validation: Optional[bool] = None + """If true, the e.164 validation will be ignored for the from_number. -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ - operator: Literal["||", "&&"] + speak_during_execution: Optional[bool] = None + """If true, will speak during execution.""" - type: Literal["equation"] +class ComponentNodeSubagentNodeToolCheckAvailabilityCalTool(BaseModel): + cal_api_key: str + """ + Cal.com Api key that have access to the cal.com event you want to check + availability for. + """ -ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] + event_type_id: Union[float, str] + """ + Cal.com event type id number for the cal.com event you want to check + availability for. Can be a number or a dynamic variable in the format + `{{variable_name}}` that will be resolved at runtime. + """ + name: str + """Name of the tool. -class ComponentNodeEndNodeGlobalNodeSettingGoBackCondition(BaseModel): - id: str - """Unique identifier for the edge""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - transition_condition: ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition + type: Literal["check_availability_cal"] - destination_node_id: Optional[str] = None - """ID of the destination node""" + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + timezone: Optional[str] = None + """ + Timezone to be used when checking availability, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str - role: Literal["agent", "user"] +class ComponentNodeSubagentNodeToolBookAppointmentCalTool(BaseModel): + cal_api_key: str + """ + Cal.com Api key that have access to the cal.com event you want to book + appointment. + """ + event_type_id: Union[float, str] + """Cal.com event type id number for the cal.com event you want to book appointment. -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + Can be a number or a dynamic variable in the format `{{variable_name}}` that + will be resolved at runtime. + """ name: str + """Name of the tool. - role: Literal["tool_call_invocation"] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - tool_call_id: str + type: Literal["book_appointment_cal"] + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + timezone: Optional[str] = None + """ + Timezone to be used when booking appointment, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ - role: Literal["tool_call_result"] - tool_call_id: str +class ComponentNodeSubagentNodeToolAgentSwapTool(BaseModel): + agent_id: str + """The id of the agent to swap to.""" + name: str + """Name of the tool. -ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + post_call_analysis_setting: Literal["both_agents", "only_destination_agent"] + """Post call analysis setting for the agent swap.""" -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" + type: Literal["agent_swap"] + agent_version: Optional[float] = None + """The version of the agent to swap to. -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str + If not specified, will use the latest version. + """ - role: Literal["agent", "user"] + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + execution_message_description: Optional[str] = None + """The message for the agent to speak when executing agent swap.""" -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + keep_current_language: Optional[bool] = None + """If true, keep the current language when swapping agents. Defaults to false.""" + keep_current_voice: Optional[bool] = None + """If true, keep the current voice when swapping agents. Defaults to false.""" + + speak_during_execution: Optional[bool] = None + + webhook_setting: Optional[Literal["both_agents", "only_destination_agent", "only_source_agent"]] = None + """Webhook setting for the agent swap, defaults to only source.""" + + +class ComponentNodeSubagentNodeToolPressDigitTool(BaseModel): name: str + """Name of the tool. - role: Literal["tool_call_invocation"] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - tool_call_id: str + type: Literal["press_digit"] + delay_ms: Optional[int] = None + """ + Delay in milliseconds before pressing the digit, because a lot of IVR systems + speak very slowly, and a delay can make sure the agent hears the full menu. + Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). + """ -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - role: Literal["tool_call_result"] - tool_call_id: str +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): + content: Optional[str] = None + """The static message to be sent in the SMS. Can contain dynamic variables.""" + type: Optional[Literal["predefined"]] = None -ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, + +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): + prompt: Optional[str] = None + """The prompt to be used to help infer the SMS content. + + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right message to send. Can contain dynamic variables. + """ + + type: Optional[Literal["inferred"]] = None + + +ComponentNodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" +class ComponentNodeSubagentNodeToolSendSMSTool(BaseModel): + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + sms_content: ComponentNodeSubagentNodeToolSendSMSToolSMSContent -class ComponentNodeEndNodeGlobalNodeSetting(BaseModel): - condition: str - """Condition for global node activation, cannot be empty""" + type: Literal["send_sms"] - cool_down: Optional[float] = None + description: Optional[str] = None """ - The same global node won't be triggered again within the next N node - transitions. + Describes what the tool does, sometimes can also include information about when + to call the tool. """ - go_back_conditions: Optional[List[ComponentNodeEndNodeGlobalNodeSettingGoBackCondition]] = None - """The conditions for global node go back. + execution_message_description: Optional[str] = None + """Describes what to say before sending the SMS. - There would be no destination_node_id for these edges. + Only applicable when speak_during_execution is true. """ - negative_finetune_examples: Optional[List[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample]] = None - """Don't transition to this node""" - - positive_finetune_examples: Optional[List[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample]] = None - """Transition to this node""" + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ -class ComponentNodeEndNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" + speak_during_execution: Optional[bool] = None + """If true, the agent will speak a short line before sending the SMS. - type: Literal["prompt"] - """Type of instruction""" + If omitted, defaults to true (same as end_call / transfer_call tools). + """ -class ComponentNodeEndNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" +class ComponentNodeSubagentNodeToolCustomToolParameters(BaseModel): + """The parameters the functions accepts, described as a JSON Schema object. - type: Literal["static_text"] - """Type of instruction""" + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + """ + properties: Dict[str, object] + """ + The value of properties is an object, where each key is the name of a property + and each value is a schema used to validate that property. + """ -ComponentNodeEndNodeInstruction: TypeAlias = Union[ - ComponentNodeEndNodeInstructionNodeInstructionPrompt, ComponentNodeEndNodeInstructionNodeInstructionStaticText -] + type: Literal["object"] + """Type must be "object" for a JSON Schema object.""" + required: Optional[List[str]] = None + """List of names of required property when generating this parameter. -class ComponentNodeEndNodeModelChoice(BaseModel): - model: Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - """The LLM model to use""" - - type: Literal["cascading"] - """Type of model choice""" - - high_priority: Optional[bool] = None - """Whether to use high priority pool with more dedicated resource, default false""" - + LLM will do its best to generate the required properties in its function + arguments. Property must exist in properties. + """ -class ComponentNodeEndNode(BaseModel): - id: str - """Unique identifier for the node""" - type: Literal["end"] - """Type of the node""" +class ComponentNodeSubagentNodeToolCustomTool(BaseModel): + name: str + """Name of the tool. - display_position: Optional[ComponentNodeEndNodeDisplayPosition] = None - """Position for frontend display""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - global_node_setting: Optional[ComponentNodeEndNodeGlobalNodeSetting] = None + type: Literal["custom"] - instruction: Optional[ComponentNodeEndNodeInstruction] = None - """What to say when ending the call, only used when speak during execution""" + url: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - api_model_choice: Optional[ComponentNodeEndNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + args_at_root: Optional[bool] = None + """ + If set to true, the parameters will be passed as root level JSON object instead + of nested under "args". + """ - name: Optional[str] = None - """Optional name for display purposes""" + description: Optional[str] = None + """Describes what this tool does and when to call this tool.""" - speak_during_execution: Optional[bool] = None - """If true, will speak during execution""" + execution_message_description: Optional[str] = None + """The description for the sentence agent say during execution. + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ -class ComponentNodeFunctionNodeDisplayPosition(BaseModel): - """Position for frontend display""" + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. - x: Optional[float] = None + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - y: Optional[float] = None + headers: Optional[Dict[str, str]] = None + """Headers to add to the request.""" + method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None + """Method to use for the request, default to POST.""" -class ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" + parameters: Optional[ComponentNodeSubagentNodeToolCustomToolParameters] = None + """The parameters the functions accepts, described as a JSON Schema object. - type: Literal["prompt"] + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. Omitting parameters defines a function with + an empty parameter list. + """ + query_params: Optional[Dict[str, str]] = None + """Query parameters to append to the request URL.""" -class ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" + response_variables: Optional[Dict[str, str]] = None + """A mapping of variable names to JSON paths in the response body. - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + These values will be extracted from the response and made available as dynamic + variables for use. + """ - right: Optional[str] = None - """Right side of the equation. + speak_after_execution: Optional[bool] = None + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ - The right side of the equation not required when "exists" or "not_exist" are - selected. + speak_during_execution: Optional[bool] = None + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. """ + timeout_ms: Optional[int] = None + """The maximum time in milliseconds the tool can run before it's considered + timeout. -class ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation] + If the tool times out, the agent would have that info. The minimum value allowed + is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, + this is set to 120,000 ms (2 min). + """ - operator: Literal["||", "&&"] - type: Literal["equation"] +class ComponentNodeSubagentNodeToolCodeTool(BaseModel): + code: str + """JavaScript code to execute in the sandbox.""" + name: str + """Name of the tool. -ComponentNodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition, - ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition, -] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + type: Literal["code"] -class ComponentNodeFunctionNodeEdge(BaseModel): - id: str - """Unique identifier for the edge""" + description: Optional[str] = None + """Describes what this tool does and when to call this tool.""" - transition_condition: ComponentNodeFunctionNodeEdgeTransitionCondition + execution_message_description: Optional[str] = None + """The description for the sentence agent say during execution. - destination_node_id: Optional[str] = None - """ID of the destination node""" + Only applicable when speak_during_execution is true. + """ + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. -class ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - type: Literal["prompt"] + response_variables: Optional[Dict[str, str]] = None + """A mapping of variable names to JSON paths in the code execution result. + These mapped values will be extracted and added as dynamic variables. + """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" + speak_after_execution: Optional[bool] = None + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. + """ - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + speak_during_execution: Optional[bool] = None + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the tool. + """ - right: Optional[str] = None - """Right side of the equation. + timeout_ms: Optional[int] = None + """The maximum time in milliseconds the code can run before it's considered + timeout. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Defaults to 30,000 ms (30 s). """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation] - - operator: Literal["||", "&&"] +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): + description: str + """Description of the variable.""" - type: Literal["equation"] + name: str + """Name of the variable.""" - prompt: Optional[Literal["Else"]] = None - """Must be "Else" for else edge""" + type: Literal["string"] + """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Else"] - """Must be "Else" for else edge""" + examples: Optional[List[str]] = None + """Examples of the variable value to teach model the style and syntax.""" - type: Literal["prompt"] + required: Optional[bool] = None + """Whether this data is required. + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -ComponentNodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2, -] +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): + choices: List[str] + """The possible values of the variable, must be non empty array.""" -class ComponentNodeFunctionNodeElseEdge(BaseModel): - id: str - """Unique identifier for the edge""" + description: str + """Description of the variable.""" - transition_condition: ComponentNodeFunctionNodeElseEdgeTransitionCondition + name: str + """Name of the variable.""" - destination_node_id: Optional[str] = None - """ID of the destination node""" + type: Literal["enum"] + """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): - content: str + required: Optional[bool] = None + """Whether this data is required. - role: Literal["agent", "user"] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): - arguments: str +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): + description: str + """Description of the variable.""" name: str + """Name of the variable.""" - role: Literal["tool_call_invocation"] - - tool_call_id: str + type: Literal["boolean"] + """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): - content: str + required: Optional[bool] = None + """Whether this data is required. - role: Literal["tool_call_result"] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ - tool_call_id: str +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): + description: str + """Description of the variable.""" -ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, + name: str + """Name of the variable.""" + + type: Literal["number"] + """Type of the variable to extract.""" + + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: Optional[bool] = None + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class ComponentNodeFunctionNodeFinetuneTransitionExample(BaseModel): - id: str - """Unique identifier for the example""" +class ComponentNodeSubagentNodeToolExtractDynamicVariableTool(BaseModel): + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - transcript: List[ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript] - """The example transcript to finetune how the node should transition.""" + name: str + """Name of the tool. - destination_node_id: Optional[str] = None - """Optional destination node ID""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + type: Literal["extract_dynamic_variable"] -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" + variables: List[ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable] + """The variables to be extracted.""" - type: Literal["prompt"] +class ComponentNodeSubagentNodeToolBridgeTransferTool(BaseModel): + name: str + """Name of the tool. -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + type: Literal["bridge_transfer"] - right: Optional[str] = None - """Right side of the equation. + description: Optional[str] = None + """Describes what the tool does. - The right side of the equation not required when "exists" or "not_exist" are - selected. + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it bridges the original + caller to the transfer target and ends the transfer agent call. """ + execution_message_description: Optional[str] = None + """Describes what to say to user when bridging the transfer. -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] + Only applicable when speak_during_execution is true. + """ - operator: Literal["||", "&&"] + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. - type: Literal["equation"] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + speak_during_execution: Optional[bool] = None + """If true, will speak during execution.""" -ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] +class ComponentNodeSubagentNodeToolCancelTransferTool(BaseModel): + name: str + """Name of the tool. -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition(BaseModel): - id: str - """Unique identifier for the edge""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - transition_condition: ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition + type: Literal["cancel_transfer"] - destination_node_id: Optional[str] = None - """ID of the destination node""" + description: Optional[str] = None + """Describes what the tool does. + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it cancels the transfer, + returns the original caller to the main agent, and ends the transfer agent call. + """ -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str + execution_message_description: Optional[str] = None + """Describes what to say to user when cancelling the transfer. - role: Literal["agent", "user"] + Only applicable when speak_during_execution is true. + """ + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: Optional[bool] = None + """If true, will speak during execution.""" -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + +class ComponentNodeSubagentNodeToolMcpTool(BaseModel): + description: str + """Description of the MCP tool.""" name: str + """Name of the MCP tool.""" - role: Literal["tool_call_invocation"] + type: Literal["mcp"] - tool_call_id: str + execution_message_description: Optional[str] = None + """The description for the sentence agent say during execution. + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. - role: Literal["tool_call_result"] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - tool_call_id: str + input_schema: Optional[Dict[str, str]] = None + """The input schema of the MCP tool.""" + mcp_id: Optional[str] = None + """Unique id of the MCP.""" -ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] + response_variables: Optional[Dict[str, str]] = None + """ + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response + """ + speak_after_execution: Optional[bool] = None + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" + speak_during_execution: Optional[bool] = None + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str +ComponentNodeSubagentNodeTool: TypeAlias = Union[ + ComponentNodeSubagentNodeToolEndCallTool, + ComponentNodeSubagentNodeToolTransferCallTool, + ComponentNodeSubagentNodeToolCheckAvailabilityCalTool, + ComponentNodeSubagentNodeToolBookAppointmentCalTool, + ComponentNodeSubagentNodeToolAgentSwapTool, + ComponentNodeSubagentNodeToolPressDigitTool, + ComponentNodeSubagentNodeToolSendSMSTool, + ComponentNodeSubagentNodeToolCustomTool, + ComponentNodeSubagentNodeToolCodeTool, + ComponentNodeSubagentNodeToolExtractDynamicVariableTool, + ComponentNodeSubagentNodeToolBridgeTransferTool, + ComponentNodeSubagentNodeToolCancelTransferTool, + ComponentNodeSubagentNodeToolMcpTool, +] - role: Literal["agent", "user"] +class ComponentNodeSubagentNode(BaseModel): + id: str + """Unique identifier for the node""" -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + instruction: ComponentNodeSubagentNodeInstruction - name: str + type: Literal["subagent"] + """Type of the node""" - role: Literal["tool_call_invocation"] + always_edge: Optional[ComponentNodeSubagentNodeAlwaysEdge] = None - tool_call_id: str + display_position: Optional[ComponentNodeSubagentNodeDisplayPosition] = None + """Position for frontend display""" + edges: Optional[List[ComponentNodeSubagentNodeEdge]] = None -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + finetune_conversation_examples: Optional[List[ComponentNodeSubagentNodeFinetuneConversationExample]] = None - role: Literal["tool_call_result"] + finetune_transition_examples: Optional[List[ComponentNodeSubagentNodeFinetuneTransitionExample]] = None - tool_call_id: str + global_node_setting: Optional[ComponentNodeSubagentNodeGlobalNodeSetting] = None + interruption_sensitivity: Optional[float] = None -ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] + knowledge_base_ids: Optional[List[str]] = None + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + api_model_choice: Optional[ComponentNodeSubagentNodeModelChoice] = FieldInfo(alias="model_choice", default=None) -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" + name: Optional[str] = None + """Optional name for display purposes""" + responsiveness: Optional[float] = None -class ComponentNodeFunctionNodeGlobalNodeSetting(BaseModel): - condition: str - """Condition for global node activation, cannot be empty""" + skip_response_edge: Optional[ComponentNodeSubagentNodeSkipResponseEdge] = None - cool_down: Optional[float] = None + tool_ids: Optional[List[str]] = None """ - The same global node won't be triggered again within the next N node - transitions. + The tool ids of the tools defined in main conversation flow or component that + can be used in this subagent node. """ - go_back_conditions: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition]] = None - """The conditions for global node go back. + tools: Optional[List[ComponentNodeSubagentNodeTool]] = None + """The tools owned by this subagent node. - There would be no destination_node_id for these edges. + This includes other tool types like transfer_call, agent_swap, etc. """ - negative_finetune_examples: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample]] = None - """Don't transition to this node""" + voice_speed: Optional[float] = None - positive_finetune_examples: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample]] = None - """Transition to this node""" +class ComponentNodeEndNodeDisplayPosition(BaseModel): + """Position for frontend display""" -class ComponentNodeFunctionNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" + x: Optional[float] = None - type: Literal["prompt"] - """Type of instruction""" + y: Optional[float] = None -class ComponentNodeFunctionNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - type: Literal["static_text"] - """Type of instruction""" + type: Literal["prompt"] -ComponentNodeFunctionNodeInstruction: TypeAlias = Union[ - ComponentNodeFunctionNodeInstructionNodeInstructionPrompt, - ComponentNodeFunctionNodeInstructionNodeInstructionStaticText, +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeFunctionNodeModelChoice(BaseModel): +class ComponentNodeEndNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeEndNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Optional[List[ComponentNodeEndNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Optional[List[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample]] = None + """Don't transition to this node""" + + positive_finetune_examples: Optional[List[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample]] = None + """Transition to this node""" + + +class ComponentNodeEndNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class ComponentNodeEndNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +ComponentNodeEndNodeInstruction: TypeAlias = Union[ + ComponentNodeEndNodeInstructionNodeInstructionPrompt, ComponentNodeEndNodeInstructionNodeInstructionStaticText +] + + +class ComponentNodeEndNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -3131,45 +3375,31 @@ class ComponentNodeFunctionNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeFunctionNode(BaseModel): +class ComponentNodeEndNode(BaseModel): id: str """Unique identifier for the node""" - tool_id: str - """Tool ID for function nodes""" - - tool_type: Literal["local", "shared"] - """Tool type for function nodes""" - - type: Literal["function"] + type: Literal["end"] """Type of the node""" - wait_for_result: bool - """Whether to wait for tool result""" - - display_position: Optional[ComponentNodeFunctionNodeDisplayPosition] = None + display_position: Optional[ComponentNodeEndNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[ComponentNodeFunctionNodeEdge]] = None - - else_edge: Optional[ComponentNodeFunctionNodeElseEdge] = None - - finetune_transition_examples: Optional[List[ComponentNodeFunctionNodeFinetuneTransitionExample]] = None - - global_node_setting: Optional[ComponentNodeFunctionNodeGlobalNodeSetting] = None + global_node_setting: Optional[ComponentNodeEndNodeGlobalNodeSetting] = None - instruction: Optional[ComponentNodeFunctionNodeInstruction] = None + instruction: Optional[ComponentNodeEndNodeInstruction] = None + """What to say when ending the call, only used when speak during execution""" - api_model_choice: Optional[ComponentNodeFunctionNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[ComponentNodeEndNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" speak_during_execution: Optional[bool] = None - """Whether to speak during tool execution""" + """If true, will speak during execution""" -class ComponentNodeCodeNodeDisplayPosition(BaseModel): +class ComponentNodeFunctionNodeDisplayPosition(BaseModel): """Position for frontend display""" x: Optional[float] = None @@ -3177,14 +3407,14 @@ class ComponentNodeCodeNodeDisplayPosition(BaseModel): y: Optional[float] = None -class ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -3198,38 +3428,38 @@ class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(Base """ -class ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition, - ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition, +ComponentNodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition, + ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeCodeNodeEdge(BaseModel): +class ComponentNodeFunctionNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeCodeNodeEdgeTransitionCondition + transition_condition: ComponentNodeFunctionNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -3243,8 +3473,8 @@ class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation( """ -class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] @@ -3254,37 +3484,37 @@ class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition(BaseMode """Must be "Else" for else edge""" -class ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2(BaseModel): +class ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2(BaseModel): prompt: Literal["Else"] """Must be "Else" for else edge""" type: Literal["prompt"] -ComponentNodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeCodeNodeElseEdge(BaseModel): +class ComponentNodeFunctionNodeElseEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeCodeNodeElseEdgeTransitionCondition + transition_condition: ComponentNodeFunctionNodeElseEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -3294,7 +3524,7 @@ class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseM tool_call_id: str -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -3302,32 +3532,32 @@ class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseM tool_call_id: str -ComponentNodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeCodeNodeFinetuneTransitionExample(BaseModel): +class ComponentNodeFunctionNodeFinetuneTransitionExample(BaseModel): id: str """Unique identifier for the example""" - transcript: List[ComponentNodeCodeNodeFinetuneTransitionExampleTranscript] + transcript: List[ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript] """The example transcript to finetune how the node should transition.""" destination_node_id: Optional[str] = None """Optional destination node ID""" -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -3341,37 +3571,39 @@ class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEq """ -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -3381,7 +3613,7 @@ class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUni tool_call_id: str -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -3389,25 +3621,25 @@ class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUni tool_call_id: str -ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -3417,7 +3649,7 @@ class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUni tool_call_id: str -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -3425,19 +3657,19 @@ class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUni tool_call_id: str -ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeCodeNodeGlobalNodeSetting(BaseModel): +class ComponentNodeFunctionNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -3447,20 +3679,20 @@ class ComponentNodeCodeNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample]] = None + negative_finetune_examples: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample]] = None + positive_finetune_examples: Optional[List[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class ComponentNodeCodeNodeInstructionNodeInstructionPrompt(BaseModel): +class ComponentNodeFunctionNodeInstructionNodeInstructionPrompt(BaseModel): text: str """The prompt text for the instruction""" @@ -3468,7 +3700,7 @@ class ComponentNodeCodeNodeInstructionNodeInstructionPrompt(BaseModel): """Type of instruction""" -class ComponentNodeCodeNodeInstructionNodeInstructionStaticText(BaseModel): +class ComponentNodeFunctionNodeInstructionNodeInstructionStaticText(BaseModel): text: str """The static text for the instruction""" @@ -3476,12 +3708,13 @@ class ComponentNodeCodeNodeInstructionNodeInstructionStaticText(BaseModel): """Type of instruction""" -ComponentNodeCodeNodeInstruction: TypeAlias = Union[ - ComponentNodeCodeNodeInstructionNodeInstructionPrompt, ComponentNodeCodeNodeInstructionNodeInstructionStaticText +ComponentNodeFunctionNodeInstruction: TypeAlias = Union[ + ComponentNodeFunctionNodeInstructionNodeInstructionPrompt, + ComponentNodeFunctionNodeInstructionNodeInstructionStaticText, ] -class ComponentNodeCodeNodeModelChoice(BaseModel): +class ComponentNodeFunctionNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -3510,62 +3743,60 @@ class ComponentNodeCodeNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeCodeNode(BaseModel): +class ComponentNodeFunctionNode(BaseModel): id: str """Unique identifier for the node""" - code: str - """JavaScript code to execute in the sandbox.""" + tool_id: str + """Tool ID for function nodes""" - type: Literal["code"] + tool_type: Literal["local", "shared"] + """Tool type for function nodes""" + + type: Literal["function"] """Type of the node""" wait_for_result: bool - """Whether to wait for code execution result""" + """Whether to wait for tool result""" - display_position: Optional[ComponentNodeCodeNodeDisplayPosition] = None + display_position: Optional[ComponentNodeFunctionNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[ComponentNodeCodeNodeEdge]] = None + edges: Optional[List[ComponentNodeFunctionNodeEdge]] = None - else_edge: Optional[ComponentNodeCodeNodeElseEdge] = None + else_edge: Optional[ComponentNodeFunctionNodeElseEdge] = None - finetune_transition_examples: Optional[List[ComponentNodeCodeNodeFinetuneTransitionExample]] = None + finetune_transition_examples: Optional[List[ComponentNodeFunctionNodeFinetuneTransitionExample]] = None - global_node_setting: Optional[ComponentNodeCodeNodeGlobalNodeSetting] = None + global_node_setting: Optional[ComponentNodeFunctionNodeGlobalNodeSetting] = None - instruction: Optional[ComponentNodeCodeNodeInstruction] = None + instruction: Optional[ComponentNodeFunctionNodeInstruction] = None - api_model_choice: Optional[ComponentNodeCodeNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[ComponentNodeFunctionNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" - response_variables: Optional[Dict[str, str]] = None - """A mapping of variable names to JSON paths in the code execution result. + speak_during_execution: Optional[bool] = None + """Whether to speak during tool execution""" - These mapped values will be extracted and added as dynamic variables. - """ - speak_during_execution: Optional[bool] = None - """Whether to speak during code execution""" +class ComponentNodeCodeNodeDisplayPosition(BaseModel): + """Position for frontend display""" - timeout_ms: Optional[int] = None - """The maximum time in milliseconds the code can run before it's considered - timeout. + x: Optional[float] = None - Defaults to 30,000 ms (30 s). - """ + y: Optional[float] = None -class ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -3579,348 +3810,136 @@ class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquat """ -class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Transfer failed"]] = None - """Must be "Transfer failed" for transfer failed edge""" - - -class ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" - - type: Literal["prompt"] - -ComponentNodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition, - ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition, - ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2, +ComponentNodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition, + ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeTransferCallNodeEdge(BaseModel): +class ComponentNodeCodeNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeTransferCallNodeEdgeTransitionCondition + transition_condition: ComponentNodeCodeNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined(BaseModel): - number: str - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ +class ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - type: Literal["predefined"] - """The type of transfer destination.""" + type: Literal["prompt"] - extension: Optional[str] = None - """Extension digits to dial after the main number connects. - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ +class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] -class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred(BaseModel): - prompt: str - """The prompt to be used to help infer the transfer destination. + right: Optional[str] = None + """Right side of the equation. - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - type: Literal["inferred"] - """The type of transfer destination.""" +class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation] -ComponentNodeTransferCallNodeTransferDestination: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined, - ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred, -] + operator: Literal["||", "&&"] + type: Literal["equation"] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer(BaseModel): - type: Literal["cold_transfer"] - """The type of the transfer.""" + prompt: Optional[Literal["Else"]] = None + """Must be "Else" for else edge""" - cold_transfer_mode: Optional[Literal["sip_refer", "sip_invite"]] = None - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Else"] + """Must be "Else" for else edge""" - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. - """ + type: Literal["prompt"] - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. - If not set, falls back to the agent-level `ring_duration_ms`. - """ +ComponentNodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2, +] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): - """IVR navigation option to run when doing human detection. +class ComponentNodeCodeNodeElseEdge(BaseModel): + id: str + """Unique identifier for the edge""" - This prompt will guide the AI on how to navigate the IVR system. - """ + transition_condition: ComponentNodeCodeNodeElseEdgeTransitionCondition - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: Optional[str] = None + """ID of the destination node""" - type: Optional[Literal["prompt"]] = None +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + role: Literal["agent", "user"] - type: Optional[Literal["prompt"]] = None +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" + name: str - type: Optional[Literal["static_message"]] = None + role: Literal["tool_call_invocation"] + tool_call_id: str -ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, -] +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + role: Literal["tool_call_result"] - type: Optional[Literal["prompt"]] = None - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" - - type: Optional[Literal["static_message"]] = None - - -ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(BaseModel): - type: Literal["warm_transfer"] - """The type of the transfer.""" - - agent_detection_timeout_ms: Optional[float] = None - """The time to wait before considering transfer fails.""" - - enable_bridge_audio_cue: Optional[bool] = None - """Whether to play an audio cue when bridging the call. Defaults to true.""" - - ivr_option: Optional[ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption] = None - """IVR navigation option to run when doing human detection. - - This prompt will guide the AI on how to navigate the IVR system. - """ - - on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None - """The music to play while the caller is being transferred.""" - - opt_out_human_detection: Optional[bool] = None - """If set to true, will not perform human detection for the transfer. - - Default to false. - """ - - private_handoff_option: Optional[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption - ] = None - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ - - public_handoff_option: Optional[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption - ] = None - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. - - If not set, falls back to the agent-level `ring_duration_ms`. - """ - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - BaseModel -): - """The agent that will mediate the transfer decision.""" - - agent_id: str - """The agent ID of the transfer agent. - - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ - - agent_version: float - """The version of the transfer agent to use.""" - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig(BaseModel): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - - action_on_timeout: Optional[Literal["bridge_transfer", "cancel_transfer"]] = None - """The action to take when the transfer agent times out without making a decision. - - Defaults to cancel_transfer. - """ - - transfer_agent: Optional[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - ] = None - """The agent that will mediate the transfer decision.""" - - transfer_timeout_ms: Optional[float] = None - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - BaseModel -): - prompt: Optional[str] = None - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - - type: Optional[Literal["prompt"]] = None - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - BaseModel -): - message: Optional[str] = None - """The static message to be used for warm handoff. Can contain dynamic variables.""" - - type: Optional[Literal["static_message"]] = None - - -ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] - - -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): - agentic_transfer_config: ( - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - ) - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - - type: Literal["agentic_warm_transfer"] - """The type of the transfer.""" - - enable_bridge_audio_cue: Optional[bool] = None - """Whether to play an audio cue when bridging the call. Defaults to true.""" - - on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None - """The music to play while the caller is being transferred.""" - - public_handoff_option: Optional[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - ] = None - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - - show_transferee_as_caller: Optional[bool] = None - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - - transfer_ring_duration_ms: Optional[int] = None - """Override the ring duration for this specific transfer, in milliseconds. - - If not set, falls back to the agent-level `ring_duration_ms`. - """ + tool_call_id: str -ComponentNodeTransferCallNodeTransferOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, +ComponentNodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeTransferCallNodeDisplayPosition(BaseModel): - """Position for frontend display""" +class ComponentNodeCodeNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" - x: Optional[float] = None + transcript: List[ComponentNodeCodeNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" - y: Optional[float] = None + destination_node_id: Optional[str] = None + """Optional destination node ID""" -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - BaseModel -): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -3934,39 +3953,37 @@ class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCon """ -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -3976,7 +3993,7 @@ class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTrans tool_call_id: str -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -3984,25 +4001,25 @@ class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTrans tool_call_id: str -ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -4012,7 +4029,7 @@ class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTrans tool_call_id: str -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -4020,19 +4037,19 @@ class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTrans tool_call_id: str -ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeTransferCallNodeGlobalNodeSetting(BaseModel): +class ComponentNodeCodeNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -4042,24 +4059,20 @@ class ComponentNodeTransferCallNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[ - List[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] - ] = None + negative_finetune_examples: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[ - List[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] - ] = None + positive_finetune_examples: Optional[List[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(BaseModel): +class ComponentNodeCodeNodeInstructionNodeInstructionPrompt(BaseModel): text: str """The prompt text for the instruction""" @@ -4067,7 +4080,7 @@ class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(BaseModel): """Type of instruction""" -class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(BaseModel): +class ComponentNodeCodeNodeInstructionNodeInstructionStaticText(BaseModel): text: str """The static text for the instruction""" @@ -4075,13 +4088,12 @@ class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(BaseMode """Type of instruction""" -ComponentNodeTransferCallNodeInstruction: TypeAlias = Union[ - ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt, - ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText, +ComponentNodeCodeNodeInstruction: TypeAlias = Union[ + ComponentNodeCodeNodeInstructionNodeInstructionPrompt, ComponentNodeCodeNodeInstructionNodeInstructionStaticText ] -class ComponentNodeTransferCallNodeModelChoice(BaseModel): +class ComponentNodeCodeNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -4110,71 +4122,62 @@ class ComponentNodeTransferCallNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeTransferCallNode(BaseModel): +class ComponentNodeCodeNode(BaseModel): id: str """Unique identifier for the node""" - edge: ComponentNodeTransferCallNodeEdge - - transfer_destination: ComponentNodeTransferCallNodeTransferDestination - - transfer_option: ComponentNodeTransferCallNodeTransferOption + code: str + """JavaScript code to execute in the sandbox.""" - type: Literal["transfer_call"] + type: Literal["code"] """Type of the node""" - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers for transfer calls""" + wait_for_result: bool + """Whether to wait for code execution result""" - display_position: Optional[ComponentNodeTransferCallNodeDisplayPosition] = None + display_position: Optional[ComponentNodeCodeNodeDisplayPosition] = None """Position for frontend display""" - global_node_setting: Optional[ComponentNodeTransferCallNodeGlobalNodeSetting] = None + edges: Optional[List[ComponentNodeCodeNodeEdge]] = None - ignore_e164_validation: Optional[bool] = None - """If true, the e.164 validation will be ignored for the from_number. + else_edge: Optional[ComponentNodeCodeNodeElseEdge] = None - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. - """ + finetune_transition_examples: Optional[List[ComponentNodeCodeNodeFinetuneTransitionExample]] = None - instruction: Optional[ComponentNodeTransferCallNodeInstruction] = None - """What to say when transferring the call, only used when speak during execution""" + global_node_setting: Optional[ComponentNodeCodeNodeGlobalNodeSetting] = None - api_model_choice: Optional[ComponentNodeTransferCallNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + instruction: Optional[ComponentNodeCodeNodeInstruction] = None + + api_model_choice: Optional[ComponentNodeCodeNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" - speak_during_execution: Optional[bool] = None - """If true, will speak during execution""" - - -class ComponentNodePressDigitNodeInstruction(BaseModel): - text: str - """The prompt text for the instruction""" - - type: Literal["prompt"] - """Type of instruction""" + response_variables: Optional[Dict[str, str]] = None + """A mapping of variable names to JSON paths in the code execution result. + These mapped values will be extracted and added as dynamic variables. + """ -class ComponentNodePressDigitNodeDisplayPosition(BaseModel): - """Position for frontend display""" + speak_during_execution: Optional[bool] = None + """Whether to speak during code execution""" - x: Optional[float] = None + timeout_ms: Optional[int] = None + """The maximum time in milliseconds the code can run before it's considered + timeout. - y: Optional[float] = None + Defaults to 30,000 ms (30 s). + """ -class ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -4188,284 +4191,348 @@ class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquatio """ -class ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] + prompt: Optional[Literal["Transfer failed"]] = None + """Must be "Transfer failed" for transfer failed edge""" -ComponentNodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition, - ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition, + +class ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" + + type: Literal["prompt"] + + +ComponentNodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition, + ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition, + ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2, ] -class ComponentNodePressDigitNodeEdge(BaseModel): +class ComponentNodeTransferCallNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodePressDigitNodeEdgeTransitionCondition + transition_condition: ComponentNodeTransferCallNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): - content: str +class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined(BaseModel): + number: str + """ + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. + """ - role: Literal["agent", "user"] + type: Literal["predefined"] + """The type of transfer destination.""" + extension: Optional[str] = None + """Extension digits to dial after the main number connects. -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): - arguments: str + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. + """ - name: str - role: Literal["tool_call_invocation"] +class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred(BaseModel): + prompt: str + """The prompt to be used to help infer the transfer destination. - tool_call_id: str + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. + """ + type: Literal["inferred"] + """The type of transfer destination.""" -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): - content: str - role: Literal["tool_call_result"] +ComponentNodeTransferCallNodeTransferDestination: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined, + ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred, +] - tool_call_id: str +class ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer(BaseModel): + type: Literal["cold_transfer"] + """The type of the transfer.""" -ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, -] + cold_transfer_mode: Optional[Literal["sip_refer", "sip_invite"]] = None + """The mode of the cold transfer. + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. + """ -class ComponentNodePressDigitNodeFinetuneTransitionExample(BaseModel): - id: str - """Unique identifier for the example""" + show_transferee_as_caller: Optional[bool] = None + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ - transcript: List[ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript] - """The example transcript to finetune how the node should transition.""" + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. - destination_node_id: Optional[str] = None - """Optional destination node ID""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): + """IVR navigation option to run when doing human detection. - type: Literal["prompt"] + This prompt will guide the AI on how to navigate the IVR system. + """ + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + type: Optional[Literal["prompt"]] = None + + +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( BaseModel ): - left: str - """Left side of the equation""" + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + type: Optional[Literal["prompt"]] = None - right: Optional[str] = None - """Right side of the equation. - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" + type: Optional[Literal["static_message"]] = None -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] - operator: Literal["||", "&&"] +ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +] - type: Literal["equation"] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + BaseModel +): + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] + type: Optional[Literal["prompt"]] = None -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition(BaseModel): - id: str - """Unique identifier for the edge""" +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" - transition_condition: ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition + type: Optional[Literal["static_message"]] = None - destination_node_id: Optional[str] = None - """ID of the destination node""" +ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str - role: Literal["agent", "user"] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(BaseModel): + type: Literal["warm_transfer"] + """The type of the transfer.""" + agent_detection_timeout_ms: Optional[float] = None + """The time to wait before considering transfer fails.""" -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + enable_bridge_audio_cue: Optional[bool] = None + """Whether to play an audio cue when bridging the call. Defaults to true.""" - name: str - - role: Literal["tool_call_invocation"] - - tool_call_id: str + ivr_option: Optional[ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption] = None + """IVR navigation option to run when doing human detection. + This prompt will guide the AI on how to navigate the IVR system. + """ -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None + """The music to play while the caller is being transferred.""" - role: Literal["tool_call_result"] + opt_out_human_detection: Optional[bool] = None + """If set to true, will not perform human detection for the transfer. - tool_call_id: str + Default to false. + """ + private_handoff_option: Optional[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption + ] = None + """ + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. + """ -ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] + public_handoff_option: Optional[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption + ] = None + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ + show_transferee_as_caller: Optional[bool] = None + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. + If not set, falls back to the agent-level `ring_duration_ms`. + """ -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str - role: Literal["agent", "user"] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + BaseModel +): + """The agent that will mediate the transfer decision.""" + agent_id: str + """The agent ID of the transfer agent. -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). + """ - name: str + agent_version: float + """The version of the transfer agent to use.""" - role: Literal["tool_call_invocation"] - tool_call_id: str +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig(BaseModel): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" + action_on_timeout: Optional[Literal["bridge_transfer", "cancel_transfer"]] = None + """The action to take when the transfer agent times out without making a decision. -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str + Defaults to cancel_transfer. + """ - role: Literal["tool_call_result"] + transfer_agent: Optional[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + ] = None + """The agent that will mediate the transfer decision.""" - tool_call_id: str + transfer_timeout_ms: Optional[float] = None + """ + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). + """ -ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + BaseModel +): + prompt: Optional[str] = None + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Optional[Literal["prompt"]] = None -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + BaseModel +): + message: Optional[str] = None + """The static message to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodePressDigitNodeGlobalNodeSetting(BaseModel): - condition: str - """Condition for global node activation, cannot be empty""" + type: Optional[Literal["static_message"]] = None - cool_down: Optional[float] = None - """ - The same global node won't be triggered again within the next N node - transitions. - """ - go_back_conditions: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition]] = None - """The conditions for global node go back. +ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - There would be no destination_node_id for these edges. - """ - negative_finetune_examples: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample]] = ( - None +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): + agentic_transfer_config: ( + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ) - """Don't transition to this node""" + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - positive_finetune_examples: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample]] = ( - None - ) - """Transition to this node""" + type: Literal["agentic_warm_transfer"] + """The type of the transfer.""" + enable_bridge_audio_cue: Optional[bool] = None + """Whether to play an audio cue when bridging the call. Defaults to true.""" -class ComponentNodePressDigitNodeModelChoice(BaseModel): - model: Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - """The LLM model to use""" + on_hold_music: Optional[Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"]] = None + """The music to play while the caller is being transferred.""" - type: Literal["cascading"] - """Type of model choice""" + public_handoff_option: Optional[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ] = None + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - high_priority: Optional[bool] = None - """Whether to use high priority pool with more dedicated resource, default false""" + show_transferee_as_caller: Optional[bool] = None + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ + transfer_ring_duration_ms: Optional[int] = None + """Override the ring duration for this specific transfer, in milliseconds. -class ComponentNodePressDigitNode(BaseModel): - id: str - """Unique identifier for the node""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - instruction: ComponentNodePressDigitNodeInstruction - type: Literal["press_digit"] - """Type of the node""" +ComponentNodeTransferCallNodeTransferOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, +] - delay_ms: Optional[int] = None - """Delay in milliseconds before pressing the digit""" - display_position: Optional[ComponentNodePressDigitNodeDisplayPosition] = None +class ComponentNodeTransferCallNodeDisplayPosition(BaseModel): """Position for frontend display""" - edges: Optional[List[ComponentNodePressDigitNodeEdge]] = None - - finetune_transition_examples: Optional[List[ComponentNodePressDigitNodeFinetuneTransitionExample]] = None - - global_node_setting: Optional[ComponentNodePressDigitNodeGlobalNodeSetting] = None - - api_model_choice: Optional[ComponentNodePressDigitNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + x: Optional[float] = None - name: Optional[str] = None - """Optional name for display purposes""" + y: Optional[float] = None -class ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + BaseModel +): left: str """Left side of the equation""" @@ -4479,189 +4546,40 @@ class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquatio """ -class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Else"]] = None - """Must be "Else" for else edge""" - - -class ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Else"] - """Must be "Else" for else edge""" - - type: Literal["prompt"] - -ComponentNodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeBranchNodeElseEdge(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeBranchNodeElseEdgeTransitionCondition + transition_condition: ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeBranchNodeDisplayPosition(BaseModel): - """Position for frontend display""" +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str - x: Optional[float] = None + role: Literal["agent", "user"] - y: Optional[float] = None - -class ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - - right: Optional[str] = None - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation] - - operator: Literal["||", "&&"] - - type: Literal["equation"] - - -ComponentNodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition, - ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition, -] - - -class ComponentNodeBranchNodeEdge(BaseModel): - id: str - """Unique identifier for the edge""" - - transition_condition: ComponentNodeBranchNodeEdgeTransitionCondition - - destination_node_id: Optional[str] = None - """ID of the destination node""" - - -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): - content: str - - role: Literal["agent", "user"] - - -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): - arguments: str - - name: str - - role: Literal["tool_call_invocation"] - - tool_call_id: str - - -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): - content: str - - role: Literal["tool_call_result"] - - tool_call_id: str - - -ComponentNodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, -] - - -class ComponentNodeBranchNodeFinetuneTransitionExample(BaseModel): - id: str - """Unique identifier for the example""" - - transcript: List[ComponentNodeBranchNodeFinetuneTransitionExampleTranscript] - """The example transcript to finetune how the node should transition.""" - - destination_node_id: Optional[str] = None - """Optional destination node ID""" - - -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - - right: Optional[str] = None - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - - operator: Literal["||", "&&"] - - type: Literal["equation"] - - -ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] - - -class ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition(BaseModel): - id: str - """Unique identifier for the edge""" - - transition_condition: ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition - - destination_node_id: Optional[str] = None - """ID of the destination node""" - - -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str - - role: Literal["agent", "user"] - - -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str name: str @@ -4670,7 +4588,7 @@ class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptU tool_call_id: str -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -4678,25 +4596,25 @@ class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptU tool_call_id: str -ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -4706,7 +4624,7 @@ class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptU tool_call_id: str -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -4714,19 +4632,19 @@ class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptU tool_call_id: str -ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeBranchNodeGlobalNodeSetting(BaseModel): +class ComponentNodeTransferCallNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -4736,20 +4654,46 @@ class ComponentNodeBranchNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample]] = None + negative_finetune_examples: Optional[ + List[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] + ] = None """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample]] = None + positive_finetune_examples: Optional[ + List[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] + ] = None """Transition to this node""" -class ComponentNodeBranchNodeModelChoice(BaseModel): +class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +ComponentNodeTransferCallNodeInstruction: TypeAlias = Union[ + ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt, + ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeTransferCallNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -4778,42 +4722,75 @@ class ComponentNodeBranchNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeBranchNode(BaseModel): +class ComponentNodeTransferCallNode(BaseModel): id: str """Unique identifier for the node""" - else_edge: ComponentNodeBranchNodeElseEdge + edge: ComponentNodeTransferCallNodeEdge - type: Literal["branch"] + transfer_destination: ComponentNodeTransferCallNodeTransferDestination + + transfer_option: ComponentNodeTransferCallNodeTransferOption + + type: Literal["transfer_call"] """Type of the node""" - display_position: Optional[ComponentNodeBranchNodeDisplayPosition] = None + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers for transfer calls""" + + display_position: Optional[ComponentNodeTransferCallNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[ComponentNodeBranchNodeEdge]] = None + global_node_setting: Optional[ComponentNodeTransferCallNodeGlobalNodeSetting] = None - finetune_transition_examples: Optional[List[ComponentNodeBranchNodeFinetuneTransitionExample]] = None + ignore_e164_validation: Optional[bool] = None + """If true, the e.164 validation will be ignored for the from_number. - global_node_setting: Optional[ComponentNodeBranchNodeGlobalNodeSetting] = None + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ - api_model_choice: Optional[ComponentNodeBranchNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + instruction: Optional[ComponentNodeTransferCallNodeInstruction] = None + """What to say when transferring the call, only used when speak during execution""" + + api_model_choice: Optional[ComponentNodeTransferCallNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" + speak_during_execution: Optional[bool] = None + """If true, will speak during execution""" + -class ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" +class ComponentNodePressDigitNodeInstruction(BaseModel): + text: str + """The prompt text for the instruction""" type: Literal["prompt"] + """Type of instruction""" -class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" +class ComponentNodePressDigitNodeDisplayPosition(BaseModel): + """Position for frontend display""" - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] right: Optional[str] = None """Right side of the equation. @@ -4823,134 +4800,82 @@ class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation """ -class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation] +class ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Failed to send"]] = None - """Must be "failed to send" for SMS failed edge""" - - -class ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Failed to send"] - """Must be "failed to send" for SMS failed edge""" - - type: Literal["prompt"] - -ComponentNodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition, - ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition, - ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2, +ComponentNodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition, + ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeSMSNodeFailedEdge(BaseModel): +class ComponentNodePressDigitNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeSMSNodeFailedEdgeTransitionCondition + transition_condition: ComponentNodePressDigitNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeSMSNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" - - type: Literal["prompt"] - """Type of instruction""" - - -class ComponentNodeSMSNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" - - type: Literal["static_text"] - """Type of instruction""" - - -ComponentNodeSMSNodeInstruction: TypeAlias = Union[ - ComponentNodeSMSNodeInstructionNodeInstructionPrompt, ComponentNodeSMSNodeInstructionNodeInstructionStaticText -] - - -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str - right: Optional[str] = None - """Right side of the equation. + role: Literal["agent", "user"] - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation] + name: str - operator: Literal["||", "&&"] + role: Literal["tool_call_invocation"] - type: Literal["equation"] + tool_call_id: str - prompt: Optional[Literal["Sent successfully"]] = None - """Must be "sent successfully" for SMS success edge""" +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Sent successfully"] - """Must be "sent successfully" for SMS success edge""" + role: Literal["tool_call_result"] - type: Literal["prompt"] + tool_call_id: str -ComponentNodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, - ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, - ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, +ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeSuccessEdge(BaseModel): +class ComponentNodePressDigitNodeFinetuneTransitionExample(BaseModel): id: str - """Unique identifier for the edge""" + """Unique identifier for the example""" - transition_condition: ComponentNodeSMSNodeSuccessEdgeTransitionCondition + transcript: List[ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" destination_node_id: Optional[str] = None - """ID of the destination node""" - - -class ComponentNodeSMSNodeDisplayPosition(BaseModel): - """Position for frontend display""" - - x: Optional[float] = None - - y: Optional[float] = None + """Optional destination node ID""" -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + BaseModel +): left: str """Left side of the equation""" @@ -4964,37 +4889,39 @@ class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5004,7 +4931,7 @@ class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5012,25 +4939,25 @@ class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5040,7 +4967,7 @@ class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5048,19 +4975,19 @@ class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeSMSNodeGlobalNodeSetting(BaseModel): +class ComponentNodePressDigitNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -5070,20 +4997,24 @@ class ComponentNodeSMSNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample]] = None + negative_finetune_examples: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample]] = ( + None + ) """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample]] = None + positive_finetune_examples: Optional[List[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample]] = ( + None + ) """Transition to this node""" -class ComponentNodeSMSNodeModelChoice(BaseModel): +class ComponentNodePressDigitNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -5112,113 +5043,90 @@ class ComponentNodeSMSNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeSMSNode(BaseModel): +class ComponentNodePressDigitNode(BaseModel): id: str """Unique identifier for the node""" - failed_edge: ComponentNodeSMSNodeFailedEdge - - instruction: ComponentNodeSMSNodeInstruction - - success_edge: ComponentNodeSMSNodeSuccessEdge + instruction: ComponentNodePressDigitNodeInstruction - type: Literal["sms"] + type: Literal["press_digit"] """Type of the node""" - display_position: Optional[ComponentNodeSMSNodeDisplayPosition] = None + delay_ms: Optional[int] = None + """Delay in milliseconds before pressing the digit""" + + display_position: Optional[ComponentNodePressDigitNodeDisplayPosition] = None """Position for frontend display""" - global_node_setting: Optional[ComponentNodeSMSNodeGlobalNodeSetting] = None + edges: Optional[List[ComponentNodePressDigitNodeEdge]] = None - api_model_choice: Optional[ComponentNodeSMSNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + finetune_transition_examples: Optional[List[ComponentNodePressDigitNodeFinetuneTransitionExample]] = None + + global_node_setting: Optional[ComponentNodePressDigitNodeGlobalNodeSetting] = None + + api_model_choice: Optional[ComponentNodePressDigitNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" -class ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData(BaseModel): - description: str - """Description of the variable.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - name: str - """Name of the variable.""" + type: Literal["prompt"] - type: Literal["string"] - """Type of the variable to extract.""" - examples: Optional[List[str]] = None - """Examples of the variable value to teach model the style and syntax.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - required: Optional[bool] = None - """Whether this data is required. + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - If true and the data is not extracted, the call will be marked as unsuccessful. + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData(BaseModel): - choices: List[str] - """The possible values of the variable, must be non empty array.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation] - description: str - """Description of the variable.""" + operator: Literal["||", "&&"] - name: str - """Name of the variable.""" - - type: Literal["enum"] - """Type of the variable to extract.""" - - required: Optional[bool] = None - """Whether this data is required. - - If true and the data is not extracted, the call will be marked as unsuccessful. - """ - - -class ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(BaseModel): - description: str - """Description of the variable.""" - - name: str - """Name of the variable.""" - - type: Literal["boolean"] - """Type of the variable to extract.""" + type: Literal["equation"] - required: Optional[bool] = None - """Whether this data is required. + prompt: Optional[Literal["Else"]] = None + """Must be "Else" for else edge""" - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Else"] + """Must be "Else" for else edge""" -class ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData(BaseModel): - description: str - """Description of the variable.""" + type: Literal["prompt"] - name: str - """Name of the variable.""" - type: Literal["number"] - """Type of the variable to extract.""" +ComponentNodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2, +] - required: Optional[bool] = None - """Whether this data is required. - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeBranchNodeElseEdge(BaseModel): + id: str + """Unique identifier for the edge""" + transition_condition: ComponentNodeBranchNodeElseEdgeTransitionCondition -ComponentNodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData, -] + destination_node_id: Optional[str] = None + """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(BaseModel): +class ComponentNodeBranchNodeDisplayPosition(BaseModel): """Position for frontend display""" x: Optional[float] = None @@ -5226,59 +5134,14 @@ class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(BaseModel): y: Optional[float] = None -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - - right: Optional[str] = None - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation] - - operator: Literal["||", "&&"] - - type: Literal["equation"] - - -ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, -] - - -class ComponentNodeExtractDynamicVariablesNodeEdge(BaseModel): - id: str - """Unique identifier for the edge""" - - transition_condition: ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition - - destination_node_id: Optional[str] = None - """ID of the destination node""" - - -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5292,48 +5155,37 @@ class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquatio """ -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Else"]] = None - """Must be "Else" for else edge""" - - -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Else"] - """Must be "Else" for else edge""" - - type: Literal["prompt"] - -ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition, + ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeExtractDynamicVariablesNodeElseEdge(BaseModel): +class ComponentNodeBranchNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition + transition_condition: ComponentNodeBranchNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5343,7 +5195,7 @@ class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscrip tool_call_id: str -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5351,36 +5203,32 @@ class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscrip tool_call_id: str -ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample(BaseModel): +class ComponentNodeBranchNodeFinetuneTransitionExample(BaseModel): id: str """Unique identifier for the example""" - transcript: List[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript] + transcript: List[ComponentNodeBranchNodeFinetuneTransitionExampleTranscript] """The example transcript to finetune how the node should transition.""" destination_node_id: Optional[str] = None """Optional destination node ID""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - BaseModel -): +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - BaseModel -): +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5394,41 +5242,37 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTr """ -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - BaseModel -): - equations: List[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5438,7 +5282,7 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneE tool_call_id: str -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5446,25 +5290,25 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneE tool_call_id: str -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5474,7 +5318,7 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneE tool_call_id: str -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5482,19 +5326,19 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneE tool_call_id: str -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(BaseModel): +class ComponentNodeBranchNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -5504,24 +5348,20 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[ - List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample] - ] = None + negative_finetune_examples: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[ - List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample] - ] = None + positive_finetune_examples: Optional[List[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class ComponentNodeExtractDynamicVariablesNodeModelChoice(BaseModel): +class ComponentNodeBranchNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -5550,44 +5390,38 @@ class ComponentNodeExtractDynamicVariablesNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeExtractDynamicVariablesNode(BaseModel): +class ComponentNodeBranchNode(BaseModel): id: str """Unique identifier for the node""" - type: Literal["extract_dynamic_variables"] - """Type of the node""" + else_edge: ComponentNodeBranchNodeElseEdge - variables: List[ComponentNodeExtractDynamicVariablesNodeVariable] + type: Literal["branch"] + """Type of the node""" - display_position: Optional[ComponentNodeExtractDynamicVariablesNodeDisplayPosition] = None + display_position: Optional[ComponentNodeBranchNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[ComponentNodeExtractDynamicVariablesNodeEdge]] = None - - else_edge: Optional[ComponentNodeExtractDynamicVariablesNodeElseEdge] = None + edges: Optional[List[ComponentNodeBranchNodeEdge]] = None - finetune_transition_examples: Optional[List[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample]] = ( - None - ) + finetune_transition_examples: Optional[List[ComponentNodeBranchNodeFinetuneTransitionExample]] = None - global_node_setting: Optional[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting] = None + global_node_setting: Optional[ComponentNodeBranchNodeGlobalNodeSetting] = None - api_model_choice: Optional[ComponentNodeExtractDynamicVariablesNodeModelChoice] = FieldInfo( - alias="model_choice", default=None - ) + api_model_choice: Optional[ComponentNodeBranchNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" -class ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5601,44 +5435,119 @@ class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation """ -class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Transfer failed"]] = None - """Must be "Transfer failed" for transfer failed edge""" + prompt: Optional[Literal["Failed to send"]] = None + """Must be "failed to send" for SMS failed edge""" -class ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" +class ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Failed to send"] + """Must be "failed to send" for SMS failed edge""" type: Literal["prompt"] -ComponentNodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition, - ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition, - ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2, +ComponentNodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition, + ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition, + ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2, ] -class ComponentNodeAgentSwapNodeEdge(BaseModel): - """Edge to transition to if agent swap fails""" +class ComponentNodeSMSNodeFailedEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeSMSNodeFailedEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeSMSNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class ComponentNodeSMSNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +ComponentNodeSMSNodeInstruction: TypeAlias = Union[ + ComponentNodeSMSNodeInstructionNodeInstructionPrompt, ComponentNodeSMSNodeInstructionNodeInstructionStaticText +] + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + prompt: Optional[Literal["Sent successfully"]] = None + """Must be "sent successfully" for SMS success edge""" + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Sent successfully"] + """Must be "sent successfully" for SMS success edge""" + + type: Literal["prompt"] + + +ComponentNodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, + ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, + ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, +] + +class ComponentNodeSMSNodeSuccessEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeAgentSwapNodeEdgeTransitionCondition + transition_condition: ComponentNodeSMSNodeSuccessEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeAgentSwapNodeDisplayPosition(BaseModel): +class ComponentNodeSMSNodeDisplayPosition(BaseModel): """Position for frontend display""" x: Optional[float] = None @@ -5646,14 +5555,14 @@ class ComponentNodeAgentSwapNodeDisplayPosition(BaseModel): y: Optional[float] = None -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5667,39 +5576,37 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondit """ -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5709,7 +5616,7 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: str -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5717,25 +5624,25 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: str -ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -5745,7 +5652,7 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: str -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -5753,19 +5660,19 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: str -ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeAgentSwapNodeGlobalNodeSetting(BaseModel): +class ComponentNodeSMSNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -5775,46 +5682,20 @@ class ComponentNodeAgentSwapNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample]] = ( - None - ) + negative_finetune_examples: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample]] = ( - None - ) + positive_finetune_examples: Optional[List[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" - - type: Literal["prompt"] - """Type of instruction""" - - -class ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" - - type: Literal["static_text"] - """Type of instruction""" - - -ComponentNodeAgentSwapNodeInstruction: TypeAlias = Union[ - ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt, - ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText, -] - - -class ComponentNodeAgentSwapNodeModelChoice(BaseModel): +class ComponentNodeSMSNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -5843,70 +5724,156 @@ class ComponentNodeAgentSwapNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeAgentSwapNode(BaseModel): +class ComponentNodeSMSNode(BaseModel): id: str """Unique identifier for the node""" - agent_id: str - """The ID of the agent to swap to""" + failed_edge: ComponentNodeSMSNodeFailedEdge - edge: ComponentNodeAgentSwapNodeEdge - """Edge to transition to if agent swap fails""" + instruction: ComponentNodeSMSNodeInstruction - post_call_analysis_setting: Literal["both_agents", "only_destination_agent"] - """Post call analysis setting for the agent swap""" + success_edge: ComponentNodeSMSNodeSuccessEdge - type: Literal["agent_swap"] + type: Literal["sms"] """Type of the node""" - agent_version: Optional[float] = None - """The version of the agent to swap to. - - If not specified, will use the latest version - """ - - display_position: Optional[ComponentNodeAgentSwapNodeDisplayPosition] = None + display_position: Optional[ComponentNodeSMSNodeDisplayPosition] = None """Position for frontend display""" - global_node_setting: Optional[ComponentNodeAgentSwapNodeGlobalNodeSetting] = None - - instruction: Optional[ComponentNodeAgentSwapNodeInstruction] = None - """What to say when swapping agents, only used when speak during execution""" - - keep_current_language: Optional[bool] = None - """If true, keep the current language when swapping agents. Defaults to false.""" - - keep_current_voice: Optional[bool] = None - """If true, keep the current voice when swapping agents. Defaults to false.""" + global_node_setting: Optional[ComponentNodeSMSNodeGlobalNodeSetting] = None - api_model_choice: Optional[ComponentNodeAgentSwapNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[ComponentNodeSMSNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" - speak_during_execution: Optional[bool] = None - """If true, will speak during execution""" - webhook_setting: Optional[Literal["both_agents", "only_destination_agent", "only_source_agent"]] = None - """Webhook setting for the agent swap, defaults to only source.""" +class ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData(BaseModel): + description: str + """Description of the variable.""" + name: str + """Name of the variable.""" -class ComponentNodeMcpNodeDisplayPosition(BaseModel): - """Position for frontend display""" + type: Literal["string"] + """Type of the variable to extract.""" - x: Optional[float] = None + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ - y: Optional[float] = None + examples: Optional[List[str]] = None + """Examples of the variable value to teach model the style and syntax.""" + required: Optional[bool] = None + """Whether this data is required. -class ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData(BaseModel): + choices: List[str] + """The possible values of the variable, must be non empty array.""" + + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["enum"] + """Type of the variable to extract.""" + + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: Optional[bool] = None + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["boolean"] + """Type of the variable to extract.""" + + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: Optional[bool] = None + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["number"] + """Type of the variable to extract.""" + + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: Optional[bool] = None + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +ComponentNodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData, +] + + +class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5920,38 +5887,38 @@ class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(BaseM """ -class ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition, - ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition, +ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeMcpNodeEdge(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeMcpNodeEdgeTransitionCondition + transition_condition: ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -5965,8 +5932,8 @@ class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(B """ -class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] @@ -5976,37 +5943,37 @@ class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(BaseModel """Must be "Else" for else edge""" -class ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(BaseModel): prompt: Literal["Else"] """Must be "Else" for else edge""" type: Literal["prompt"] -ComponentNodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeMcpNodeElseEdge(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeElseEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeMcpNodeElseEdgeTransitionCondition + transition_condition: ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6016,7 +5983,7 @@ class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseMo tool_call_id: str -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6024,32 +5991,36 @@ class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseMo tool_call_id: str -ComponentNodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeFinetuneTransitionExample(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample(BaseModel): id: str """Unique identifier for the example""" - transcript: List[ComponentNodeMcpNodeFinetuneTransitionExampleTranscript] + transcript: List[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript] """The example transcript to finetune how the node should transition.""" destination_node_id: Optional[str] = None """Optional destination node ID""" -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + BaseModel +): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + BaseModel +): left: str """Left side of the equation""" @@ -6063,37 +6034,41 @@ class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + BaseModel +): + equations: List[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6103,7 +6078,7 @@ class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6111,25 +6086,25 @@ class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6139,7 +6114,7 @@ class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6147,19 +6122,19 @@ class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeMcpNodeGlobalNodeSetting(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -6169,41 +6144,24 @@ class ComponentNodeMcpNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample]] = None + negative_finetune_examples: Optional[ + List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample] + ] = None """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample]] = None + positive_finetune_examples: Optional[ + List[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample] + ] = None """Transition to this node""" -class ComponentNodeMcpNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" - - type: Literal["prompt"] - """Type of instruction""" - - -class ComponentNodeMcpNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" - - type: Literal["static_text"] - """Type of instruction""" - - -ComponentNodeMcpNodeInstruction: TypeAlias = Union[ - ComponentNodeMcpNodeInstructionNodeInstructionPrompt, ComponentNodeMcpNodeInstructionNodeInstructionStaticText -] - - -class ComponentNodeMcpNodeModelChoice(BaseModel): +class ComponentNodeExtractDynamicVariablesNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -6232,59 +6190,44 @@ class ComponentNodeMcpNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeMcpNode(BaseModel): +class ComponentNodeExtractDynamicVariablesNode(BaseModel): id: str """Unique identifier for the node""" - mcp_id: str - """Unique ID of the MCP server""" - - mcp_tool_name: str - """Name of the MCP tool to call""" - - type: Literal["mcp"] + type: Literal["extract_dynamic_variables"] """Type of the node""" - wait_for_result: bool - """If true, will wait for result before transitioning to next node""" + variables: List[ComponentNodeExtractDynamicVariablesNodeVariable] - display_position: Optional[ComponentNodeMcpNodeDisplayPosition] = None + display_position: Optional[ComponentNodeExtractDynamicVariablesNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[ComponentNodeMcpNodeEdge]] = None + edges: Optional[List[ComponentNodeExtractDynamicVariablesNodeEdge]] = None - else_edge: Optional[ComponentNodeMcpNodeElseEdge] = None - - finetune_transition_examples: Optional[List[ComponentNodeMcpNodeFinetuneTransitionExample]] = None + else_edge: Optional[ComponentNodeExtractDynamicVariablesNodeElseEdge] = None - global_node_setting: Optional[ComponentNodeMcpNodeGlobalNodeSetting] = None + finetune_transition_examples: Optional[List[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample]] = ( + None + ) - instruction: Optional[ComponentNodeMcpNodeInstruction] = None - """What to say when calling the function, only used when speak during execution""" + global_node_setting: Optional[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting] = None - api_model_choice: Optional[ComponentNodeMcpNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[ComponentNodeExtractDynamicVariablesNodeModelChoice] = FieldInfo( + alias="model_choice", default=None + ) name: Optional[str] = None """Optional name for display purposes""" - response_variables: Optional[Dict[str, str]] = None - """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response - """ - - speak_during_execution: Optional[bool] = None - """If true, will speak during execution""" - -class ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition(BaseModel): +class ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -6298,44 +6241,44 @@ class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEqua """ -class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation] +class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] - prompt: Optional[Literal["Else"]] = None - """Must be "Else" for else edge""" + prompt: Optional[Literal["Transfer failed"]] = None + """Must be "Transfer failed" for transfer failed edge""" -class ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2(BaseModel): - prompt: Literal["Else"] - """Must be "Else" for else edge""" +class ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" type: Literal["prompt"] -ComponentNodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition, + ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition, + ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2, ] -class ComponentNodeComponentNodeElseEdge(BaseModel): - """Default edge when no other conditions are met""" +class ComponentNodeAgentSwapNodeEdge(BaseModel): + """Edge to transition to if agent swap fails""" id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeComponentNodeElseEdgeTransitionCondition + transition_condition: ComponentNodeAgentSwapNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeComponentNodeDisplayPosition(BaseModel): +class ComponentNodeAgentSwapNodeDisplayPosition(BaseModel): """Position for frontend display""" x: Optional[float] = None @@ -6343,101 +6286,14 @@ class ComponentNodeComponentNodeDisplayPosition(BaseModel): y: Optional[float] = None -class ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - - right: Optional[str] = None - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation] - - operator: Literal["||", "&&"] - - type: Literal["equation"] - - -ComponentNodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition, - ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition, -] - - -class ComponentNodeComponentNodeEdge(BaseModel): - id: str - """Unique identifier for the edge""" - - transition_condition: ComponentNodeComponentNodeEdgeTransitionCondition - - destination_node_id: Optional[str] = None - """ID of the destination node""" - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): - content: str - - role: Literal["agent", "user"] - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): - arguments: str - - name: str - - role: Literal["tool_call_invocation"] - - tool_call_id: str - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): - content: str - - role: Literal["tool_call_result"] - - tool_call_id: str - - -ComponentNodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, -] - - -class ComponentNodeComponentNodeFinetuneTransitionExample(BaseModel): - id: str - """Unique identifier for the example""" - - transcript: List[ComponentNodeComponentNodeFinetuneTransitionExampleTranscript] - """The example transcript to finetune how the node should transition.""" - - destination_node_id: Optional[str] = None - """Optional destination node ID""" - - -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -6451,9 +6307,9 @@ class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondit """ -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): equations: List[ - ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation ] operator: Literal["||", "&&"] @@ -6461,29 +6317,29 @@ class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondit type: Literal["equation"] -ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6493,7 +6349,7 @@ class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: str -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6501,25 +6357,25 @@ class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: str -ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6529,7 +6385,7 @@ class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: str -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6537,19 +6393,19 @@ class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: str -ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeComponentNodeGlobalNodeSetting(BaseModel): +class ComponentNodeAgentSwapNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -6559,75 +6415,138 @@ class ComponentNodeComponentNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample]] = ( + negative_finetune_examples: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample]] = ( None ) """Don't transition to this node""" - positive_finetune_examples: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample]] = ( + positive_finetune_examples: Optional[List[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample]] = ( None ) """Transition to this node""" -class ComponentNodeComponentNode(BaseModel): - id: str - """Unique identifier for the node""" - - component_id: str - """The reference ID of the component""" - - component_type: Literal["local", "shared"] - """Type of component: - - - local: stored in conversation flow's components array - - shared: stored in stand-alone conversation-flow-component table - """ - - else_edge: ComponentNodeComponentNodeElseEdge - """Default edge when no other conditions are met""" - - type: Literal["component"] - """Type of the node""" - - display_position: Optional[ComponentNodeComponentNodeDisplayPosition] = None - """Position for frontend display""" - - edges: Optional[List[ComponentNodeComponentNodeEdge]] = None - """Array of edges for conditional transitions""" - - finetune_transition_examples: Optional[List[ComponentNodeComponentNodeFinetuneTransitionExample]] = None +class ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" - global_node_setting: Optional[ComponentNodeComponentNodeGlobalNodeSetting] = None + type: Literal["prompt"] + """Type of instruction""" - name: Optional[str] = None - """Optional name for display purposes""" +class ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" -class ComponentNodeBridgeTransferNodeDisplayPosition(BaseModel): - """Position for frontend display""" + type: Literal["static_text"] + """Type of instruction""" - x: Optional[float] = None - y: Optional[float] = None +ComponentNodeAgentSwapNodeInstruction: TypeAlias = Union[ + ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt, + ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText, +] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class ComponentNodeAgentSwapNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + + type: Literal["cascading"] + """Type of model choice""" + + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeAgentSwapNode(BaseModel): + id: str + """Unique identifier for the node""" + + agent_id: str + """The ID of the agent to swap to""" + + edge: ComponentNodeAgentSwapNodeEdge + """Edge to transition to if agent swap fails""" + + post_call_analysis_setting: Literal["both_agents", "only_destination_agent"] + """Post call analysis setting for the agent swap""" + + type: Literal["agent_swap"] + """Type of the node""" + + agent_version: Optional[float] = None + """The version of the agent to swap to. + + If not specified, will use the latest version + """ + + display_position: Optional[ComponentNodeAgentSwapNodeDisplayPosition] = None + """Position for frontend display""" + + global_node_setting: Optional[ComponentNodeAgentSwapNodeGlobalNodeSetting] = None + + instruction: Optional[ComponentNodeAgentSwapNodeInstruction] = None + """What to say when swapping agents, only used when speak during execution""" + + keep_current_language: Optional[bool] = None + """If true, keep the current language when swapping agents. Defaults to false.""" + + keep_current_voice: Optional[bool] = None + """If true, keep the current voice when swapping agents. Defaults to false.""" + + api_model_choice: Optional[ComponentNodeAgentSwapNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + + name: Optional[str] = None + """Optional name for display purposes""" + + speak_during_execution: Optional[bool] = None + """If true, will speak during execution""" + + webhook_setting: Optional[Literal["both_agents", "only_destination_agent", "only_source_agent"]] = None + """Webhook setting for the agent swap, defaults to only source.""" + + +class ComponentNodeMcpNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - BaseModel -): +class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -6641,75 +6560,93 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionC """ -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] +class ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition, + ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeMcpNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeMcpNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): - content: str +class ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - role: Literal["agent", "user"] + type: Literal["prompt"] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): - arguments: str +class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - name: str + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - role: Literal["tool_call_invocation"] + right: Optional[str] = None + """Right side of the equation. - tool_call_id: str + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): - content: str +class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation] - role: Literal["tool_call_result"] + operator: Literal["||", "&&"] - tool_call_id: str + type: Literal["equation"] + + prompt: Optional[Literal["Else"]] = None + """Must be "Else" for else edge""" -ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +class ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Else"] + """Must be "Else" for else edge""" + + type: Literal["prompt"] + + +ComponentNodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" +class ComponentNodeMcpNodeElseEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeMcpNodeElseEdgeTransitionCondition + destination_node_id: Optional[str] = None + """ID of the destination node""" -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6719,7 +6656,7 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: str -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6727,189 +6664,76 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: str -ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] - """Find tune the transition condition to this global node""" +class ComponentNodeMcpNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" + transcript: List[ComponentNodeMcpNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" -class ComponentNodeBridgeTransferNodeGlobalNodeSetting(BaseModel): - condition: str - """Condition for global node activation, cannot be empty""" + destination_node_id: Optional[str] = None + """Optional destination node ID""" - cool_down: Optional[float] = None - """ - The same global node won't be triggered again within the next N node - transitions. - """ - go_back_conditions: Optional[List[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition]] = None - """The conditions for global node go back. +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - There would be no destination_node_id for these edges. - """ + type: Literal["prompt"] - negative_finetune_examples: Optional[ - List[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] - ] = None - """Don't transition to this node""" - positive_finetune_examples: Optional[ - List[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] - ] = None - """Transition to this node""" +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] -class ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" + right: Optional[str] = None + """Right side of the equation. - type: Literal["prompt"] - """Type of instruction""" + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText(BaseModel): - text: str - """The static text for the instruction""" +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - type: Literal["static_text"] - """Type of instruction""" + operator: Literal["||", "&&"] + type: Literal["equation"] -ComponentNodeBridgeTransferNodeInstruction: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt, - ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText, + +ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeBridgeTransferNodeModelChoice(BaseModel): - model: Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - """The LLM model to use""" - - type: Literal["cascading"] - """Type of model choice""" - - high_priority: Optional[bool] = None - """Whether to use high priority pool with more dedicated resource, default false""" - - -class ComponentNodeBridgeTransferNode(BaseModel): - id: str - """Unique identifier for the node""" - - type: Literal["bridge_transfer"] - """Type of the node - initiates a warm transfer by bridging the call""" - - display_position: Optional[ComponentNodeBridgeTransferNodeDisplayPosition] = None - """Position for frontend display""" - - global_node_setting: Optional[ComponentNodeBridgeTransferNodeGlobalNodeSetting] = None - - instruction: Optional[ComponentNodeBridgeTransferNodeInstruction] = None - """Describes what to say to user when bridging the transfer. - - Only applicable when speak_during_execution is true. - """ - - api_model_choice: Optional[ComponentNodeBridgeTransferNodeModelChoice] = FieldInfo( - alias="model_choice", default=None - ) - - name: Optional[str] = None - """Optional name for display purposes""" - - speak_during_execution: Optional[bool] = None - """If true, will speak during execution""" - - -class ComponentNodeCancelTransferNodeDisplayPosition(BaseModel): - """Position for frontend display""" - - x: Optional[float] = None - - y: Optional[float] = None - - -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): - prompt: str - """Prompt condition text""" - - type: Literal["prompt"] - - -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - BaseModel -): - left: str - """Left side of the equation""" - - operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] - - right: Optional[str] = None - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[ - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] - - operator: Literal["||", "&&"] - - type: Literal["equation"] - - -ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] - - -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6919,7 +6743,7 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTra tool_call_id: str -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6927,25 +6751,25 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTra tool_call_id: str -ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -6955,7 +6779,7 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: str -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -6963,19 +6787,19 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: str -ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class ComponentNodeCancelTransferNodeGlobalNodeSetting(BaseModel): +class ComponentNodeMcpNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -6985,24 +6809,20 @@ class ComponentNodeCancelTransferNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[ - List[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] - ] = None + negative_finetune_examples: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[ - List[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] - ] = None + positive_finetune_examples: Optional[List[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt(BaseModel): +class ComponentNodeMcpNodeInstructionNodeInstructionPrompt(BaseModel): text: str """The prompt text for the instruction""" @@ -7010,7 +6830,7 @@ class ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt(BaseModel) """Type of instruction""" -class ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText(BaseModel): +class ComponentNodeMcpNodeInstructionNodeInstructionStaticText(BaseModel): text: str """The static text for the instruction""" @@ -7018,13 +6838,12 @@ class ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText(BaseMo """Type of instruction""" -ComponentNodeCancelTransferNodeInstruction: TypeAlias = Union[ - ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt, - ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText, +ComponentNodeMcpNodeInstruction: TypeAlias = Union[ + ComponentNodeMcpNodeInstructionNodeInstructionPrompt, ComponentNodeMcpNodeInstructionNodeInstructionStaticText ] -class ComponentNodeCancelTransferNodeModelChoice(BaseModel): +class ComponentNodeMcpNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -7053,397 +6872,1717 @@ class ComponentNodeCancelTransferNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeCancelTransferNode(BaseModel): +class ComponentNodeMcpNode(BaseModel): id: str """Unique identifier for the node""" - type: Literal["cancel_transfer"] - """Type of the node - cancels the warm transfer and ends the transfer agent call""" + mcp_id: str + """Unique ID of the MCP server""" - display_position: Optional[ComponentNodeCancelTransferNodeDisplayPosition] = None + mcp_tool_name: str + """Name of the MCP tool to call""" + + type: Literal["mcp"] + """Type of the node""" + + wait_for_result: bool + """If true, will wait for result before transitioning to next node""" + + display_position: Optional[ComponentNodeMcpNodeDisplayPosition] = None """Position for frontend display""" - global_node_setting: Optional[ComponentNodeCancelTransferNodeGlobalNodeSetting] = None + edges: Optional[List[ComponentNodeMcpNodeEdge]] = None - instruction: Optional[ComponentNodeCancelTransferNodeInstruction] = None - """Describes what to say to user when cancelling the transfer. + else_edge: Optional[ComponentNodeMcpNodeElseEdge] = None - Only applicable when speak_during_execution is true. - """ + finetune_transition_examples: Optional[List[ComponentNodeMcpNodeFinetuneTransitionExample]] = None - api_model_choice: Optional[ComponentNodeCancelTransferNodeModelChoice] = FieldInfo( - alias="model_choice", default=None - ) + global_node_setting: Optional[ComponentNodeMcpNodeGlobalNodeSetting] = None + + instruction: Optional[ComponentNodeMcpNodeInstruction] = None + """What to say when calling the function, only used when speak during execution""" + + api_model_choice: Optional[ComponentNodeMcpNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" + response_variables: Optional[Dict[str, str]] = None + """ + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response + """ + speak_during_execution: Optional[bool] = None """If true, will speak during execution""" -ComponentNode: TypeAlias = Union[ - ComponentNodeConversationNode, - ComponentNodeEndNode, - ComponentNodeFunctionNode, - ComponentNodeCodeNode, - ComponentNodeTransferCallNode, - ComponentNodePressDigitNode, - ComponentNodeBranchNode, - ComponentNodeSMSNode, - ComponentNodeExtractDynamicVariablesNode, - ComponentNodeAgentSwapNode, - ComponentNodeMcpNode, - ComponentNodeComponentNode, - ComponentNodeBridgeTransferNode, - ComponentNodeCancelTransferNode, -] +class ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + type: Literal["prompt"] -class ComponentBeginTagDisplayPosition(BaseModel): - """Display position for the begin tag in the frontend""" - x: Optional[float] = None +class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" - y: Optional[float] = None + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + right: Optional[str] = None + """Right side of the equation. -class ComponentMcp(BaseModel): - name: str + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ - url: str - """The URL of the MCP server.""" - headers: Optional[Dict[str, str]] = None - """Headers to add to the MCP connection request.""" +class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation] - query_params: Optional[Dict[str, str]] = None - """Query parameters to append to the MCP connection request URL.""" + operator: Literal["||", "&&"] - timeout_ms: Optional[int] = None - """Maximum time to wait for a connection to be established (in milliseconds). + type: Literal["equation"] - Default to 120,000 ms (2 minutes). - """ + prompt: Optional[Literal["Else"]] = None + """Must be "Else" for else edge""" -class ComponentToolCustomToolParameters(BaseModel): - """The parameters the functions accepts, described as a JSON Schema object. +class ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Else"] + """Must be "Else" for else edge""" - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. - """ + type: Literal["prompt"] - properties: Dict[str, object] - """ - The value of properties is an object, where each key is the name of a property + +ComponentNodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2, +] + + +class ComponentNodeComponentNodeElseEdge(BaseModel): + """Default edge when no other conditions are met""" + + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeComponentNodeElseEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeComponentNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +ComponentNodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition, + ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition, +] + + +class ComponentNodeComponentNodeEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeComponentNodeEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class ComponentNodeComponentNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" + + transcript: List[ComponentNodeComponentNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: Optional[str] = None + """Optional destination node ID""" + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeComponentNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample]] = ( + None + ) + """Don't transition to this node""" + + positive_finetune_examples: Optional[List[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample]] = ( + None + ) + """Transition to this node""" + + +class ComponentNodeComponentNode(BaseModel): + id: str + """Unique identifier for the node""" + + component_id: str + """The reference ID of the component""" + + component_type: Literal["local", "shared"] + """Type of component: + + - local: stored in conversation flow's components array + - shared: stored in stand-alone conversation-flow-component table + """ + + else_edge: ComponentNodeComponentNodeElseEdge + """Default edge when no other conditions are met""" + + type: Literal["component"] + """Type of the node""" + + display_position: Optional[ComponentNodeComponentNodeDisplayPosition] = None + """Position for frontend display""" + + edges: Optional[List[ComponentNodeComponentNodeEdge]] = None + """Array of edges for conditional transitions""" + + finetune_transition_examples: Optional[List[ComponentNodeComponentNodeFinetuneTransitionExample]] = None + + global_node_setting: Optional[ComponentNodeComponentNodeGlobalNodeSetting] = None + + name: Optional[str] = None + """Optional name for display purposes""" + + +class ComponentNodeBridgeTransferNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + BaseModel +): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Optional[List[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Optional[ + List[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] + ] = None + """Don't transition to this node""" + + positive_finetune_examples: Optional[ + List[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] + ] = None + """Transition to this node""" + + +class ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +ComponentNodeBridgeTransferNodeInstruction: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt, + ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeBridgeTransferNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + + type: Literal["cascading"] + """Type of model choice""" + + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeBridgeTransferNode(BaseModel): + id: str + """Unique identifier for the node""" + + type: Literal["bridge_transfer"] + """Type of the node - initiates a warm transfer by bridging the call""" + + display_position: Optional[ComponentNodeBridgeTransferNodeDisplayPosition] = None + """Position for frontend display""" + + global_node_setting: Optional[ComponentNodeBridgeTransferNodeGlobalNodeSetting] = None + + instruction: Optional[ComponentNodeBridgeTransferNodeInstruction] = None + """Describes what to say to user when bridging the transfer. + + Only applicable when speak_during_execution is true. + """ + + api_model_choice: Optional[ComponentNodeBridgeTransferNodeModelChoice] = FieldInfo( + alias="model_choice", default=None + ) + + name: Optional[str] = None + """Optional name for display purposes""" + + speak_during_execution: Optional[bool] = None + """If true, will speak during execution""" + + +class ComponentNodeCancelTransferNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + BaseModel +): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[ + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Optional[List[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Optional[ + List[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] + ] = None + """Don't transition to this node""" + + positive_finetune_examples: Optional[ + List[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] + ] = None + """Transition to this node""" + + +class ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +ComponentNodeCancelTransferNodeInstruction: TypeAlias = Union[ + ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt, + ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeCancelTransferNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + + type: Literal["cascading"] + """Type of model choice""" + + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeCancelTransferNode(BaseModel): + id: str + """Unique identifier for the node""" + + type: Literal["cancel_transfer"] + """Type of the node - cancels the warm transfer and ends the transfer agent call""" + + display_position: Optional[ComponentNodeCancelTransferNodeDisplayPosition] = None + """Position for frontend display""" + + global_node_setting: Optional[ComponentNodeCancelTransferNodeGlobalNodeSetting] = None + + instruction: Optional[ComponentNodeCancelTransferNodeInstruction] = None + """Describes what to say to user when cancelling the transfer. + + Only applicable when speak_during_execution is true. + """ + + api_model_choice: Optional[ComponentNodeCancelTransferNodeModelChoice] = FieldInfo( + alias="model_choice", default=None + ) + + name: Optional[str] = None + """Optional name for display purposes""" + + speak_during_execution: Optional[bool] = None + """If true, will speak during execution""" + + +ComponentNode: TypeAlias = Union[ + ComponentNodeConversationNode, + ComponentNodeSubagentNode, + ComponentNodeEndNode, + ComponentNodeFunctionNode, + ComponentNodeCodeNode, + ComponentNodeTransferCallNode, + ComponentNodePressDigitNode, + ComponentNodeBranchNode, + ComponentNodeSMSNode, + ComponentNodeExtractDynamicVariablesNode, + ComponentNodeAgentSwapNode, + ComponentNodeMcpNode, + ComponentNodeComponentNode, + ComponentNodeBridgeTransferNode, + ComponentNodeCancelTransferNode, +] + + +class ComponentBeginTagDisplayPosition(BaseModel): + """Display position for the begin tag in the frontend""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentMcp(BaseModel): + name: str + + url: str + """The URL of the MCP server.""" + + headers: Optional[Dict[str, str]] = None + """Headers to add to the MCP connection request.""" + + query_params: Optional[Dict[str, str]] = None + """Query parameters to append to the MCP connection request URL.""" + + timeout_ms: Optional[int] = None + """Maximum time to wait for a connection to be established (in milliseconds). + + Default to 120,000 ms (2 minutes). + """ + + +class ComponentNoteDisplayPosition(BaseModel): + """Position of the note on the canvas.""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class ComponentNoteSize(BaseModel): + """Dimensions of the note on the canvas.""" + + height: Optional[float] = None + + width: Optional[float] = None + + +class ComponentNote(BaseModel): + id: str + """Unique identifier for the note.""" + + content: str + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: ComponentNoteDisplayPosition + """Position of the note on the canvas.""" + + size: ComponentNoteSize + """Dimensions of the note on the canvas.""" + + +class ComponentToolCustomToolParameters(BaseModel): + """The parameters the functions accepts, described as a JSON Schema object. + + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + """ + + properties: Dict[str, object] + """ + The value of properties is an object, where each key is the name of a property and each value is a schema used to validate that property. """ - type: Literal["object"] - """Type must be "object" for a JSON Schema object.""" + type: Literal["object"] + """Type must be "object" for a JSON Schema object.""" + + required: Optional[List[str]] = None + """List of names of required property when generating this parameter. + + LLM will do its best to generate the required properties in its function + arguments. Property must exist in properties. + """ + + +class ComponentToolCustomTool(BaseModel): + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Literal["custom"] + + url: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + args_at_root: Optional[bool] = None + """ + If set to true, the parameters will be passed as root level JSON object instead + of nested under "args". + """ + + description: Optional[str] = None + """Describes what this tool does and when to call this tool.""" + + execution_message_description: Optional[str] = None + """The description for the sentence agent say during execution. + + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ + + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + headers: Optional[Dict[str, str]] = None + """Headers to add to the request.""" + + method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None + """Method to use for the request, default to POST.""" + + parameters: Optional[ComponentToolCustomToolParameters] = None + """The parameters the functions accepts, described as a JSON Schema object. + + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. Omitting parameters defines a function with + an empty parameter list. + """ + + query_params: Optional[Dict[str, str]] = None + """Query parameters to append to the request URL.""" + + response_variables: Optional[Dict[str, str]] = None + """A mapping of variable names to JSON paths in the response body. + + These values will be extracted from the response and made available as dynamic + variables for use. + """ + + speak_after_execution: Optional[bool] = None + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ + + speak_during_execution: Optional[bool] = None + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ + + timeout_ms: Optional[int] = None + """The maximum time in milliseconds the tool can run before it's considered + timeout. + + If the tool times out, the agent would have that info. The minimum value allowed + is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, + this is set to 120,000 ms (2 min). + """ + + tool_id: Optional[str] = None + """Unique identifier for the tool""" + + +class ComponentToolCheckAvailabilityCalTool(BaseModel): + cal_api_key: str + """ + Cal.com Api key that have access to the cal.com event you want to check + availability for. + """ + + event_type_id: Union[float, str] + """ + Cal.com event type id number for the cal.com event you want to check + availability for. Can be a number or a dynamic variable in the format + `{{variable_name}}` that will be resolved at runtime. + """ + + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Literal["check_availability_cal"] + + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + timezone: Optional[str] = None + """ + Timezone to be used when checking availability, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ + + tool_id: Optional[str] = None + """Unique identifier for the tool""" + + +class ComponentToolBookAppointmentCalTool(BaseModel): + cal_api_key: str + """ + Cal.com Api key that have access to the cal.com event you want to book + appointment. + """ + + event_type_id: Union[float, str] + """Cal.com event type id number for the cal.com event you want to book appointment. + + Can be a number or a dynamic variable in the format `{{variable_name}}` that + will be resolved at runtime. + """ + + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Literal["book_appointment_cal"] + + description: Optional[str] = None + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + timezone: Optional[str] = None + """ + Timezone to be used when booking appointment, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ + + tool_id: Optional[str] = None + """Unique identifier for the tool""" + + +ComponentTool: TypeAlias = Union[ + ComponentToolCustomTool, ComponentToolCheckAvailabilityCalTool, ComponentToolBookAppointmentCalTool +] + + +class Component(BaseModel): + name: str + """Name of the component""" + + nodes: List[ComponentNode] + """Nodes that make up the component""" + + begin_tag_display_position: Optional[ComponentBeginTagDisplayPosition] = None + """Display position for the begin tag in the frontend""" + + mcps: Optional[List[ComponentMcp]] = None + """A list of MCP server configurations to use for this component""" + + notes: Optional[List[ComponentNote]] = None + """Visual annotations displayed on the flow canvas.""" + + start_node_id: Optional[str] = None + """ID of the starting node""" + + tools: Optional[List[ComponentTool]] = None + """Tools available within the component""" + + +class KBConfig(BaseModel): + """Knowledge base configuration for RAG retrieval.""" + + filter_score: Optional[float] = None + """Similarity threshold for filtering search results""" + + top_k: Optional[int] = None + """Max number of knowledge base chunks to retrieve""" + + +class Mcp(BaseModel): + name: str + + url: str + """The URL of the MCP server.""" + + headers: Optional[Dict[str, str]] = None + """Headers to add to the MCP connection request.""" + + query_params: Optional[Dict[str, str]] = None + """Query parameters to append to the MCP connection request URL.""" + + timeout_ms: Optional[int] = None + """Maximum time to wait for a connection to be established (in milliseconds). + + Default to 120,000 ms (2 minutes). + """ + + +class ModelChoice(BaseModel): + """The model choice for the conversation flow.""" + + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" + + type: Literal["cascading"] + """Type of model choice""" + + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" + + +class NodeConversationNodeInstructionNodeInstructionPrompt(BaseModel): + text: str + """The prompt text for the instruction""" + + type: Literal["prompt"] + """Type of instruction""" + + +class NodeConversationNodeInstructionNodeInstructionStaticText(BaseModel): + text: str + """The static text for the instruction""" + + type: Literal["static_text"] + """Type of instruction""" + + +NodeConversationNodeInstruction: TypeAlias = Union[ + NodeConversationNodeInstructionNodeInstructionPrompt, NodeConversationNodeInstructionNodeInstructionStaticText +] + + +class NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + prompt: Optional[Literal["Always"]] = None + """Must be "Always" for always edge""" + + +class NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Always"] + """Must be "Always" for always edge""" + + type: Literal["prompt"] + + +NodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, +] + + +class NodeConversationNodeAlwaysEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeConversationNodeAlwaysEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeConversationNodeDisplayPosition(BaseModel): + """Position for frontend display""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class NodeConversationNodeEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeConversationNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeConversationNodeEdgeTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +NodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeEdgeTransitionConditionPromptCondition, + NodeConversationNodeEdgeTransitionConditionEquationCondition, +] + + +class NodeConversationNodeEdge(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeConversationNodeEdgeTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + + +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +] + + +class NodeConversationNodeFinetuneConversationExample(BaseModel): + id: str + """Unique identifier for the example""" + + transcript: List[NodeConversationNodeFinetuneConversationExampleTranscript] + """The example transcript to finetune how the conversation should be.""" + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): + content: str + + role: Literal["agent", "user"] + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): + arguments: str + + name: str + + role: Literal["tool_call_invocation"] + + tool_call_id: str + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): + content: str + + role: Literal["tool_call_result"] + + tool_call_id: str + + +NodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class NodeConversationNodeFinetuneTransitionExample(BaseModel): + id: str + """Unique identifier for the example""" + + transcript: List[NodeConversationNodeFinetuneTransitionExampleTranscript] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: Optional[str] = None + """Optional destination node ID""" + + +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" + + type: Literal["prompt"] + + +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + + operator: Literal["||", "&&"] + + type: Literal["equation"] + + +NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class NodeConversationNodeGlobalNodeSettingGoBackCondition(BaseModel): + id: str + """Unique identifier for the edge""" + + transition_condition: NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition + + destination_node_id: Optional[str] = None + """ID of the destination node""" + - required: Optional[List[str]] = None - """List of names of required property when generating this parameter. +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str - LLM will do its best to generate the required properties in its function - arguments. Property must exist in properties. - """ + role: Literal["agent", "user"] -class ComponentToolCustomTool(BaseModel): +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str + name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + role: Literal["tool_call_invocation"] - type: Literal["custom"] + tool_call_id: str - url: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ - args_at_root: Optional[bool] = None - """ - If set to true, the parameters will be passed as root level JSON object instead - of nested under "args". - """ +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str - description: Optional[str] = None - """Describes what this tool does and when to call this tool.""" + role: Literal["tool_call_result"] - execution_message_description: Optional[str] = None - """The description for the sentence agent say during execution. + tool_call_id: str - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". - """ - execution_message_type: Optional[Literal["prompt", "static_text"]] = None - """Type of execution message. +NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - headers: Optional[Dict[str, str]] = None - """Headers to add to the request.""" +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" - method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None - """Method to use for the request, default to POST.""" - parameters: Optional[ComponentToolCustomToolParameters] = None - """The parameters the functions accepts, described as a JSON Schema object. +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): + content: str - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. Omitting parameters defines a function with - an empty parameter list. - """ + role: Literal["agent", "user"] - query_params: Optional[Dict[str, str]] = None - """Query parameters to append to the request URL.""" - response_variables: Optional[Dict[str, str]] = None - """A mapping of variable names to JSON paths in the response body. +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): + arguments: str - These values will be extracted from the response and made available as dynamic - variables for use. - """ + name: str - speak_after_execution: Optional[bool] = None - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ + role: Literal["tool_call_invocation"] - speak_during_execution: Optional[bool] = None - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. - """ + tool_call_id: str - timeout_ms: Optional[int] = None - """The maximum time in milliseconds the tool can run before it's considered - timeout. - If the tool times out, the agent would have that info. The minimum value allowed - is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, - this is set to 120,000 ms (2 min). - """ +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): + content: str - tool_id: Optional[str] = None - """Unique identifier for the tool""" + role: Literal["tool_call_result"] + tool_call_id: str -class ComponentToolCheckAvailabilityCalTool(BaseModel): - cal_api_key: str - """ - Cal.com Api key that have access to the cal.com event you want to check - availability for. - """ - event_type_id: Union[float, str] - """ - Cal.com event type id number for the cal.com event you want to check - availability for. Can be a number or a dynamic variable in the format - `{{variable_name}}` that will be resolved at runtime. - """ +NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] - name: str - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + """Find tune the transition condition to this global node""" - type: Literal["check_availability_cal"] - description: Optional[str] = None +class NodeConversationNodeGlobalNodeSetting(BaseModel): + condition: str + """Condition for global node activation, cannot be empty""" + + cool_down: Optional[float] = None """ - Describes what the tool does, sometimes can also include information about when - to call the tool. + The same global node won't be triggered again within the next N node + transitions. """ - timezone: Optional[str] = None - """ - Timezone to be used when checking availability, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. + go_back_conditions: Optional[List[NodeConversationNodeGlobalNodeSettingGoBackCondition]] = None + """The conditions for global node go back. + + There would be no destination_node_id for these edges. """ - tool_id: Optional[str] = None - """Unique identifier for the tool""" + negative_finetune_examples: Optional[List[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample]] = None + """Don't transition to this node""" + positive_finetune_examples: Optional[List[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample]] = None + """Transition to this node""" -class ComponentToolBookAppointmentCalTool(BaseModel): - cal_api_key: str - """ - Cal.com Api key that have access to the cal.com event you want to book - appointment. - """ - event_type_id: Union[float, str] - """Cal.com event type id number for the cal.com event you want to book appointment. +class NodeConversationNodeModelChoice(BaseModel): + model: Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + """The LLM model to use""" - Can be a number or a dynamic variable in the format `{{variable_name}}` that - will be resolved at runtime. - """ + type: Literal["cascading"] + """Type of model choice""" - name: str - """Name of the tool. + high_priority: Optional[bool] = None + """Whether to use high priority pool with more dedicated resource, default false""" - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Literal["book_appointment_cal"] +class NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(BaseModel): + prompt: str + """Prompt condition text""" - description: Optional[str] = None - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + type: Literal["prompt"] - timezone: Optional[str] = None - """ - Timezone to be used when booking appointment, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. + +class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(BaseModel): + left: str + """Left side of the equation""" + + operator: Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"] + + right: Optional[str] = None + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - tool_id: Optional[str] = None - """Unique identifier for the tool""" +class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] -ComponentTool: TypeAlias = Union[ - ComponentToolCustomTool, ComponentToolCheckAvailabilityCalTool, ComponentToolBookAppointmentCalTool -] + operator: Literal["||", "&&"] + type: Literal["equation"] -class Component(BaseModel): - name: str - """Name of the component""" + prompt: Optional[Literal["Skip response"]] = None + """Must be "Skip response" for skip response edge""" - nodes: List[ComponentNode] - """Nodes that make up the component""" - begin_tag_display_position: Optional[ComponentBeginTagDisplayPosition] = None - """Display position for the begin tag in the frontend""" +class NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(BaseModel): + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + type: Literal["prompt"] + - mcps: Optional[List[ComponentMcp]] = None - """A list of MCP server configurations to use for this component""" +NodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, +] - start_node_id: Optional[str] = None - """ID of the starting node""" - tools: Optional[List[ComponentTool]] = None - """Tools available within the component""" +class NodeConversationNodeSkipResponseEdge(BaseModel): + id: str + """Unique identifier for the edge""" + transition_condition: NodeConversationNodeSkipResponseEdgeTransitionCondition -class KBConfig(BaseModel): - """Knowledge base configuration for RAG retrieval.""" + destination_node_id: Optional[str] = None + """ID of the destination node""" - filter_score: Optional[float] = None - """Similarity threshold for filtering search results""" - top_k: Optional[int] = None - """Max number of knowledge base chunks to retrieve""" +class NodeConversationNode(BaseModel): + id: str + """Unique identifier for the node""" + instruction: NodeConversationNodeInstruction -class Mcp(BaseModel): - name: str + type: Literal["conversation"] + """Type of the node""" - url: str - """The URL of the MCP server.""" + always_edge: Optional[NodeConversationNodeAlwaysEdge] = None - headers: Optional[Dict[str, str]] = None - """Headers to add to the MCP connection request.""" + display_position: Optional[NodeConversationNodeDisplayPosition] = None + """Position for frontend display""" - query_params: Optional[Dict[str, str]] = None - """Query parameters to append to the MCP connection request URL.""" + edges: Optional[List[NodeConversationNodeEdge]] = None - timeout_ms: Optional[int] = None - """Maximum time to wait for a connection to be established (in milliseconds). + finetune_conversation_examples: Optional[List[NodeConversationNodeFinetuneConversationExample]] = None - Default to 120,000 ms (2 minutes). - """ + finetune_transition_examples: Optional[List[NodeConversationNodeFinetuneTransitionExample]] = None + global_node_setting: Optional[NodeConversationNodeGlobalNodeSetting] = None -class ModelChoice(BaseModel): - """The model choice for the conversation flow.""" + interruption_sensitivity: Optional[float] = None - model: Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - """The LLM model to use""" + knowledge_base_ids: Optional[List[str]] = None + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - type: Literal["cascading"] - """Type of model choice""" + api_model_choice: Optional[NodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) - high_priority: Optional[bool] = None - """Whether to use high priority pool with more dedicated resource, default false""" + name: Optional[str] = None + """Optional name for display purposes""" + responsiveness: Optional[float] = None -class NodeConversationNodeInstructionNodeInstructionPrompt(BaseModel): - text: str - """The prompt text for the instruction""" + skip_response_edge: Optional[NodeConversationNodeSkipResponseEdge] = None - type: Literal["prompt"] - """Type of instruction""" + voice_speed: Optional[float] = None -class NodeConversationNodeInstructionNodeInstructionStaticText(BaseModel): +class NodeSubagentNodeInstruction(BaseModel): text: str - """The static text for the instruction""" + """The prompt text for the instruction""" - type: Literal["static_text"] + type: Literal["prompt"] """Type of instruction""" -NodeConversationNodeInstruction: TypeAlias = Union[ - NodeConversationNodeInstructionNodeInstructionPrompt, NodeConversationNodeInstructionNodeInstructionStaticText -] - - -class NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(BaseModel): +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(BaseModel): +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -7457,8 +8596,8 @@ class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation """ -class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation] +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] @@ -7468,31 +8607,31 @@ class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(BaseMod """Must be "Always" for always edge""" -class NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(BaseModel): +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(BaseModel): prompt: Literal["Always"] """Must be "Always" for always edge""" type: Literal["prompt"] -NodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, - NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, - NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeAlwaysEdge(BaseModel): +class NodeSubagentNodeAlwaysEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: NodeConversationNodeAlwaysEdgeTransitionCondition + transition_condition: NodeSubagentNodeAlwaysEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class NodeConversationNodeDisplayPosition(BaseModel): +class NodeSubagentNodeDisplayPosition(BaseModel): """Position for frontend display""" x: Optional[float] = None @@ -7500,14 +8639,14 @@ class NodeConversationNodeDisplayPosition(BaseModel): y: Optional[float] = None -class NodeConversationNodeEdgeTransitionConditionPromptCondition(BaseModel): +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -7521,37 +8660,36 @@ class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(BaseM """ -class NodeConversationNodeEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[NodeConversationNodeEdgeTransitionConditionEquationConditionEquation] +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -NodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeEdgeTransitionConditionPromptCondition, - NodeConversationNodeEdgeTransitionConditionEquationCondition, +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition ] -class NodeConversationNodeEdge(BaseModel): +class NodeSubagentNodeEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: NodeConversationNodeEdgeTransitionCondition + transition_condition: NodeSubagentNodeEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(BaseModel): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(BaseModel): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -7561,7 +8699,7 @@ class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(Base tool_call_id: str -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(BaseModel): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -7569,28 +8707,28 @@ class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(Base tool_call_id: str -NodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, ] -class NodeConversationNodeFinetuneConversationExample(BaseModel): +class NodeSubagentNodeFinetuneConversationExample(BaseModel): id: str """Unique identifier for the example""" - transcript: List[NodeConversationNodeFinetuneConversationExampleTranscript] + transcript: List[NodeSubagentNodeFinetuneConversationExampleTranscript] """The example transcript to finetune how the conversation should be.""" -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -7600,7 +8738,7 @@ class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(BaseMo tool_call_id: str -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -7608,32 +8746,32 @@ class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(BaseMo tool_call_id: str -NodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodeConversationNodeFinetuneTransitionExample(BaseModel): +class NodeSubagentNodeFinetuneTransitionExample(BaseModel): id: str """Unique identifier for the example""" - transcript: List[NodeConversationNodeFinetuneTransitionExampleTranscript] + transcript: List[NodeSubagentNodeFinetuneTransitionExampleTranscript] """The example transcript to finetune how the node should transition.""" destination_node_id: Optional[str] = None """Optional destination node ID""" -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -7647,37 +8785,37 @@ class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): - equations: List[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] type: Literal["equation"] -NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeConversationNodeGlobalNodeSettingGoBackCondition(BaseModel): +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition + transition_condition: NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -7687,7 +8825,7 @@ class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -7695,25 +8833,25 @@ class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: str -NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): - transcript: List[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(BaseModel): + transcript: List[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(BaseModel): content: str role: Literal["agent", "user"] -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(BaseModel): arguments: str name: str @@ -7723,7 +8861,7 @@ class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(BaseModel): content: str role: Literal["tool_call_result"] @@ -7731,19 +8869,19 @@ class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: str -NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): - transcript: List[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(BaseModel): + transcript: List[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] """Find tune the transition condition to this global node""" -class NodeConversationNodeGlobalNodeSetting(BaseModel): +class NodeSubagentNodeGlobalNodeSetting(BaseModel): condition: str """Condition for global node activation, cannot be empty""" @@ -7753,20 +8891,20 @@ class NodeConversationNodeGlobalNodeSetting(BaseModel): transitions. """ - go_back_conditions: Optional[List[NodeConversationNodeGlobalNodeSettingGoBackCondition]] = None + go_back_conditions: Optional[List[NodeSubagentNodeGlobalNodeSettingGoBackCondition]] = None """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Optional[List[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample]] = None + negative_finetune_examples: Optional[List[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample]] = None """Don't transition to this node""" - positive_finetune_examples: Optional[List[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample]] = None + positive_finetune_examples: Optional[List[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample]] = None """Transition to this node""" -class NodeConversationNodeModelChoice(BaseModel): +class NodeSubagentNodeModelChoice(BaseModel): model: Literal[ "gpt-4.1", "gpt-4.1-mini", @@ -7795,14 +8933,14 @@ class NodeConversationNodeModelChoice(BaseModel): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(BaseModel): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(BaseModel): prompt: str """Prompt condition text""" type: Literal["prompt"] -class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(BaseModel): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(BaseModel): left: str """Left side of the equation""" @@ -7816,8 +8954,8 @@ class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEq """ -class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(BaseModel): - equations: List[NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(BaseModel): + equations: List[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation] operator: Literal["||", "&&"] @@ -7827,31 +8965,31 @@ class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(B """Must be "Skip response" for skip response edge""" -class NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(BaseModel): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(BaseModel): prompt: Literal["Skip response"] """Must be "Skip response" for skip response edge""" type: Literal["prompt"] -NodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, - NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, - NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeSkipResponseEdge(BaseModel): +class NodeSubagentNodeSkipResponseEdge(BaseModel): id: str """Unique identifier for the edge""" - transition_condition: NodeConversationNodeSkipResponseEdgeTransitionCondition + transition_condition: NodeSubagentNodeSkipResponseEdgeTransitionCondition destination_node_id: Optional[str] = None """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(BaseModel): +class NodeSubagentNodeToolEndCallTool(BaseModel): name: str """Name of the tool. @@ -7886,7 +9024,7 @@ class NodeConversationNodeToolEndCallTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(BaseModel): number: str """ The number to transfer to in E.164 format or a dynamic variable like @@ -7904,7 +9042,7 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """ -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(BaseModel): prompt: str """The prompt to be used to help infer the transfer destination. @@ -7917,13 +9055,13 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """The type of transfer destination.""" -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(BaseModel): type: Literal["cold_transfer"] """The type of the transfer.""" @@ -7951,7 +9089,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(BaseModel): """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -7963,7 +9101,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -7972,7 +9110,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -7981,13 +9119,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -7996,7 +9134,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -8005,13 +9143,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(BaseModel): type: Literal["warm_transfer"] """The type of the transfer.""" @@ -8021,9 +9159,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr enable_bridge_audio_cue: Optional[bool] = None """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: Optional[NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption] = ( - None - ) + ivr_option: Optional[NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption] = None """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -8039,7 +9175,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ private_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ] = None """ If set, when transfer is connected, will say the handoff message only to the @@ -8048,7 +9184,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ public_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ] = None """ If set, when transfer is successful, will say the handoff message to both the @@ -8070,7 +9206,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( BaseModel ): """The agent that will mediate the transfer decision.""" @@ -8087,7 +9223,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The version of the transfer agent to use.""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( BaseModel ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -8099,7 +9235,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ transfer_agent: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent ] = None """The agent that will mediate the transfer decision.""" @@ -8110,7 +9246,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( BaseModel ): prompt: Optional[str] = None @@ -8119,7 +9255,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Optional[Literal["prompt"]] = None -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( BaseModel ): message: Optional[str] = None @@ -8128,15 +9264,15 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Optional[Literal["static_message"]] = None -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(BaseModel): agentic_transfer_config: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ) """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -8150,7 +9286,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The music to play while the caller is being transferred.""" public_handoff_option: Optional[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption ] = None """ If set, when transfer is successful, will say the handoff message to both the @@ -8172,14 +9308,14 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNodeToolTransferCallTool(BaseModel): +class NodeSubagentNodeToolTransferCallTool(BaseModel): name: str """Name of the tool. @@ -8187,9 +9323,9 @@ class NodeConversationNodeToolTransferCallTool(BaseModel): tools + state tools + state edges). """ - transfer_destination: NodeConversationNodeToolTransferCallToolTransferDestination + transfer_destination: NodeSubagentNodeToolTransferCallToolTransferDestination - transfer_option: NodeConversationNodeToolTransferCallToolTransferOption + transfer_option: NodeSubagentNodeToolTransferCallToolTransferOption type: Literal["transfer_call"] @@ -8228,7 +9364,7 @@ class NodeConversationNodeToolTransferCallTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolCheckAvailabilityCalTool(BaseModel): +class NodeSubagentNodeToolCheckAvailabilityCalTool(BaseModel): cal_api_key: str """ Cal.com Api key that have access to the cal.com event you want to check @@ -8268,7 +9404,7 @@ class NodeConversationNodeToolCheckAvailabilityCalTool(BaseModel): """ -class NodeConversationNodeToolBookAppointmentCalTool(BaseModel): +class NodeSubagentNodeToolBookAppointmentCalTool(BaseModel): cal_api_key: str """ Cal.com Api key that have access to the cal.com event you want to book @@ -8308,7 +9444,7 @@ class NodeConversationNodeToolBookAppointmentCalTool(BaseModel): """ -class NodeConversationNodeToolAgentSwapTool(BaseModel): +class NodeSubagentNodeToolAgentSwapTool(BaseModel): agent_id: str """The id of the agent to swap to.""" @@ -8359,7 +9495,7 @@ class NodeConversationNodeToolAgentSwapTool(BaseModel): """Webhook setting for the agent swap, defaults to only source.""" -class NodeConversationNodeToolPressDigitTool(BaseModel): +class NodeSubagentNodeToolPressDigitTool(BaseModel): name: str """Name of the tool. @@ -8384,14 +9520,14 @@ class NodeConversationNodeToolPressDigitTool(BaseModel): """ -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(BaseModel): content: Optional[str] = None """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Optional[Literal["predefined"]] = None -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel): prompt: Optional[str] = None """The prompt to be used to help infer the SMS content. @@ -8402,13 +9538,13 @@ class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(BaseModel) type: Optional[Literal["inferred"]] = None -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class NodeConversationNodeToolSendSMSTool(BaseModel): +class NodeSubagentNodeToolSendSMSTool(BaseModel): name: str """Name of the tool. @@ -8416,7 +9552,7 @@ class NodeConversationNodeToolSendSMSTool(BaseModel): tools + state tools + state edges). """ - sms_content: NodeConversationNodeToolSendSMSToolSMSContent + sms_content: NodeSubagentNodeToolSendSMSToolSMSContent type: Literal["send_sms"] @@ -8426,8 +9562,28 @@ class NodeConversationNodeToolSendSMSTool(BaseModel): to call the tool. """ + execution_message_description: Optional[str] = None + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: Optional[bool] = None + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + -class NodeConversationNodeToolCustomToolParameters(BaseModel): +class NodeSubagentNodeToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -8450,7 +9606,7 @@ class NodeConversationNodeToolCustomToolParameters(BaseModel): """ -class NodeConversationNodeToolCustomTool(BaseModel): +class NodeSubagentNodeToolCustomTool(BaseModel): name: str """Name of the tool. @@ -8498,7 +9654,7 @@ class NodeConversationNodeToolCustomTool(BaseModel): method: Optional[Literal["GET", "POST", "PUT", "PATCH", "DELETE"]] = None """Method to use for the request, default to POST.""" - parameters: Optional[NodeConversationNodeToolCustomToolParameters] = None + parameters: Optional[NodeSubagentNodeToolCustomToolParameters] = None """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -8541,7 +9697,7 @@ class NodeConversationNodeToolCustomTool(BaseModel): """ -class NodeConversationNodeToolCodeTool(BaseModel): +class NodeSubagentNodeToolCodeTool(BaseModel): code: str """JavaScript code to execute in the sandbox.""" @@ -8598,7 +9754,7 @@ class NodeConversationNodeToolCodeTool(BaseModel): """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -8608,6 +9764,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -8618,7 +9781,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): choices: List[str] """The possible values of the variable, must be non empty array.""" @@ -8631,6 +9794,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -8638,7 +9808,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -8648,6 +9818,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -8655,7 +9832,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): description: str """Description of the variable.""" @@ -8665,6 +9842,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -8672,15 +9856,15 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa """ -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class NodeConversationNodeToolExtractDynamicVariableTool(BaseModel): +class NodeSubagentNodeToolExtractDynamicVariableTool(BaseModel): description: str """ Describes what the tool does, sometimes can also include information about when @@ -8697,11 +9881,11 @@ class NodeConversationNodeToolExtractDynamicVariableTool(BaseModel): type: Literal["extract_dynamic_variable"] - variables: List[NodeConversationNodeToolExtractDynamicVariableToolVariable] + variables: List[NodeSubagentNodeToolExtractDynamicVariableToolVariable] """The variables to be extracted.""" -class NodeConversationNodeToolBridgeTransferTool(BaseModel): +class NodeSubagentNodeToolBridgeTransferTool(BaseModel): name: str """Name of the tool. @@ -8738,7 +9922,7 @@ class NodeConversationNodeToolBridgeTransferTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolCancelTransferTool(BaseModel): +class NodeSubagentNodeToolCancelTransferTool(BaseModel): name: str """Name of the tool. @@ -8775,7 +9959,7 @@ class NodeConversationNodeToolCancelTransferTool(BaseModel): """If true, will speak during execution.""" -class NodeConversationNodeToolMcpTool(BaseModel): +class NodeSubagentNodeToolMcpTool(BaseModel): description: str """Description of the MCP tool.""" @@ -8828,67 +10012,67 @@ class NodeConversationNodeToolMcpTool(BaseModel): """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, ] -class NodeConversationNode(BaseModel): +class NodeSubagentNode(BaseModel): id: str """Unique identifier for the node""" - instruction: NodeConversationNodeInstruction + instruction: NodeSubagentNodeInstruction - type: Literal["conversation"] + type: Literal["subagent"] """Type of the node""" - always_edge: Optional[NodeConversationNodeAlwaysEdge] = None + always_edge: Optional[NodeSubagentNodeAlwaysEdge] = None - display_position: Optional[NodeConversationNodeDisplayPosition] = None + display_position: Optional[NodeSubagentNodeDisplayPosition] = None """Position for frontend display""" - edges: Optional[List[NodeConversationNodeEdge]] = None + edges: Optional[List[NodeSubagentNodeEdge]] = None - finetune_conversation_examples: Optional[List[NodeConversationNodeFinetuneConversationExample]] = None + finetune_conversation_examples: Optional[List[NodeSubagentNodeFinetuneConversationExample]] = None - finetune_transition_examples: Optional[List[NodeConversationNodeFinetuneTransitionExample]] = None + finetune_transition_examples: Optional[List[NodeSubagentNodeFinetuneTransitionExample]] = None - global_node_setting: Optional[NodeConversationNodeGlobalNodeSetting] = None + global_node_setting: Optional[NodeSubagentNodeGlobalNodeSetting] = None interruption_sensitivity: Optional[float] = None knowledge_base_ids: Optional[List[str]] = None """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - api_model_choice: Optional[NodeConversationNodeModelChoice] = FieldInfo(alias="model_choice", default=None) + api_model_choice: Optional[NodeSubagentNodeModelChoice] = FieldInfo(alias="model_choice", default=None) name: Optional[str] = None """Optional name for display purposes""" responsiveness: Optional[float] = None - skip_response_edge: Optional[NodeConversationNodeSkipResponseEdge] = None + skip_response_edge: Optional[NodeSubagentNodeSkipResponseEdge] = None tool_ids: Optional[List[str]] = None """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[List[NodeConversationNodeTool]] = None - """The tools owned by this conversation node. + tools: Optional[List[NodeSubagentNodeTool]] = None + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -11445,6 +12629,13 @@ class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(BaseModel): type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -11468,6 +12659,13 @@ class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -11485,6 +12683,13 @@ class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(BaseModel): type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -11502,6 +12707,13 @@ class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(BaseModel): type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -13340,6 +14552,7 @@ class NodeCancelTransferNode(BaseModel): Node: TypeAlias = Union[ NodeConversationNode, + NodeSubagentNode, NodeEndNode, NodeFunctionNode, NodeCodeNode, @@ -13356,6 +14569,39 @@ class NodeCancelTransferNode(BaseModel): ] +class NoteDisplayPosition(BaseModel): + """Position of the note on the canvas.""" + + x: Optional[float] = None + + y: Optional[float] = None + + +class NoteSize(BaseModel): + """Dimensions of the note on the canvas.""" + + height: Optional[float] = None + + width: Optional[float] = None + + +class Note(BaseModel): + id: str + """Unique identifier for the note.""" + + content: str + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: NoteDisplayPosition + """Position of the note on the canvas.""" + + size: NoteSize + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. @@ -13616,6 +14862,9 @@ class ConversationFlowResponse(BaseModel): nodes: Optional[List[Node]] = None """Array of nodes in the conversation flow.""" + notes: Optional[List[Note]] = None + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] = None """ID of the start node in the conversation flow.""" diff --git a/src/retell/types/conversation_flow_update_params.py b/src/retell/types/conversation_flow_update_params.py index 704cb132..088cf470 100644 --- a/src/retell/types/conversation_flow_update_params.py +++ b/src/retell/types/conversation_flow_update_params.py @@ -61,48 +61,95 @@ "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "ComponentNodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "ComponentNodeConversationNodeTool", - "ComponentNodeConversationNodeToolEndCallTool", - "ComponentNodeConversationNodeToolTransferCallTool", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestination", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "ComponentNodeConversationNodeToolTransferCallToolTransferOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "ComponentNodeConversationNodeToolCheckAvailabilityCalTool", - "ComponentNodeConversationNodeToolBookAppointmentCalTool", - "ComponentNodeConversationNodeToolAgentSwapTool", - "ComponentNodeConversationNodeToolPressDigitTool", - "ComponentNodeConversationNodeToolSendSMSTool", - "ComponentNodeConversationNodeToolSendSMSToolSMSContent", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "ComponentNodeConversationNodeToolCustomTool", - "ComponentNodeConversationNodeToolCustomToolParameters", - "ComponentNodeConversationNodeToolCodeTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableTool", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "ComponentNodeConversationNodeToolBridgeTransferTool", - "ComponentNodeConversationNodeToolCancelTransferTool", - "ComponentNodeConversationNodeToolMcpTool", + "ComponentNodeSubagentNode", + "ComponentNodeSubagentNodeInstruction", + "ComponentNodeSubagentNodeAlwaysEdge", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeDisplayPosition", + "ComponentNodeSubagentNodeEdge", + "ComponentNodeSubagentNodeEdgeTransitionCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeFinetuneConversationExample", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscript", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeFinetuneTransitionExample", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSetting", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "ComponentNodeSubagentNodeModelChoice", + "ComponentNodeSubagentNodeSkipResponseEdge", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "ComponentNodeSubagentNodeTool", + "ComponentNodeSubagentNodeToolEndCallTool", + "ComponentNodeSubagentNodeToolTransferCallTool", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestination", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "ComponentNodeSubagentNodeToolCheckAvailabilityCalTool", + "ComponentNodeSubagentNodeToolBookAppointmentCalTool", + "ComponentNodeSubagentNodeToolAgentSwapTool", + "ComponentNodeSubagentNodeToolPressDigitTool", + "ComponentNodeSubagentNodeToolSendSMSTool", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContent", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "ComponentNodeSubagentNodeToolCustomTool", + "ComponentNodeSubagentNodeToolCustomToolParameters", + "ComponentNodeSubagentNodeToolCodeTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableTool", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "ComponentNodeSubagentNodeToolBridgeTransferTool", + "ComponentNodeSubagentNodeToolCancelTransferTool", + "ComponentNodeSubagentNodeToolMcpTool", "ComponentNodeEndNode", "ComponentNodeEndNodeDisplayPosition", "ComponentNodeEndNodeGlobalNodeSetting", @@ -533,6 +580,9 @@ "ComponentNodeCancelTransferNodeModelChoice", "ComponentBeginTagDisplayPosition", "ComponentMcp", + "ComponentNote", + "ComponentNoteDisplayPosition", + "ComponentNoteSize", "ComponentTool", "ComponentToolCustomTool", "ComponentToolCustomToolParameters", @@ -591,48 +641,95 @@ "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition", "NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", "NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2", - "NodeConversationNodeTool", - "NodeConversationNodeToolEndCallTool", - "NodeConversationNodeToolTransferCallTool", - "NodeConversationNodeToolTransferCallToolTransferDestination", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", - "NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", - "NodeConversationNodeToolTransferCallToolTransferOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", - "NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", - "NodeConversationNodeToolCheckAvailabilityCalTool", - "NodeConversationNodeToolBookAppointmentCalTool", - "NodeConversationNodeToolAgentSwapTool", - "NodeConversationNodeToolPressDigitTool", - "NodeConversationNodeToolSendSMSTool", - "NodeConversationNodeToolSendSMSToolSMSContent", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined", - "NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred", - "NodeConversationNodeToolCustomTool", - "NodeConversationNodeToolCustomToolParameters", - "NodeConversationNodeToolCodeTool", - "NodeConversationNodeToolExtractDynamicVariableTool", - "NodeConversationNodeToolExtractDynamicVariableToolVariable", - "NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", - "NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", - "NodeConversationNodeToolBridgeTransferTool", - "NodeConversationNodeToolCancelTransferTool", - "NodeConversationNodeToolMcpTool", + "NodeSubagentNode", + "NodeSubagentNodeInstruction", + "NodeSubagentNodeAlwaysEdge", + "NodeSubagentNodeAlwaysEdgeTransitionCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeDisplayPosition", + "NodeSubagentNodeEdge", + "NodeSubagentNodeEdgeTransitionCondition", + "NodeSubagentNodeEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeFinetuneConversationExample", + "NodeSubagentNodeFinetuneConversationExampleTranscript", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2", + "NodeSubagentNodeFinetuneTransitionExample", + "NodeSubagentNodeFinetuneTransitionExampleTranscript", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1", + "NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSetting", + "NodeSubagentNodeGlobalNodeSettingGoBackCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition", + "NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1", + "NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2", + "NodeSubagentNodeModelChoice", + "NodeSubagentNodeSkipResponseEdge", + "NodeSubagentNodeSkipResponseEdgeTransitionCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation", + "NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2", + "NodeSubagentNodeTool", + "NodeSubagentNodeToolEndCallTool", + "NodeSubagentNodeToolTransferCallTool", + "NodeSubagentNodeToolTransferCallToolTransferDestination", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined", + "NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred", + "NodeSubagentNodeToolTransferCallToolTransferOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt", + "NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage", + "NodeSubagentNodeToolCheckAvailabilityCalTool", + "NodeSubagentNodeToolBookAppointmentCalTool", + "NodeSubagentNodeToolAgentSwapTool", + "NodeSubagentNodeToolPressDigitTool", + "NodeSubagentNodeToolSendSMSTool", + "NodeSubagentNodeToolSendSMSToolSMSContent", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined", + "NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred", + "NodeSubagentNodeToolCustomTool", + "NodeSubagentNodeToolCustomToolParameters", + "NodeSubagentNodeToolCodeTool", + "NodeSubagentNodeToolExtractDynamicVariableTool", + "NodeSubagentNodeToolExtractDynamicVariableToolVariable", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData", + "NodeSubagentNodeToolBridgeTransferTool", + "NodeSubagentNodeToolCancelTransferTool", + "NodeSubagentNodeToolMcpTool", "NodeEndNode", "NodeEndNodeDisplayPosition", "NodeEndNodeGlobalNodeSetting", @@ -1061,6 +1158,9 @@ "NodeCancelTransferNodeInstructionNodeInstructionPrompt", "NodeCancelTransferNodeInstructionNodeInstructionStaticText", "NodeCancelTransferNodeModelChoice", + "Note", + "NoteDisplayPosition", + "NoteSize", "Tool", "ToolCustomTool", "ToolCustomToolParameters", @@ -1120,6 +1220,9 @@ class ConversationFlowUpdateParams(TypedDict, total=False): nodes: Iterable[Node] """Array of nodes in the conversation flow.""" + notes: Optional[Iterable[Note]] + """Visual annotations displayed on the flow canvas.""" + start_node_id: Optional[str] """ID of the start node in the conversation flow.""" @@ -1607,717 +1710,497 @@ class ComponentNodeConversationNodeSkipResponseEdge(TypedDict, total=False): """ID of the destination node""" -class ComponentNodeConversationNodeToolEndCallTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. +class ComponentNodeConversationNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + instruction: Required[ComponentNodeConversationNodeInstruction] - type: Required[Literal["end_call"]] + type: Required[Literal["conversation"]] + """Type of the node""" - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + always_edge: ComponentNodeConversationNodeAlwaysEdge - execution_message_description: str - """Describes what to say to user when ending the call. + display_position: ComponentNodeConversationNodeDisplayPosition + """Position for frontend display""" - Only applicable when speak_during_execution is true. - """ + edges: Iterable[ComponentNodeConversationNodeEdge] - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + finetune_conversation_examples: Iterable[ComponentNodeConversationNodeFinetuneConversationExample] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ + finetune_transition_examples: Iterable[ComponentNodeConversationNodeFinetuneTransitionExample] - speak_during_execution: bool - """If true, will speak during execution.""" + global_node_setting: ComponentNodeConversationNodeGlobalNodeSetting + interruption_sensitivity: Optional[float] -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined( - TypedDict, total=False -): - number: Required[str] - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - type: Required[Literal["predefined"]] - """The type of transfer destination.""" + model_choice: ComponentNodeConversationNodeModelChoice - extension: str - """Extension digits to dial after the main number connects. + name: str + """Optional name for display purposes""" - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ + responsiveness: Optional[float] + skip_response_edge: ComponentNodeConversationNodeSkipResponseEdge -class ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred( - TypedDict, total=False -): - prompt: Required[str] - """The prompt to be used to help infer the transfer destination. + voice_speed: Optional[float] - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. - """ - type: Required[Literal["inferred"]] - """The type of transfer destination.""" +class ComponentNodeSubagentNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + type: Required[Literal["prompt"]] + """Type of instruction""" -ComponentNodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - ComponentNodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, -] +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): - type: Required[Literal["cold_transfer"]] - """The type of the transfer.""" + type: Required[Literal["prompt"]] - cold_transfer_mode: Literal["sip_refer", "sip_invite"] - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. - """ + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + right: str + """Right side of the equation. - If not set, falls back to the agent-level `ring_duration_ms`. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption( - TypedDict, total=False -): - """IVR navigation option to run when doing human detection. - - This prompt will guide the AI on how to navigate the IVR system. - """ +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + operator: Required[Literal["||", "&&"]] - type: Literal["prompt"] + type: Required[Literal["equation"]] + prompt: Literal["Always"] + """Must be "Always" for always edge""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Literal["prompt"] +class ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" + type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" - type: Literal["static_message"] +ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, +] -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, -] +class ComponentNodeSubagentNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[ComponentNodeSubagentNodeAlwaysEdgeTransitionCondition] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: str + """ID of the destination node""" - type: Literal["prompt"] +class ComponentNodeSubagentNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + x: float - type: Literal["static_message"] + y: float -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] +class ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + type: Required[Literal["prompt"]] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): - type: Required[Literal["warm_transfer"]] - """The type of the transfer.""" - agent_detection_timeout_ms: float - """The time to wait before considering transfer fails.""" +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - ivr_option: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption - """IVR navigation option to run when doing human detection. + right: str + """Right side of the equation. - This prompt will guide the AI on how to navigate the IVR system. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" - opt_out_human_detection: bool - """If set to true, will not perform human detection for the transfer. +class ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] - Default to false. - """ + operator: Required[Literal["||", "&&"]] - private_handoff_option: ( - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption - ) - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ + type: Required[Literal["equation"]] - public_handoff_option: ( - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption - ) - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ +ComponentNodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeEdgeTransitionConditionEquationCondition, +] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. - If not set, falls back to the agent-level `ring_duration_ms`. - """ +class ComponentNodeSubagentNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[ComponentNodeSubagentNodeEdgeTransitionCondition] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - TypedDict, total=False -): - """The agent that will mediate the transfer decision.""" + destination_node_id: str + """ID of the destination node""" - agent_id: Required[str] - """The agent ID of the transfer agent. - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - agent_version: Required[float] - """The version of the transfer agent to use.""" + role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( - TypedDict, total=False -): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] - """The action to take when the transfer agent times out without making a decision. + name: Required[str] - Defaults to cancel_transfer. - """ + role: Required[Literal["tool_call_invocation"]] - transfer_agent: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - """The agent that will mediate the transfer decision.""" + tool_call_id: Required[str] - transfer_timeout_ms: float - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ +class ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + role: Required[Literal["tool_call_result"]] - type: Literal["prompt"] + tool_call_id: Required[str] -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" +ComponentNodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, +] - type: Literal["static_message"] +class ComponentNodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" -ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + transcript: Required[Iterable[ComponentNodeSubagentNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" -class ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer( - TypedDict, total=False -): - agentic_transfer_config: Required[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - ] - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - - type: Required[Literal["agentic_warm_transfer"]] - """The type of the transfer.""" - - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" - - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - public_handoff_option: ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ + role: Required[Literal["agent", "user"]] - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - If not set, falls back to the agent-level `ring_duration_ms`. - """ + name: Required[str] + role: Required[Literal["tool_call_invocation"]] -ComponentNodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - ComponentNodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, -] + tool_call_id: Required[str] -class ComponentNodeConversationNodeToolTransferCallTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. +class ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ + role: Required[Literal["tool_call_result"]] - transfer_destination: Required[ComponentNodeConversationNodeToolTransferCallToolTransferDestination] + tool_call_id: Required[str] - transfer_option: Required[ComponentNodeConversationNodeToolTransferCallToolTransferOption] - type: Required[Literal["transfer_call"]] +ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - execution_message_description: str - """Describes what to say to user when transferring the call. + transcript: Required[Iterable[ComponentNodeSubagentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" - Only applicable when speak_during_execution is true. - """ + destination_node_id: str + """Optional destination node ID""" - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" - ignore_e164_validation: bool - """If true, the e.164 validation will be ignored for the from_number. + type: Required[Literal["prompt"]] - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. - """ - speak_during_execution: bool - """If true, will speak during execution.""" +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] -class ComponentNodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to check - availability for. - """ + right: str + """Right side of the equation. - event_type_id: Required[Union[float, str]] - """ - Cal.com event type id number for the cal.com event you want to check - availability for. Can be a number or a dynamic variable in the format - `{{variable_name}}` that will be resolved at runtime. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - name: Required[str] - """Name of the tool. - - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Required[Literal["check_availability_cal"]] +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + operator: Required[Literal["||", "&&"]] - timezone: str - """ - Timezone to be used when checking availability, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ + type: Required[Literal["equation"]] -class ComponentNodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to book - appointment. - """ +ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] - event_type_id: Required[Union[float, str]] - """Cal.com event type id number for the cal.com event you want to book appointment. - Can be a number or a dynamic variable in the format `{{variable_name}}` that - will be resolved at runtime. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - name: Required[str] - """Name of the tool. + transition_condition: Required[ComponentNodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + destination_node_id: str + """ID of the destination node""" - type: Required[Literal["book_appointment_cal"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - timezone: str - """ - Timezone to be used when booking appointment, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ + role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeToolAgentSwapTool(TypedDict, total=False): - agent_id: Required[str] - """The id of the agent to swap to.""" +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). - """ + role: Required[Literal["tool_call_invocation"]] - post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] - """Post call analysis setting for the agent swap.""" + tool_call_id: Required[str] - type: Required[Literal["agent_swap"]] - agent_version: float - """The version of the agent to swap to. +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - If not specified, will use the latest version. - """ + role: Required[Literal["tool_call_result"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ + tool_call_id: Required[str] - execution_message_description: str - """The message for the agent to speak when executing agent swap.""" - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. +ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - keep_current_language: bool - """If true, keep the current language when swapping agents. Defaults to false.""" +class ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - keep_current_voice: bool - """If true, keep the current voice when swapping agents. Defaults to false.""" - speak_during_execution: bool +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] - """Webhook setting for the agent swap, defaults to only source.""" + role: Required[Literal["agent", "user"]] -class ComponentNodeConversationNodeToolPressDigitTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + name: Required[str] - type: Required[Literal["press_digit"]] + role: Required[Literal["tool_call_invocation"]] - delay_ms: int - """ - Delay in milliseconds before pressing the digit, because a lot of IVR systems - speak very slowly, and a delay can make sure the agent hears the full menu. - Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). - """ + tool_call_id: Required[str] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): - content: str - """The static message to be sent in the SMS. Can contain dynamic variables.""" + role: Required[Literal["tool_call_result"]] - type: Literal["predefined"] + tool_call_id: Required[str] -class ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): - prompt: str - """The prompt to be used to help infer the SMS content. +ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right message to send. Can contain dynamic variables. - """ - type: Literal["inferred"] +class ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" -ComponentNodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - ComponentNodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, -] +class ComponentNodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ -class ComponentNodeConversationNodeToolSendSMSTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. + go_back_conditions: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). + There would be no destination_node_id for these edges. """ - sms_content: Required[ComponentNodeConversationNodeToolSendSMSToolSMSContent] + negative_finetune_examples: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" - type: Required[Literal["send_sms"]] - - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ - - -class ComponentNodeConversationNodeToolCustomToolParameters(TypedDict, total=False): - """The parameters the functions accepts, described as a JSON Schema object. - - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. - """ - - properties: Required[Dict[str, object]] - """ - The value of properties is an object, where each key is the name of a property - and each value is a schema used to validate that property. - """ + positive_finetune_examples: Iterable[ComponentNodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" - type: Required[Literal["object"]] - """Type must be "object" for a JSON Schema object.""" - required: SequenceNotStr[str] - """List of names of required property when generating this parameter. +class ComponentNodeSubagentNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" - LLM will do its best to generate the required properties in its function - arguments. Property must exist in properties. - """ + type: Required[Literal["cascading"]] + """Type of model choice""" + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeConversationNodeToolCustomTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - type: Required[Literal["custom"]] + type: Required[Literal["prompt"]] - url: Required[str] - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ - args_at_root: bool - """ - If set to true, the parameters will be passed as root level JSON object instead - of nested under "args". - """ +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - description: str - """Describes what this tool does and when to call this tool.""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - execution_message_description: str - """The description for the sentence agent say during execution. + right: str + """Right side of the equation. - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] - headers: Dict[str, str] - """Headers to add to the request.""" + operator: Required[Literal["||", "&&"]] - method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] - """Method to use for the request, default to POST.""" + type: Required[Literal["equation"]] - parameters: ComponentNodeConversationNodeToolCustomToolParameters - """The parameters the functions accepts, described as a JSON Schema object. + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. Omitting parameters defines a function with - an empty parameter list. - """ - query_params: Dict[str, str] - """Query parameters to append to the request URL.""" +class ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the response body. + type: Required[Literal["prompt"]] - These values will be extracted from the response and made available as dynamic - variables for use. - """ - speak_after_execution: bool - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ +ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + ComponentNodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, +] - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. - """ - timeout_ms: int - """The maximum time in milliseconds the tool can run before it's considered - timeout. +class ComponentNodeSubagentNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - If the tool times out, the agent would have that info. The minimum value allowed - is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, - this is set to 120,000 ms (2 min). - """ + transition_condition: Required[ComponentNodeSubagentNodeSkipResponseEdgeTransitionCondition] + destination_node_id: str + """ID of the destination node""" -class ComponentNodeConversationNodeToolCodeTool(TypedDict, total=False): - code: Required[str] - """JavaScript code to execute in the sandbox.""" +class ComponentNodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 (no space allowed). """ - type: Required[Literal["code"]] + type: Required[Literal["end_call"]] description: str - """Describes what this tool does and when to call this tool.""" + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ execution_message_description: str - """The description for the sentence agent say during execution. + """Describes what to say to user when ending the call. Only applicable when speak_during_execution is true. """ @@ -2330,949 +2213,1073 @@ class ComponentNodeConversationNodeToolCodeTool(TypedDict, total=False): execution_message_description directly. Defaults to "prompt". """ - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the code execution result. + speak_during_execution: bool + """If true, will speak during execution.""" - These mapped values will be extracted and added as dynamic variables. - """ - speak_after_execution: bool +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined( + TypedDict, total=False +): + number: Required[str] """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. """ - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the tool. - """ + type: Required[Literal["predefined"]] + """The type of transfer destination.""" - timeout_ms: int - """The maximum time in milliseconds the code can run before it's considered - timeout. + extension: str + """Extension digits to dial after the main number connects. - Defaults to 30,000 ms (30 s). + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" - - name: Required[str] - """Name of the variable.""" - - type: Required[Literal["string"]] - """Type of the variable to extract.""" - - examples: SequenceNotStr[str] - """Examples of the variable value to teach model the style and syntax.""" - - required: bool - """Whether this data is required. +class ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred( + TypedDict, total=False +): + prompt: Required[str] + """The prompt to be used to help infer the transfer destination. - If true and the data is not extracted, the call will be marked as unsuccessful. + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. """ + type: Required[Literal["inferred"]] + """The type of transfer destination.""" -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): - choices: Required[SequenceNotStr[str]] - """The possible values of the variable, must be non empty array.""" - description: Required[str] - """Description of the variable.""" +ComponentNodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + ComponentNodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["enum"]] - """Type of the variable to extract.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): + type: Required[Literal["cold_transfer"]] + """The type of the transfer.""" - required: bool - """Whether this data is required. + cold_transfer_mode: Literal["sip_refer", "sip_invite"] + """The mode of the cold transfer. - If true and the data is not extracted, the call will be marked as unsuccessful. + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. """ + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. - name: Required[str] - """Name of the variable.""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - type: Required[Literal["boolean"]] - """Type of the variable to extract.""" - required: bool - """Whether this data is required. +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption( + TypedDict, total=False +): + """IVR navigation option to run when doing human detection. - If true and the data is not extracted, the call will be marked as unsuccessful. + This prompt will guide the AI on how to navigate the IVR system. """ + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" + type: Literal["prompt"] - name: Required[str] - """Name of the variable.""" - type: Required[Literal["number"]] - """Type of the variable to extract.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - required: bool - """Whether this data is required. + type: Literal["prompt"] - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" -ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - ComponentNodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, -] + type: Literal["static_message"] -class ComponentNodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): - description: Required[str] - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +] - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - type: Required[Literal["extract_dynamic_variable"]] + type: Literal["prompt"] - variables: Required[Iterable[ComponentNodeConversationNodeToolExtractDynamicVariableToolVariable]] - """The variables to be extracted.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" -class ComponentNodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. + type: Literal["static_message"] - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ - type: Required[Literal["bridge_transfer"]] +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - description: str - """Describes what the tool does. - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it bridges the original - caller to the transfer target and ends the transfer agent call. - """ +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): + type: Required[Literal["warm_transfer"]] + """The type of the transfer.""" - execution_message_description: str - """Describes what to say to user when bridging the transfer. + agent_detection_timeout_ms: float + """The time to wait before considering transfer fails.""" - Only applicable when speak_during_execution is true. - """ + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + ivr_option: ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + """IVR navigation option to run when doing human detection. - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + This prompt will guide the AI on how to navigate the IVR system. """ - speak_during_execution: bool - """If true, will speak during execution.""" - + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" -class ComponentNodeConversationNodeToolCancelTransferTool(TypedDict, total=False): - name: Required[str] - """Name of the tool. + opt_out_human_detection: bool + """If set to true, will not perform human detection for the transfer. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). + Default to false. """ - type: Required[Literal["cancel_transfer"]] - - description: str - """Describes what the tool does. - - This tool is only available to transfer agents (agents with isTransferAgent set - to true) in agentic warm transfer mode. When invoked, it cancels the transfer, - returns the original caller to the main agent, and ends the transfer agent call. + private_handoff_option: ( + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + ) """ - - execution_message_description: str - """Describes what to say to user when cancelling the transfer. - - Only applicable when speak_during_execution is true. + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. - - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". + public_handoff_option: ( + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + ) + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. """ - speak_during_execution: bool - """If true, will speak during execution.""" + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. -class ComponentNodeConversationNodeToolMcpTool(TypedDict, total=False): - description: Required[str] - """Description of the MCP tool.""" + If not set, falls back to the agent-level `ring_duration_ms`. + """ - name: Required[str] - """Name of the MCP tool.""" - type: Required[Literal["mcp"]] +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + TypedDict, total=False +): + """The agent that will mediate the transfer decision.""" - execution_message_description: str - """The description for the sentence agent say during execution. + agent_id: Required[str] + """The agent ID of the transfer agent. - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. + agent_version: Required[float] + """The version of the transfer agent to use.""" - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - input_schema: Dict[str, str] - """The input schema of the MCP tool.""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( + TypedDict, total=False +): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - mcp_id: str - """Unique id of the MCP.""" + action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] + """The action to take when the transfer agent times out without making a decision. - response_variables: Dict[str, str] - """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response + Defaults to cancel_transfer. """ - speak_after_execution: bool - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ + transfer_agent: ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + """The agent that will mediate the transfer decision.""" - speak_during_execution: bool + transfer_timeout_ms: float """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). """ -ComponentNodeConversationNodeTool: TypeAlias = Union[ - ComponentNodeConversationNodeToolEndCallTool, - ComponentNodeConversationNodeToolTransferCallTool, - ComponentNodeConversationNodeToolCheckAvailabilityCalTool, - ComponentNodeConversationNodeToolBookAppointmentCalTool, - ComponentNodeConversationNodeToolAgentSwapTool, - ComponentNodeConversationNodeToolPressDigitTool, - ComponentNodeConversationNodeToolSendSMSTool, - ComponentNodeConversationNodeToolCustomTool, - ComponentNodeConversationNodeToolCodeTool, - ComponentNodeConversationNodeToolExtractDynamicVariableTool, - ComponentNodeConversationNodeToolBridgeTransferTool, - ComponentNodeConversationNodeToolCancelTransferTool, - ComponentNodeConversationNodeToolMcpTool, -] - - -class ComponentNodeConversationNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" - - instruction: Required[ComponentNodeConversationNodeInstruction] - - type: Required[Literal["conversation"]] - """Type of the node""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - always_edge: ComponentNodeConversationNodeAlwaysEdge + type: Literal["prompt"] - display_position: ComponentNodeConversationNodeDisplayPosition - """Position for frontend display""" - edges: Iterable[ComponentNodeConversationNodeEdge] +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - finetune_conversation_examples: Iterable[ComponentNodeConversationNodeFinetuneConversationExample] + type: Literal["static_message"] - finetune_transition_examples: Iterable[ComponentNodeConversationNodeFinetuneTransitionExample] - global_node_setting: ComponentNodeConversationNodeGlobalNodeSetting +ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - interruption_sensitivity: Optional[float] - knowledge_base_ids: Optional[SequenceNotStr[str]] - """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" +class ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer( + TypedDict, total=False +): + agentic_transfer_config: Required[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + ] + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - model_choice: ComponentNodeConversationNodeModelChoice + type: Required[Literal["agentic_warm_transfer"]] + """The type of the transfer.""" - name: str - """Optional name for display purposes""" + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" - responsiveness: Optional[float] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" - skip_response_edge: ComponentNodeConversationNodeSkipResponseEdge + public_handoff_option: ( + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ) + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - tool_ids: Optional[SequenceNotStr[str]] + show_transferee_as_caller: bool """ - The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. """ - tools: Optional[Iterable[ComponentNodeConversationNodeTool]] - """The tools owned by this conversation node. + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. - This includes other tool types like transfer_call, agent_swap, etc. + If not set, falls back to the agent-level `ring_duration_ms`. """ - voice_speed: Optional[float] +ComponentNodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + ComponentNodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +] -class ComponentNodeEndNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" - x: float - - y: float +class ComponentNodeSubagentNodeToolTransferCallTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + transfer_destination: Required[ComponentNodeSubagentNodeToolTransferCallToolTransferDestination] - type: Required[Literal["prompt"]] + transfer_option: Required[ComponentNodeSubagentNodeToolTransferCallToolTransferOption] + type: Required[Literal["transfer_call"]] -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - right: str - """Right side of the equation. + execution_message_description: str + """Describes what to say to user when transferring the call. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Only applicable when speak_during_execution is true. """ + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. -class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - type: Required[Literal["equation"]] + ignore_e164_validation: bool + """If true, the e.164 validation will be ignored for the from_number. + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ -ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] + speak_during_execution: bool + """If true, will speak during execution.""" -class ComponentNodeEndNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" +class ComponentNodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): + cal_api_key: Required[str] + """ + Cal.com Api key that have access to the cal.com event you want to check + availability for. + """ - transition_condition: Required[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition] + event_type_id: Required[Union[float, str]] + """ + Cal.com event type id number for the cal.com event you want to check + availability for. Can be a number or a dynamic variable in the format + `{{variable_name}}` that will be resolved at runtime. + """ - destination_node_id: str - """ID of the destination node""" + name: Required[str] + """Name of the tool. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + type: Required[Literal["check_availability_cal"]] - role: Required[Literal["agent", "user"]] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + timezone: str + """ + Timezone to be used when checking availability, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - name: Required[str] +class ComponentNodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): + cal_api_key: Required[str] + """ + Cal.com Api key that have access to the cal.com event you want to book + appointment. + """ - role: Required[Literal["tool_call_invocation"]] + event_type_id: Required[Union[float, str]] + """Cal.com event type id number for the cal.com event you want to book appointment. - tool_call_id: Required[str] + Can be a number or a dynamic variable in the format `{{variable_name}}` that + will be resolved at runtime. + """ + name: Required[str] + """Name of the tool. -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - role: Required[Literal["tool_call_result"]] + type: Required[Literal["book_appointment_cal"]] - tool_call_id: Required[str] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + timezone: str + """ + Timezone to be used when booking appointment, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ -ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] +class ComponentNodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): + agent_id: Required[str] + """The id of the agent to swap to.""" -class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + name: Required[str] + """Name of the tool. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] + """Post call analysis setting for the agent swap.""" - role: Required[Literal["agent", "user"]] + type: Required[Literal["agent_swap"]] + agent_version: float + """The version of the agent to swap to. -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + If not specified, will use the latest version. + """ - name: Required[str] + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - role: Required[Literal["tool_call_invocation"]] + execution_message_description: str + """The message for the agent to speak when executing agent swap.""" - tool_call_id: Required[str] + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + keep_current_language: bool + """If true, keep the current language when swapping agents. Defaults to false.""" - role: Required[Literal["tool_call_result"]] + keep_current_voice: bool + """If true, keep the current voice when swapping agents. Defaults to false.""" - tool_call_id: Required[str] + speak_during_execution: bool + webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] + """Webhook setting for the agent swap, defaults to only source.""" -ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] +class ComponentNodeSubagentNodeToolPressDigitTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + type: Required[Literal["press_digit"]] -class ComponentNodeEndNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" + delay_ms: int + """ + Delay in milliseconds before pressing the digit, because a lot of IVR systems + speak very slowly, and a delay can make sure the agent hears the full menu. + Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). + """ - cool_down: float + description: str """ - The same global node won't be triggered again within the next N node - transitions. + Describes what the tool does, sometimes can also include information about when + to call the tool. """ - go_back_conditions: Iterable[ComponentNodeEndNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. - There would be no destination_node_id for these edges. - """ +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): + content: str + """The static message to be sent in the SMS. Can contain dynamic variables.""" - negative_finetune_examples: Iterable[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" + type: Literal["predefined"] - positive_finetune_examples: Iterable[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" +class ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): + prompt: str + """The prompt to be used to help infer the SMS content. -class ComponentNodeEndNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right message to send. Can contain dynamic variables. + """ - type: Required[Literal["prompt"]] - """Type of instruction""" + type: Literal["inferred"] -class ComponentNodeEndNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" +ComponentNodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + ComponentNodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, +] - type: Required[Literal["static_text"]] - """Type of instruction""" +class ComponentNodeSubagentNodeToolSendSMSTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -ComponentNodeEndNodeInstruction: TypeAlias = Union[ - ComponentNodeEndNodeInstructionNodeInstructionPrompt, ComponentNodeEndNodeInstructionNodeInstructionStaticText -] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). + """ + sms_content: Required[ComponentNodeSubagentNodeToolSendSMSToolSMSContent] -class ComponentNodeEndNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - ] - """The LLM model to use""" + type: Required[Literal["send_sms"]] - type: Required[Literal["cascading"]] - """Type of model choice""" + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" + execution_message_description: str + """Describes what to say before sending the SMS. + Only applicable when speak_during_execution is true. + """ -class ComponentNodeEndNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - type: Required[Literal["end"]] - """Type of the node""" + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - display_position: ComponentNodeEndNodeDisplayPosition - """Position for frontend display""" + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. - global_node_setting: ComponentNodeEndNodeGlobalNodeSetting + If omitted, defaults to true (same as end_call / transfer_call tools). + """ - instruction: ComponentNodeEndNodeInstruction - """What to say when ending the call, only used when speak during execution""" - model_choice: ComponentNodeEndNodeModelChoice +class ComponentNodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): + """The parameters the functions accepts, described as a JSON Schema object. - name: str - """Optional name for display purposes""" + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + """ - speak_during_execution: bool - """If true, will speak during execution""" + properties: Required[Dict[str, object]] + """ + The value of properties is an object, where each key is the name of a property + and each value is a schema used to validate that property. + """ + type: Required[Literal["object"]] + """Type must be "object" for a JSON Schema object.""" -class ComponentNodeFunctionNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" + required: SequenceNotStr[str] + """List of names of required property when generating this parameter. - x: float + LLM will do its best to generate the required properties in its function + arguments. Property must exist in properties. + """ - y: float +class ComponentNodeSubagentNodeToolCustomTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -class ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - type: Required[Literal["prompt"]] + type: Required[Literal["custom"]] + url: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ -class ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" + args_at_root: bool + """ + If set to true, the parameters will be passed as root level JSON object instead + of nested under "args". + """ - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + description: str + """Describes what this tool does and when to call this tool.""" - right: str - """Right side of the equation. + execution_message_description: str + """The description for the sentence agent say during execution. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". """ + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. -class ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation]] - - operator: Required[Literal["||", "&&"]] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - type: Required[Literal["equation"]] + headers: Dict[str, str] + """Headers to add to the request.""" + method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] + """Method to use for the request, default to POST.""" -ComponentNodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition, - ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition, -] + parameters: ComponentNodeSubagentNodeToolCustomToolParameters + """The parameters the functions accepts, described as a JSON Schema object. + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. Omitting parameters defines a function with + an empty parameter list. + """ -class ComponentNodeFunctionNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + query_params: Dict[str, str] + """Query parameters to append to the request URL.""" - transition_condition: Required[ComponentNodeFunctionNodeEdgeTransitionCondition] + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the response body. - destination_node_id: str - """ID of the destination node""" + These values will be extracted from the response and made available as dynamic + variables for use. + """ + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ - type: Required[Literal["prompt"]] + timeout_ms: int + """The maximum time in milliseconds the tool can run before it's considered + timeout. + If the tool times out, the agent would have that info. The minimum value allowed + is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, + this is set to 120,000 ms (2 min). + """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] +class ComponentNodeSubagentNodeToolCodeTool(TypedDict, total=False): + code: Required[str] + """JavaScript code to execute in the sandbox.""" - right: str - """Right side of the equation. + name: Required[str] + """Name of the tool. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). """ + type: Required[Literal["code"]] -class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation]] + description: str + """Describes what this tool does and when to call this tool.""" - operator: Required[Literal["||", "&&"]] + execution_message_description: str + """The description for the sentence agent say during execution. - type: Required[Literal["equation"]] + Only applicable when speak_during_execution is true. + """ - prompt: Literal["Else"] - """Must be "Else" for else edge""" + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ -class ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the code execution result. - type: Required[Literal["prompt"]] + These mapped values will be extracted and added as dynamic variables. + """ + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. + """ -ComponentNodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2, -] + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the tool. + """ + timeout_ms: int + """The maximum time in milliseconds the code can run before it's considered + timeout. -class ComponentNodeFunctionNodeElseEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + Defaults to 30,000 ms (30 s). + """ - transition_condition: Required[ComponentNodeFunctionNodeElseEdgeTransitionCondition] - destination_node_id: str - """ID of the destination node""" +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + name: Required[str] + """Name of the variable.""" -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + type: Required[Literal["string"]] + """Type of the variable to extract.""" - role: Required[Literal["agent", "user"]] + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] + """Examples of the variable value to teach model the style and syntax.""" -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + required: bool + """Whether this data is required. - name: Required[str] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ - role: Required[Literal["tool_call_invocation"]] - tool_call_id: Required[str] +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[SequenceNotStr[str]] + """The possible values of the variable, must be non empty array.""" + description: Required[str] + """Description of the variable.""" -class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + name: Required[str] + """Name of the variable.""" - role: Required[Literal["tool_call_result"]] + type: Required[Literal["enum"]] + """Type of the variable to extract.""" - tool_call_id: Required[str] + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool + """Whether this data is required. -ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, -] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -class ComponentNodeFunctionNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" - transcript: Required[Iterable[ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" + name: Required[str] + """Name of the variable.""" - destination_node_id: str - """Optional destination node ID""" + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): - prompt: Required[str] - """Prompt condition text""" + required: bool + """Whether this data is required. - type: Required[Literal["prompt"]] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" +class ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + name: Required[str] + """Name of the variable.""" - right: str - """Right side of the equation. + type: Required[Literal["number"]] + """Type of the variable to extract.""" - The right side of the equation not required when "exists" or "not_exist" are - selected. + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. """ + required: bool + """Whether this data is required. -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] - - type: Required[Literal["equation"]] + If true and the data is not extracted, the call will be marked as unsuccessful. + """ -ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" +class ComponentNodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ - transition_condition: Required[ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition] + name: Required[str] + """Name of the tool. - destination_node_id: str - """ID of the destination node""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + type: Required[Literal["extract_dynamic_variable"]] -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + variables: Required[Iterable[ComponentNodeSubagentNodeToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" - role: Required[Literal["agent", "user"]] +class ComponentNodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ - name: Required[str] + type: Required[Literal["bridge_transfer"]] - role: Required[Literal["tool_call_invocation"]] + description: str + """Describes what the tool does. - tool_call_id: Required[str] + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it bridges the original + caller to the transfer target and ends the transfer agent call. + """ + execution_message_description: str + """Describes what to say to user when bridging the transfer. -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] + Only applicable when speak_during_execution is true. + """ - role: Required[Literal["tool_call_result"]] + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - tool_call_id: Required[str] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + speak_during_execution: bool + """If true, will speak during execution.""" -ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] +class ComponentNodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. -class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + type: Required[Literal["cancel_transfer"]] -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] + description: str + """Describes what the tool does. - role: Required[Literal["agent", "user"]] + This tool is only available to transfer agents (agents with isTransferAgent set + to true) in agentic warm transfer mode. When invoked, it cancels the transfer, + returns the original caller to the main agent, and ends the transfer agent call. + """ + execution_message_description: str + """Describes what to say to user when cancelling the transfer. -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + Only applicable when speak_during_execution is true. + """ - name: Required[str] + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. - role: Required[Literal["tool_call_invocation"]] + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ - tool_call_id: Required[str] + speak_during_execution: bool + """If true, will speak during execution.""" -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] +class ComponentNodeSubagentNodeToolMcpTool(TypedDict, total=False): + description: Required[str] + """Description of the MCP tool.""" - role: Required[Literal["tool_call_result"]] + name: Required[str] + """Name of the MCP tool.""" - tool_call_id: Required[str] + type: Required[Literal["mcp"]] + execution_message_description: str + """The description for the sentence agent say during execution. -ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. -class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + input_schema: Dict[str, str] + """The input schema of the MCP tool.""" -class ComponentNodeFunctionNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" + mcp_id: str + """Unique id of the MCP.""" - cool_down: float + response_variables: Dict[str, str] """ - The same global node won't be triggered again within the next N node - transitions. + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response """ - go_back_conditions: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ - There would be no destination_node_id for these edges. + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. """ - negative_finetune_examples: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" +ComponentNodeSubagentNodeTool: TypeAlias = Union[ + ComponentNodeSubagentNodeToolEndCallTool, + ComponentNodeSubagentNodeToolTransferCallTool, + ComponentNodeSubagentNodeToolCheckAvailabilityCalTool, + ComponentNodeSubagentNodeToolBookAppointmentCalTool, + ComponentNodeSubagentNodeToolAgentSwapTool, + ComponentNodeSubagentNodeToolPressDigitTool, + ComponentNodeSubagentNodeToolSendSMSTool, + ComponentNodeSubagentNodeToolCustomTool, + ComponentNodeSubagentNodeToolCodeTool, + ComponentNodeSubagentNodeToolExtractDynamicVariableTool, + ComponentNodeSubagentNodeToolBridgeTransferTool, + ComponentNodeSubagentNodeToolCancelTransferTool, + ComponentNodeSubagentNodeToolMcpTool, +] -class ComponentNodeFunctionNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" +class ComponentNodeSubagentNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" - type: Required[Literal["prompt"]] - """Type of instruction""" + instruction: Required[ComponentNodeSubagentNodeInstruction] + type: Required[Literal["subagent"]] + """Type of the node""" -class ComponentNodeFunctionNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeFunctionNodeInstruction: TypeAlias = Union[ - ComponentNodeFunctionNodeInstructionNodeInstructionPrompt, - ComponentNodeFunctionNodeInstructionNodeInstructionStaticText, -] - - -class ComponentNodeFunctionNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ - "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", - "claude-4.5-sonnet", - "claude-4.6-sonnet", - "claude-4.5-haiku", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-3.0-flash", - ] - ] - """The LLM model to use""" - - type: Required[Literal["cascading"]] - """Type of model choice""" - - high_priority: bool - """Whether to use high priority pool with more dedicated resource, default false""" + always_edge: ComponentNodeSubagentNodeAlwaysEdge + display_position: ComponentNodeSubagentNodeDisplayPosition + """Position for frontend display""" -class ComponentNodeFunctionNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" + edges: Iterable[ComponentNodeSubagentNodeEdge] - tool_id: Required[str] - """Tool ID for function nodes""" + finetune_conversation_examples: Iterable[ComponentNodeSubagentNodeFinetuneConversationExample] - tool_type: Required[Literal["local", "shared"]] - """Tool type for function nodes""" + finetune_transition_examples: Iterable[ComponentNodeSubagentNodeFinetuneTransitionExample] - type: Required[Literal["function"]] - """Type of the node""" + global_node_setting: ComponentNodeSubagentNodeGlobalNodeSetting - wait_for_result: Required[bool] - """Whether to wait for tool result""" + interruption_sensitivity: Optional[float] - display_position: ComponentNodeFunctionNodeDisplayPosition - """Position for frontend display""" + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - edges: Iterable[ComponentNodeFunctionNodeEdge] + model_choice: ComponentNodeSubagentNodeModelChoice - else_edge: ComponentNodeFunctionNodeElseEdge + name: str + """Optional name for display purposes""" - finetune_transition_examples: Iterable[ComponentNodeFunctionNodeFinetuneTransitionExample] + responsiveness: Optional[float] - global_node_setting: ComponentNodeFunctionNodeGlobalNodeSetting + skip_response_edge: ComponentNodeSubagentNodeSkipResponseEdge - instruction: ComponentNodeFunctionNodeInstruction + tool_ids: Optional[SequenceNotStr[str]] + """ + The tool ids of the tools defined in main conversation flow or component that + can be used in this subagent node. + """ - model_choice: ComponentNodeFunctionNodeModelChoice + tools: Optional[Iterable[ComponentNodeSubagentNodeTool]] + """The tools owned by this subagent node. - name: str - """Optional name for display purposes""" + This includes other tool types like transfer_call, agent_swap, etc. + """ - speak_during_execution: bool - """Whether to speak during tool execution""" + voice_speed: Optional[float] -class ComponentNodeCodeNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeEndNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -3280,14 +3287,16 @@ class ComponentNodeCodeNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -3301,93 +3310,75 @@ class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(Type """ -class ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -ComponentNodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition, - ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition, +ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeCodeNodeEdge(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeCodeNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeEndNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - right: str - """Right side of the equation. + role: Required[Literal["agent", "user"]] - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation]] + name: Required[str] - operator: Required[Literal["||", "&&"]] + role: Required[Literal["tool_call_invocation"]] - type: Required[Literal["equation"]] + tool_call_id: Required[str] - prompt: Literal["Else"] - """Must be "Else" for else edge""" +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" + role: Required[Literal["tool_call_result"]] - type: Required[Literal["prompt"]] + tool_call_id: Required[str] -ComponentNodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCodeNodeElseEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - - transition_condition: Required[ComponentNodeCodeNodeElseEdgeTransitionCondition] - - destination_node_id: str - """ID of the destination node""" +class ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -3397,7 +3388,7 @@ class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(Typed tool_call_id: Required[str] -class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -3405,190 +3396,63 @@ class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(Typed tool_call_id: Required[str] -ComponentNodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCodeNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" - - transcript: Required[Iterable[ComponentNodeCodeNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" - - destination_node_id: str - """Optional destination node ID""" - - -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" +class ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - right: str - """Right side of the equation. +class ComponentNodeEndNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" - The right side of the equation not required when "exists" or "not_exist" are - selected. + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. """ + go_back_conditions: Iterable[ComponentNodeEndNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. -class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] + There would be no destination_node_id for these edges. + """ - type: Required[Literal["equation"]] + negative_finetune_examples: Iterable[ComponentNodeEndNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + positive_finetune_examples: Iterable[ComponentNodeEndNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" -ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] +class ComponentNodeEndNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" -class ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + type: Required[Literal["prompt"]] + """Type of instruction""" - transition_condition: Required[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition] - destination_node_id: str - """ID of the destination node""" +class ComponentNodeEndNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + type: Required[Literal["static_text"]] + """Type of instruction""" -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - role: Required[Literal["agent", "user"]] +ComponentNodeEndNodeInstruction: TypeAlias = Union[ + ComponentNodeEndNodeInstructionNodeInstructionPrompt, ComponentNodeEndNodeInstructionNodeInstructionStaticText +] -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] - - -class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, -] - - -class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class ComponentNodeCodeNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" - - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. - """ - - go_back_conditions: Iterable[ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. - - There would be no destination_node_id for these edges. - """ - - negative_finetune_examples: Iterable[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - - positive_finetune_examples: Iterable[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" - - -class ComponentNodeCodeNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class ComponentNodeCodeNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeCodeNodeInstruction: TypeAlias = Union[ - ComponentNodeCodeNodeInstructionNodeInstructionPrompt, ComponentNodeCodeNodeInstructionNodeInstructionStaticText -] - - -class ComponentNodeCodeNodeModelChoice(TypedDict, total=False): +class ComponentNodeEndNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -3619,62 +3483,46 @@ class ComponentNodeCodeNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeCodeNode(TypedDict, total=False): +class ComponentNodeEndNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - code: Required[str] - """JavaScript code to execute in the sandbox.""" - - type: Required[Literal["code"]] + type: Required[Literal["end"]] """Type of the node""" - wait_for_result: Required[bool] - """Whether to wait for code execution result""" - - display_position: ComponentNodeCodeNodeDisplayPosition + display_position: ComponentNodeEndNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodeCodeNodeEdge] - - else_edge: ComponentNodeCodeNodeElseEdge - - finetune_transition_examples: Iterable[ComponentNodeCodeNodeFinetuneTransitionExample] - - global_node_setting: ComponentNodeCodeNodeGlobalNodeSetting + global_node_setting: ComponentNodeEndNodeGlobalNodeSetting - instruction: ComponentNodeCodeNodeInstruction + instruction: ComponentNodeEndNodeInstruction + """What to say when ending the call, only used when speak during execution""" - model_choice: ComponentNodeCodeNodeModelChoice + model_choice: ComponentNodeEndNodeModelChoice name: str """Optional name for display purposes""" - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the code execution result. + speak_during_execution: bool + """If true, will speak during execution""" - These mapped values will be extracted and added as dynamic variables. - """ - speak_during_execution: bool - """Whether to speak during code execution""" +class ComponentNodeFunctionNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" - timeout_ms: int - """The maximum time in milliseconds the code can run before it's considered - timeout. + x: float - Defaults to 30,000 ms (30 s). - """ + y: float -class ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -3688,476 +3536,254 @@ class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquat """ -class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeFunctionNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" - - -class ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Transfer failed"]] - """Must be "Transfer failed" for transfer failed edge""" - - type: Required[Literal["prompt"]] - -ComponentNodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition, - ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition, - ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2, +ComponentNodeFunctionNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeEdgeTransitionConditionPromptCondition, + ComponentNodeFunctionNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeTransferCallNodeEdge(TypedDict, total=False): +class ComponentNodeFunctionNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeTransferCallNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeFunctionNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined(TypedDict, total=False): - number: Required[str] - """ - The number to transfer to in E.164 format or a dynamic variable like - {{transfer_number}}. - """ +class ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - type: Required[Literal["predefined"]] - """The type of transfer destination.""" + type: Required[Literal["prompt"]] - extension: str - """Extension digits to dial after the main number connects. - Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like - {{extension}}. - """ +class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] -class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred(TypedDict, total=False): - prompt: Required[str] - """The prompt to be used to help infer the transfer destination. + right: str + """Right side of the equation. - The model will take the global prompt, the call transcript, and this prompt - together to deduce the right number to transfer to. Can contain dynamic - variables. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - type: Required[Literal["inferred"]] - """The type of transfer destination.""" +class ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationConditionEquation]] -ComponentNodeTransferCallNodeTransferDestination: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined, - ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred, -] + operator: Required[Literal["||", "&&"]] + type: Required[Literal["equation"]] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer(TypedDict, total=False): - type: Required[Literal["cold_transfer"]] - """The type of the transfer.""" + prompt: Literal["Else"] + """Must be "Else" for else edge""" - cold_transfer_mode: Literal["sip_refer", "sip_invite"] - """The mode of the cold transfer. - If set to `sip_refer`, will use SIP REFER to transfer the call. If set to - `sip_invite`, will use SIP INVITE to transfer the call. - """ +class ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring. Requires the telephony side to support caller id override. Retell - Twilio numbers support this option. This parameter takes effect only when - `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option - is not available. Retell Twilio numbers always use user's number as the caller - id when using `sip refer` cold transfer mode. - """ + type: Required[Literal["prompt"]] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. - If not set, falls back to the agent-level `ring_duration_ms`. - """ +ComponentNodeFunctionNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeFunctionNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeFunctionNodeElseEdgeTransitionConditionUnionMember2, +] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): - """IVR navigation option to run when doing human detection. +class ComponentNodeFunctionNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - This prompt will guide the AI on how to navigate the IVR system. - """ + transition_condition: Required[ComponentNodeFunctionNodeElseEdgeTransitionCondition] - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + destination_node_id: str + """ID of the destination node""" - type: Literal["prompt"] +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + role: Required[Literal["agent", "user"]] - type: Literal["prompt"] +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + name: Required[str] - type: Literal["static_message"] + role: Required[Literal["tool_call_invocation"]] + tool_call_id: Required[str] -ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, -] +class ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + role: Required[Literal["tool_call_result"]] - type: Literal["prompt"] + tool_call_id: Required[str] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" +ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeFinetuneTransitionExampleTranscriptUnionMember2, +] - type: Literal["static_message"] +class ComponentNodeFunctionNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" -ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, -] + transcript: Required[Iterable[ComponentNodeFunctionNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + destination_node_id: str + """Optional destination node ID""" -class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): - type: Required[Literal["warm_transfer"]] - """The type of the transfer.""" - agent_detection_timeout_ms: float - """The time to wait before considering transfer fails.""" +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" + type: Required[Literal["prompt"]] - ivr_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption - """IVR navigation option to run when doing human detection. - This prompt will guide the AI on how to navigate the IVR system. - """ +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - opt_out_human_detection: bool - """If set to true, will not perform human detection for the transfer. + right: str + """Right side of the equation. - Default to false. + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - private_handoff_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption - """ - If set, when transfer is connected, will say the handoff message only to the - agent receiving the transfer. Can leave either a static message or a dynamic one - based on prompt. Set to null to disable warm handoff. - """ - public_handoff_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ + operator: Required[Literal["||", "&&"]] - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. + type: Required[Literal["equation"]] - If not set, falls back to the agent-level `ring_duration_ms`. - """ +ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( - TypedDict, total=False -): - """The agent that will mediate the transfer decision.""" - agent_id: Required[str] - """The agent ID of the transfer agent. +class ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - This agent must have isTransferAgent set to true and should use bridge_transfer - and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and - CancelTransferNode (for Conversation Flow). - """ + transition_condition: Required[ComponentNodeFunctionNodeGlobalNodeSettingGoBackConditionTransitionCondition] - agent_version: Required[float] - """The version of the transfer agent to use.""" + destination_node_id: str + """ID of the destination node""" -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( - TypedDict, total=False -): - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] - """The action to take when the transfer agent times out without making a decision. + role: Required[Literal["agent", "user"]] - Defaults to cancel_transfer. - """ - transfer_agent: ( - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent - ) - """The agent that will mediate the transfer decision.""" +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - transfer_timeout_ms: float - """ - The maximum time to wait for the transfer agent to make a decision, in - milliseconds. Defaults to 30000 (30 seconds). - """ + name: Required[str] + role: Required[Literal["tool_call_invocation"]] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( - TypedDict, total=False -): - prompt: str - """The prompt to be used for warm handoff. Can contain dynamic variables.""" + tool_call_id: Required[str] - type: Literal["prompt"] +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( - TypedDict, total=False -): - message: str - """The static message to be used for warm handoff. Can contain dynamic variables.""" + role: Required[Literal["tool_call_result"]] - type: Literal["static_message"] + tool_call_id: Required[str] -ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): - agentic_transfer_config: Required[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig - ] - """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - - type: Required[Literal["agentic_warm_transfer"]] - """The type of the transfer.""" +class ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - enable_bridge_audio_cue: bool - """Whether to play an audio cue when bridging the call. Defaults to true.""" - on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] - """The music to play while the caller is being transferred.""" +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - public_handoff_option: ( - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption - ) - """ - If set, when transfer is successful, will say the handoff message to both the - transferee and the agent receiving the transfer. Can leave either a static - message or a dynamic one based on prompt. Set to null to disable warm handoff. - """ + role: Required[Literal["agent", "user"]] - show_transferee_as_caller: bool - """ - If set to true, will show transferee (the user, not the AI agent) as caller when - transferring, requires the telephony side to support caller id override. Retell - Twilio numbers support this option. - """ - transfer_ring_duration_ms: int - """Override the ring duration for this specific transfer, in milliseconds. +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] - If not set, falls back to the agent-level `ring_duration_ms`. - """ + name: Required[str] + role: Required[Literal["tool_call_invocation"]] -ComponentNodeTransferCallNodeTransferOption: TypeAlias = Union[ - ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer, - ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, - ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, -] + tool_call_id: Required[str] -class ComponentNodeTransferCallNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - x: float + role: Required[Literal["tool_call_result"]] - y: float + tool_call_id: Required[str] -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - - right: str - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[ - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] - ] - - operator: Required[Literal["||", "&&"]] - - type: Required[Literal["equation"]] - - -ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - - transition_condition: Required[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition] - - destination_node_id: str - """ID of the destination node""" - - -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeFunctionNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4167,20 +3793,20 @@ class ComponentNodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeFunctionNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(TypedDict, total=False): +class ComponentNodeFunctionNodeInstructionNodeInstructionPrompt(TypedDict, total=False): text: Required[str] """The prompt text for the instruction""" @@ -4188,7 +3814,7 @@ class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(TypedDict, t """Type of instruction""" -class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(TypedDict, total=False): +class ComponentNodeFunctionNodeInstructionNodeInstructionStaticText(TypedDict, total=False): text: Required[str] """The static text for the instruction""" @@ -4196,13 +3822,13 @@ class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(TypedDic """Type of instruction""" -ComponentNodeTransferCallNodeInstruction: TypeAlias = Union[ - ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt, - ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText, +ComponentNodeFunctionNodeInstruction: TypeAlias = Union[ + ComponentNodeFunctionNodeInstructionNodeInstructionPrompt, + ComponentNodeFunctionNodeInstructionNodeInstructionStaticText, ] -class ComponentNodeTransferCallNodeModelChoice(TypedDict, total=False): +class ComponentNodeFunctionNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4233,56 +3859,45 @@ class ComponentNodeTransferCallNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeTransferCallNode(TypedDict, total=False): +class ComponentNodeFunctionNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - edge: Required[ComponentNodeTransferCallNodeEdge] - - transfer_destination: Required[ComponentNodeTransferCallNodeTransferDestination] + tool_id: Required[str] + """Tool ID for function nodes""" - transfer_option: Required[ComponentNodeTransferCallNodeTransferOption] + tool_type: Required[Literal["local", "shared"]] + """Tool type for function nodes""" - type: Required[Literal["transfer_call"]] + type: Required[Literal["function"]] """Type of the node""" - custom_sip_headers: Dict[str, str] - """Custom SIP headers for transfer calls""" + wait_for_result: Required[bool] + """Whether to wait for tool result""" - display_position: ComponentNodeTransferCallNodeDisplayPosition + display_position: ComponentNodeFunctionNodeDisplayPosition """Position for frontend display""" - global_node_setting: ComponentNodeTransferCallNodeGlobalNodeSetting + edges: Iterable[ComponentNodeFunctionNodeEdge] - ignore_e164_validation: bool - """If true, the e.164 validation will be ignored for the from_number. + else_edge: ComponentNodeFunctionNodeElseEdge - This can be useful when you want to dial to internal pseudo numbers. This only - applies when you are using custom telephony and does not apply when you are - using Retell Telephony. If omitted, the default value is false. - """ + finetune_transition_examples: Iterable[ComponentNodeFunctionNodeFinetuneTransitionExample] - instruction: ComponentNodeTransferCallNodeInstruction - """What to say when transferring the call, only used when speak during execution""" + global_node_setting: ComponentNodeFunctionNodeGlobalNodeSetting - model_choice: ComponentNodeTransferCallNodeModelChoice + instruction: ComponentNodeFunctionNodeInstruction + + model_choice: ComponentNodeFunctionNodeModelChoice name: str """Optional name for display purposes""" speak_during_execution: bool - """If true, will speak during execution""" - - -class ComponentNodePressDigitNodeInstruction(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" + """Whether to speak during tool execution""" -class ComponentNodePressDigitNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeCodeNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -4290,14 +3905,14 @@ class ComponentNodePressDigitNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4311,82 +3926,136 @@ class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquatio """ -class ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeCodeNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -ComponentNodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition, - ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition, +ComponentNodeCodeNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeEdgeTransitionConditionPromptCondition, + ComponentNodeCodeNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodePressDigitNodeEdge(TypedDict, total=False): +class ComponentNodeCodeNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodePressDigitNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeCodeNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] +class ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - role: Required[Literal["agent", "user"]] + type: Required[Literal["prompt"]] -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] +class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - name: Required[str] + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - role: Required[Literal["tool_call_invocation"]] + right: str + """Right side of the equation. - tool_call_id: Required[str] + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] +class ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeCodeNodeElseEdgeTransitionConditionEquationConditionEquation]] - role: Required[Literal["tool_call_result"]] + operator: Required[Literal["||", "&&"]] - tool_call_id: Required[str] + type: Required[Literal["equation"]] + prompt: Literal["Else"] + """Must be "Else" for else edge""" -ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, + +class ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +ComponentNodeCodeNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeCodeNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeCodeNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodePressDigitNodeFinetuneTransitionExample(TypedDict, total=False): +class ComponentNodeCodeNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeCodeNodeElseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeCodeNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeCodeNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class ComponentNodeCodeNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[ComponentNodeCodeNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -4402,13 +4071,9 @@ class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondi """ -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[ - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] + Iterable[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -4416,29 +4081,29 @@ class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondi type: Required[Literal["equation"]] -ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeCodeNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4448,7 +4113,7 @@ class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscr tool_call_id: Required[str] -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4456,25 +4121,25 @@ class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscr tool_call_id: Required[str] -ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -4484,7 +4149,7 @@ class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscr tool_call_id: Required[str] -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4492,19 +4157,19 @@ class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscr tool_call_id: Required[str] -ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeCodeNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4514,20 +4179,41 @@ class ComponentNodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeCodeNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeCodeNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeCodeNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodePressDigitNodeModelChoice(TypedDict, total=False): +class ComponentNodeCodeNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeCodeNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeCodeNodeInstruction: TypeAlias = Union[ + ComponentNodeCodeNodeInstructionNodeInstructionPrompt, ComponentNodeCodeNodeInstructionNodeInstructionStaticText +] + + +class ComponentNodeCodeNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4558,41 +4244,62 @@ class ComponentNodePressDigitNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodePressDigitNode(TypedDict, total=False): +class ComponentNodeCodeNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[ComponentNodePressDigitNodeInstruction] + code: Required[str] + """JavaScript code to execute in the sandbox.""" - type: Required[Literal["press_digit"]] + type: Required[Literal["code"]] """Type of the node""" - delay_ms: int - """Delay in milliseconds before pressing the digit""" + wait_for_result: Required[bool] + """Whether to wait for code execution result""" - display_position: ComponentNodePressDigitNodeDisplayPosition + display_position: ComponentNodeCodeNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodePressDigitNodeEdge] + edges: Iterable[ComponentNodeCodeNodeEdge] - finetune_transition_examples: Iterable[ComponentNodePressDigitNodeFinetuneTransitionExample] + else_edge: ComponentNodeCodeNodeElseEdge - global_node_setting: ComponentNodePressDigitNodeGlobalNodeSetting + finetune_transition_examples: Iterable[ComponentNodeCodeNodeFinetuneTransitionExample] - model_choice: ComponentNodePressDigitNodeModelChoice + global_node_setting: ComponentNodeCodeNodeGlobalNodeSetting + + instruction: ComponentNodeCodeNodeInstruction + + model_choice: ComponentNodeCodeNodeModelChoice name: str """Optional name for display purposes""" + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the code execution result. + + These mapped values will be extracted and added as dynamic variables. + """ -class ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + speak_during_execution: bool + """Whether to speak during code execution""" + + timeout_ms: int + """The maximum time in milliseconds the code can run before it's considered + timeout. + + Defaults to 30,000 ms (30 s). + """ + + +class ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4606,231 +4313,403 @@ class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquatio """ -class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeTransferCallNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" -class ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Transfer failed"]] + """Must be "Transfer failed" for transfer failed edge""" type: Required[Literal["prompt"]] -ComponentNodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeTransferCallNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeTransferCallNodeEdgeTransitionConditionPromptCondition, + ComponentNodeTransferCallNodeEdgeTransitionConditionEquationCondition, + ComponentNodeTransferCallNodeEdgeTransitionConditionUnionMember2, ] -class ComponentNodeBranchNodeElseEdge(TypedDict, total=False): +class ComponentNodeTransferCallNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeBranchNodeElseEdgeTransitionCondition] + transition_condition: Required[ComponentNodeTransferCallNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeBranchNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" +class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined(TypedDict, total=False): + number: Required[str] + """ + The number to transfer to in E.164 format or a dynamic variable like + {{transfer_number}}. + """ - x: float + type: Required[Literal["predefined"]] + """The type of transfer destination.""" - y: float + extension: str + """Extension digits to dial after the main number connects. + Sent via DTMF. Allow digits, '\\**', '#', or a dynamic variable like + {{extension}}. + """ -class ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - type: Required[Literal["prompt"]] +class ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred(TypedDict, total=False): + prompt: Required[str] + """The prompt to be used to help infer the transfer destination. + The model will take the global prompt, the call transcript, and this prompt + together to deduce the right number to transfer to. Can contain dynamic + variables. + """ -class ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" + type: Required[Literal["inferred"]] + """The type of transfer destination.""" - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - right: str - """Right side of the equation. +ComponentNodeTransferCallNodeTransferDestination: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferDestinationTransferDestinationPredefined, + ComponentNodeTransferCallNodeTransferDestinationTransferDestinationInferred, +] - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +class ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer(TypedDict, total=False): + type: Required[Literal["cold_transfer"]] + """The type of the transfer.""" -class ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation]] + cold_transfer_mode: Literal["sip_refer", "sip_invite"] + """The mode of the cold transfer. - operator: Required[Literal["||", "&&"]] + If set to `sip_refer`, will use SIP REFER to transfer the call. If set to + `sip_invite`, will use SIP INVITE to transfer the call. + """ - type: Required[Literal["equation"]] + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring. Requires the telephony side to support caller id override. Retell + Twilio numbers support this option. This parameter takes effect only when + `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option + is not available. Retell Twilio numbers always use user's number as the caller + id when using `sip refer` cold transfer mode. + """ + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. -ComponentNodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition, - ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition, -] + If not set, falls back to the agent-level `ring_duration_ms`. + """ -class ComponentNodeBranchNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): + """IVR navigation option to run when doing human detection. - transition_condition: Required[ComponentNodeBranchNodeEdgeTransitionCondition] + This prompt will guide the AI on how to navigate the IVR system. + """ - destination_node_id: str - """ID of the destination node""" + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["prompt"] -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - role: Required[Literal["agent", "user"]] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["prompt"] -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - name: Required[str] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - role: Required[Literal["tool_call_invocation"]] + type: Literal["static_message"] - tool_call_id: Required[str] +ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +] -class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" - tool_call_id: Required[str] + type: Literal["prompt"] -ComponentNodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, -] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["static_message"] -class ComponentNodeBranchNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodeBranchNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" +ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +] - destination_node_id: str - """Optional destination node ID""" +class ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): + type: Required[Literal["warm_transfer"]] + """The type of the transfer.""" -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + agent_detection_timeout_ms: float + """The time to wait before considering transfer fails.""" - type: Required[Literal["prompt"]] + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" + ivr_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferIvrOption + """IVR navigation option to run when doing human detection. -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): - left: Required[str] - """Left side of the equation""" + This prompt will guide the AI on how to navigate the IVR system. + """ - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" - right: str - """Right side of the equation. + opt_out_human_detection: bool + """If set to true, will not perform human detection for the transfer. - The right side of the equation not required when "exists" or "not_exist" are - selected. + Default to false. """ + private_handoff_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPrivateHandoffOption + """ + If set, when transfer is connected, will say the handoff message only to the + agent receiving the transfer. Can leave either a static message or a dynamic one + based on prompt. Set to null to disable warm handoff. + """ -class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] - ] + public_handoff_option: ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransferPublicHandoffOption + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ - operator: Required[Literal["||", "&&"]] + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ - type: Required[Literal["equation"]] + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. + If not set, falls back to the agent-level `ring_duration_ms`. + """ -ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, -] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( + TypedDict, total=False +): + """The agent that will mediate the transfer decision.""" -class ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" + agent_id: Required[str] + """The agent ID of the transfer agent. - transition_condition: Required[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition] + This agent must have isTransferAgent set to true and should use bridge_transfer + and cancel_transfer tools (for Retell LLM) or BridgeTransferNode and + CancelTransferNode (for Conversation Flow). + """ - destination_node_id: str - """ID of the destination node""" + agent_version: Required[float] + """The version of the transfer agent to use.""" -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( + TypedDict, total=False +): + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - role: Required[Literal["agent", "user"]] + action_on_timeout: Literal["bridge_transfer", "cancel_transfer"] + """The action to take when the transfer agent times out without making a decision. + Defaults to cancel_transfer. + """ -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + transfer_agent: ( + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + ) + """The agent that will mediate the transfer decision.""" - name: Required[str] + transfer_timeout_ms: float + """ + The maximum time to wait for the transfer agent to make a decision, in + milliseconds. Defaults to 30000 (30 seconds). + """ - role: Required[Literal["tool_call_invocation"]] - tool_call_id: Required[str] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( + TypedDict, total=False +): + prompt: str + """The prompt to be used for warm handoff. Can contain dynamic variables.""" + type: Literal["prompt"] -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - role: Required[Literal["tool_call_result"]] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( + TypedDict, total=False +): + message: str + """The static message to be used for warm handoff. Can contain dynamic variables.""" - tool_call_id: Required[str] + type: Literal["static_message"] -ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" - - -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] +class ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): + agentic_transfer_config: Required[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + ] + """Configuration for agentic warm transfer. Required for agentic warm transfer.""" - role: Required[Literal["agent", "user"]] + type: Required[Literal["agentic_warm_transfer"]] + """The type of the transfer.""" + enable_bridge_audio_cue: bool + """Whether to play an audio cue when bridging the call. Defaults to true.""" -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] + on_hold_music: Literal["none", "relaxing_sound", "uplifting_beats", "ringtone"] + """The music to play while the caller is being transferred.""" + + public_handoff_option: ( + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + ) + """ + If set, when transfer is successful, will say the handoff message to both the + transferee and the agent receiving the transfer. Can leave either a static + message or a dynamic one based on prompt. Set to null to disable warm handoff. + """ + + show_transferee_as_caller: bool + """ + If set to true, will show transferee (the user, not the AI agent) as caller when + transferring, requires the telephony side to support caller id override. Retell + Twilio numbers support this option. + """ + + transfer_ring_duration_ms: int + """Override the ring duration for this specific transfer, in milliseconds. + + If not set, falls back to the agent-level `ring_duration_ms`. + """ + + +ComponentNodeTransferCallNodeTransferOption: TypeAlias = Union[ + ComponentNodeTransferCallNodeTransferOptionTransferOptionColdTransfer, + ComponentNodeTransferCallNodeTransferOptionTransferOptionWarmTransfer, + ComponentNodeTransferCallNodeTransferOptionTransferOptionAgenticWarmTransfer, +] + + +class ComponentNodeTransferCallNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] name: Required[str] @@ -4839,7 +4718,9 @@ class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptU tool_call_id: Required[str] -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -4847,19 +4728,61 @@ class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptU tool_call_id: Required[str] -ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeBranchNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeTransferCallNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -4869,20 +4792,42 @@ class ComponentNodeBranchNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeTransferCallNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeBranchNodeModelChoice(TypedDict, total=False): +class ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeTransferCallNodeInstruction: TypeAlias = Union[ + ComponentNodeTransferCallNodeInstructionNodeInstructionPrompt, + ComponentNodeTransferCallNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeTransferCallNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -4913,38 +4858,71 @@ class ComponentNodeBranchNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeBranchNode(TypedDict, total=False): +class ComponentNodeTransferCallNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - else_edge: Required[ComponentNodeBranchNodeElseEdge] + edge: Required[ComponentNodeTransferCallNodeEdge] - type: Required[Literal["branch"]] + transfer_destination: Required[ComponentNodeTransferCallNodeTransferDestination] + + transfer_option: Required[ComponentNodeTransferCallNodeTransferOption] + + type: Required[Literal["transfer_call"]] """Type of the node""" - display_position: ComponentNodeBranchNodeDisplayPosition + custom_sip_headers: Dict[str, str] + """Custom SIP headers for transfer calls""" + + display_position: ComponentNodeTransferCallNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodeBranchNodeEdge] + global_node_setting: ComponentNodeTransferCallNodeGlobalNodeSetting - finetune_transition_examples: Iterable[ComponentNodeBranchNodeFinetuneTransitionExample] + ignore_e164_validation: bool + """If true, the e.164 validation will be ignored for the from_number. - global_node_setting: ComponentNodeBranchNodeGlobalNodeSetting + This can be useful when you want to dial to internal pseudo numbers. This only + applies when you are using custom telephony and does not apply when you are + using Retell Telephony. If omitted, the default value is false. + """ - model_choice: ComponentNodeBranchNodeModelChoice + instruction: ComponentNodeTransferCallNodeInstruction + """What to say when transferring the call, only used when speak during execution""" + + model_choice: ComponentNodeTransferCallNodeModelChoice name: str """Optional name for display purposes""" + speak_during_execution: bool + """If true, will speak during execution""" + -class ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodePressDigitNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodePressDigitNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -4958,134 +4936,82 @@ class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation """ -class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodePressDigitNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Failed to send"] - """Must be "failed to send" for SMS failed edge""" - -class ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Failed to send"]] - """Must be "failed to send" for SMS failed edge""" - - type: Required[Literal["prompt"]] - - -ComponentNodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition, - ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition, - ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2, +ComponentNodePressDigitNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodePressDigitNodeEdgeTransitionConditionPromptCondition, + ComponentNodePressDigitNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeSMSNodeFailedEdge(TypedDict, total=False): +class ComponentNodePressDigitNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeSMSNodeFailedEdgeTransitionCondition] + transition_condition: Required[ComponentNodePressDigitNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeSMSNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class ComponentNodeSMSNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeSMSNodeInstruction: TypeAlias = Union[ - ComponentNodeSMSNodeInstructionNodeInstructionPrompt, ComponentNodeSMSNodeInstructionNodeInstructionStaticText -] - - -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - right: str - """Right side of the equation. + role: Required[Literal["agent", "user"]] - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation]] + name: Required[str] - operator: Required[Literal["||", "&&"]] + role: Required[Literal["tool_call_invocation"]] - type: Required[Literal["equation"]] + tool_call_id: Required[str] - prompt: Literal["Sent successfully"] - """Must be "sent successfully" for SMS success edge""" +class ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Sent successfully"]] - """Must be "sent successfully" for SMS success edge""" + role: Required[Literal["tool_call_result"]] - type: Required[Literal["prompt"]] + tool_call_id: Required[str] -ComponentNodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, - ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, - ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, +ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeSuccessEdge(TypedDict, total=False): +class ComponentNodePressDigitNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] - """Unique identifier for the edge""" + """Unique identifier for the example""" - transition_condition: Required[ComponentNodeSMSNodeSuccessEdgeTransitionCondition] + transcript: Required[Iterable[ComponentNodePressDigitNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" destination_node_id: str - """ID of the destination node""" - - -class ComponentNodeSMSNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" - - x: float - - y: float + """Optional destination node ID""" -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -5101,9 +5027,13 @@ class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): equations: Required[ - Iterable[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[ + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] ] operator: Required[Literal["||", "&&"]] @@ -5111,29 +5041,29 @@ class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu type: Required[Literal["equation"]] -ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodePressDigitNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5143,7 +5073,7 @@ class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5151,25 +5081,25 @@ class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5179,7 +5109,7 @@ class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5187,19 +5117,19 @@ class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeSMSNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodePressDigitNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -5209,20 +5139,20 @@ class ComponentNodeSMSNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodePressDigitNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeSMSNodeModelChoice(TypedDict, total=False): +class ComponentNodePressDigitNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -5253,113 +5183,90 @@ class ComponentNodeSMSNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeSMSNode(TypedDict, total=False): +class ComponentNodePressDigitNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - failed_edge: Required[ComponentNodeSMSNodeFailedEdge] - - instruction: Required[ComponentNodeSMSNodeInstruction] - - success_edge: Required[ComponentNodeSMSNodeSuccessEdge] + instruction: Required[ComponentNodePressDigitNodeInstruction] - type: Required[Literal["sms"]] + type: Required[Literal["press_digit"]] """Type of the node""" - display_position: ComponentNodeSMSNodeDisplayPosition + delay_ms: int + """Delay in milliseconds before pressing the digit""" + + display_position: ComponentNodePressDigitNodeDisplayPosition """Position for frontend display""" - global_node_setting: ComponentNodeSMSNodeGlobalNodeSetting + edges: Iterable[ComponentNodePressDigitNodeEdge] - model_choice: ComponentNodeSMSNodeModelChoice + finetune_transition_examples: Iterable[ComponentNodePressDigitNodeFinetuneTransitionExample] + + global_node_setting: ComponentNodePressDigitNodeGlobalNodeSetting + + model_choice: ComponentNodePressDigitNodeModelChoice name: str """Optional name for display purposes""" -class ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - name: Required[str] - """Name of the variable.""" + type: Required[Literal["prompt"]] - type: Required[Literal["string"]] - """Type of the variable to extract.""" - examples: SequenceNotStr[str] - """Examples of the variable value to teach model the style and syntax.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - required: bool - """Whether this data is required. + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - If true and the data is not extracted, the call will be marked as unsuccessful. + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=False): - choices: Required[SequenceNotStr[str]] - """The possible values of the variable, must be non empty array.""" +class ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeBranchNodeElseEdgeTransitionConditionEquationConditionEquation]] - description: Required[str] - """Description of the variable.""" + operator: Required[Literal["||", "&&"]] - name: Required[str] - """Name of the variable.""" + type: Required[Literal["equation"]] - type: Required[Literal["enum"]] - """Type of the variable to extract.""" + prompt: Literal["Else"] + """Must be "Else" for else edge""" - required: bool - """Whether this data is required. - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + type: Required[Literal["prompt"]] -class ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" - name: Required[str] - """Name of the variable.""" +ComponentNodeBranchNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeBranchNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeBranchNodeElseEdgeTransitionConditionUnionMember2, +] - type: Required[Literal["boolean"]] - """Type of the variable to extract.""" - required: bool - """Whether this data is required. - - If true and the data is not extracted, the call will be marked as unsuccessful. - """ - - -class ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total=False): - description: Required[str] - """Description of the variable.""" - - name: Required[str] - """Name of the variable.""" - - type: Required[Literal["number"]] - """Type of the variable to extract.""" - - required: bool - """Whether this data is required. - - If true and the data is not extracted, the call will be marked as unsuccessful. - """ +class ComponentNodeBranchNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[ComponentNodeBranchNodeElseEdgeTransitionCondition] -ComponentNodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, - ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData, -] + destination_node_id: str + """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeBranchNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -5367,63 +5274,14 @@ class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(TypedDict, total=F y: float -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - - right: str - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation] - ] - - operator: Required[Literal["||", "&&"]] - - type: Required[Literal["equation"]] - - -ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, -] - - -class ComponentNodeExtractDynamicVariablesNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - - transition_condition: Required[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition] - - destination_node_id: str - """ID of the destination node""" - - -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5437,50 +5295,37 @@ class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquatio """ -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[ - Iterable[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation] - ] +class ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeBranchNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" - - -class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" - - type: Required[Literal["prompt"]] - -ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeBranchNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeEdgeTransitionConditionPromptCondition, + ComponentNodeBranchNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeExtractDynamicVariablesNodeElseEdge(TypedDict, total=False): +class ComponentNodeBranchNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition] + transition_condition: Required[ComponentNodeBranchNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5490,7 +5335,7 @@ class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscrip tool_call_id: Required[str] -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5498,34 +5343,32 @@ class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscrip tool_call_id: Required[str] -ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeBranchNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeBranchNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample(TypedDict, total=False): +class ComponentNodeBranchNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[ComponentNodeBranchNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -5541,13 +5384,11 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTr """ -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( +class ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( TypedDict, total=False ): equations: Required[ - Iterable[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] + Iterable[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -5555,35 +5396,29 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTr type: Required[Literal["equation"]] -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition - ] + transition_condition: Required[ComponentNodeBranchNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5593,9 +5428,7 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneE tool_call_id: Required[str] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5603,31 +5436,25 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneE tool_call_id: Required[str] -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[ - Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] - ] +class ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5637,9 +5464,7 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneE tool_call_id: Required[str] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5647,21 +5472,19 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneE tool_call_id: Required[str] -ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[ - Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] - ] +class ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeBranchNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -5671,24 +5494,20 @@ class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total transitions. """ - go_back_conditions: Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeBranchNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample - ] + negative_finetune_examples: Iterable[ComponentNodeBranchNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ - ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample - ] + positive_finetune_examples: Iterable[ComponentNodeBranchNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False): +class ComponentNodeBranchNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -5719,40 +5538,38 @@ class ComponentNodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeExtractDynamicVariablesNode(TypedDict, total=False): +class ComponentNodeBranchNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - type: Required[Literal["extract_dynamic_variables"]] - """Type of the node""" + else_edge: Required[ComponentNodeBranchNodeElseEdge] - variables: Required[Iterable[ComponentNodeExtractDynamicVariablesNodeVariable]] + type: Required[Literal["branch"]] + """Type of the node""" - display_position: ComponentNodeExtractDynamicVariablesNodeDisplayPosition + display_position: ComponentNodeBranchNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodeExtractDynamicVariablesNodeEdge] - - else_edge: ComponentNodeExtractDynamicVariablesNodeElseEdge + edges: Iterable[ComponentNodeBranchNodeEdge] - finetune_transition_examples: Iterable[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[ComponentNodeBranchNodeFinetuneTransitionExample] - global_node_setting: ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting + global_node_setting: ComponentNodeBranchNodeGlobalNodeSetting - model_choice: ComponentNodeExtractDynamicVariablesNodeModelChoice + model_choice: ComponentNodeBranchNodeModelChoice name: str """Optional name for display purposes""" -class ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -5766,44 +5583,119 @@ class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation """ -class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Transfer failed"] - """Must be "Transfer failed" for transfer failed edge""" + prompt: Literal["Failed to send"] + """Must be "failed to send" for SMS failed edge""" -class ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Transfer failed"]] - """Must be "Transfer failed" for transfer failed edge""" +class ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Failed to send"]] + """Must be "failed to send" for SMS failed edge""" type: Required[Literal["prompt"]] -ComponentNodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition, - ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition, - ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2, +ComponentNodeSMSNodeFailedEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeFailedEdgeTransitionConditionPromptCondition, + ComponentNodeSMSNodeFailedEdgeTransitionConditionEquationCondition, + ComponentNodeSMSNodeFailedEdgeTransitionConditionUnionMember2, ] -class ComponentNodeAgentSwapNodeEdge(TypedDict, total=False): - """Edge to transition to if agent swap fails""" +class ComponentNodeSMSNodeFailedEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeSMSNodeFailedEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeSMSNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeSMSNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeSMSNodeInstruction: TypeAlias = Union[ + ComponentNodeSMSNodeInstructionNodeInstructionPrompt, ComponentNodeSMSNodeInstructionNodeInstructionStaticText +] + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Sent successfully"] + """Must be "sent successfully" for SMS success edge""" + + +class ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Sent successfully"]] + """Must be "sent successfully" for SMS success edge""" + + type: Required[Literal["prompt"]] + + +ComponentNodeSMSNodeSuccessEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeSuccessEdgeTransitionConditionPromptCondition, + ComponentNodeSMSNodeSuccessEdgeTransitionConditionEquationCondition, + ComponentNodeSMSNodeSuccessEdgeTransitionConditionUnionMember2, +] + +class ComponentNodeSMSNodeSuccessEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeAgentSwapNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeSMSNodeSuccessEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeAgentSwapNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeSMSNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -5811,16 +5703,14 @@ class ComponentNodeAgentSwapNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -5836,11 +5726,9 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondit """ -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -5848,29 +5736,29 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondit type: Required[Literal["equation"]] -ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeSMSNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5880,7 +5768,7 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: Required[str] -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5888,25 +5776,25 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: Required[str] -ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -5916,7 +5804,7 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: Required[str] -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -5924,19 +5812,19 @@ class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: Required[str] -ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeSMSNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -5946,42 +5834,20 @@ class ComponentNodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeSMSNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeSMSNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeSMSNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeAgentSwapNodeInstruction: TypeAlias = Union[ - ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt, - ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText, -] - - -class ComponentNodeAgentSwapNodeModelChoice(TypedDict, total=False): +class ComponentNodeSMSNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -6012,72 +5878,158 @@ class ComponentNodeAgentSwapNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeAgentSwapNode(TypedDict, total=False): +class ComponentNodeSMSNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - agent_id: Required[str] - """The ID of the agent to swap to""" + failed_edge: Required[ComponentNodeSMSNodeFailedEdge] - edge: Required[ComponentNodeAgentSwapNodeEdge] - """Edge to transition to if agent swap fails""" + instruction: Required[ComponentNodeSMSNodeInstruction] - post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] - """Post call analysis setting for the agent swap""" + success_edge: Required[ComponentNodeSMSNodeSuccessEdge] - type: Required[Literal["agent_swap"]] + type: Required[Literal["sms"]] """Type of the node""" - agent_version: float - """The version of the agent to swap to. - - If not specified, will use the latest version - """ - - display_position: ComponentNodeAgentSwapNodeDisplayPosition + display_position: ComponentNodeSMSNodeDisplayPosition """Position for frontend display""" - global_node_setting: ComponentNodeAgentSwapNodeGlobalNodeSetting - - instruction: ComponentNodeAgentSwapNodeInstruction - """What to say when swapping agents, only used when speak during execution""" - - keep_current_language: bool - """If true, keep the current language when swapping agents. Defaults to false.""" - - keep_current_voice: bool - """If true, keep the current voice when swapping agents. Defaults to false.""" + global_node_setting: ComponentNodeSMSNodeGlobalNodeSetting - model_choice: ComponentNodeAgentSwapNodeModelChoice + model_choice: ComponentNodeSMSNodeModelChoice name: str """Optional name for display purposes""" - speak_during_execution: bool - """If true, will speak during execution""" - webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] - """Webhook setting for the agent swap, defaults to only source.""" +class ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + name: Required[str] + """Name of the variable.""" -class ComponentNodeMcpNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" + type: Required[Literal["string"]] + """Type of the variable to extract.""" - x: float + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ - y: float + examples: SequenceNotStr[str] + """Examples of the variable value to teach model the style and syntax.""" + required: bool + """Whether this data is required. -class ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" + If true and the data is not extracted, the call will be marked as unsuccessful. + """ - type: Required[Literal["prompt"]] +class ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[SequenceNotStr[str]] + """The possible values of the variable, must be non empty array.""" -class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +class ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + + required: bool + """Whether this data is required. + + If true and the data is not extracted, the call will be marked as unsuccessful. + """ + + +ComponentNodeExtractDynamicVariablesNodeVariable: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeVariableStringAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableEnumAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableBooleanAnalysisData, + ComponentNodeExtractDynamicVariablesNodeVariableNumberAnalysisData, +] + + +class ComponentNodeExtractDynamicVariablesNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] @@ -6089,38 +6041,42 @@ class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(Typed """ -class ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -ComponentNodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition, - ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition, +ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeMcpNodeEdge(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeMcpNodeEdgeTransitionCondition] + transition_condition: Required[ComponentNodeExtractDynamicVariablesNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation( + TypedDict, total=False +): left: Required[str] """Left side of the equation""" @@ -6134,8 +6090,10 @@ class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(T """ -class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationConditionEquation] + ] operator: Required[Literal["||", "&&"]] @@ -6145,37 +6103,37 @@ class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(TypedDict """Must be "Else" for else edge""" -class ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Else"]] """Must be "Else" for else edge""" type: Required[Literal["prompt"]] -ComponentNodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeMcpNodeElseEdge(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeElseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeMcpNodeElseEdgeTransitionCondition] + transition_condition: Required[ComponentNodeExtractDynamicVariablesNodeElseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6185,7 +6143,7 @@ class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedD tool_call_id: Required[str] -class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6193,32 +6151,34 @@ class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedD tool_call_id: Required[str] -ComponentNodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeFinetuneTransitionExample(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[ComponentNodeMcpNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -6234,9 +6194,13 @@ class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): equations: Required[ - Iterable[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] ] operator: Required[Literal["||", "&&"]] @@ -6244,29 +6208,35 @@ class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu type: Required[Literal["equation"]] -ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackConditionTransitionCondition + ] destination_node_id: str """ID of the destination node""" -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): arguments: Required[str] name: Required[str] @@ -6276,7 +6246,9 @@ class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6284,25 +6256,31 @@ class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[ + Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExampleTranscript] + ] """Find tune the transition condition to this global node""" -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): arguments: Required[str] name: Required[str] @@ -6312,7 +6290,9 @@ class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6320,19 +6300,21 @@ class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[ + Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExampleTranscript] + ] """Find tune the transition condition to this global node""" -class ComponentNodeMcpNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -6342,41 +6324,24 @@ class ComponentNodeMcpNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingNegativeFinetuneExample + ] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ + ComponentNodeExtractDynamicVariablesNodeGlobalNodeSettingPositiveFinetuneExample + ] """Transition to this node""" -class ComponentNodeMcpNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" - - type: Required[Literal["prompt"]] - """Type of instruction""" - - -class ComponentNodeMcpNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" - - type: Required[Literal["static_text"]] - """Type of instruction""" - - -ComponentNodeMcpNodeInstruction: TypeAlias = Union[ - ComponentNodeMcpNodeInstructionNodeInstructionPrompt, ComponentNodeMcpNodeInstructionNodeInstructionStaticText -] - - -class ComponentNodeMcpNodeModelChoice(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -6407,59 +6372,40 @@ class ComponentNodeMcpNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeMcpNode(TypedDict, total=False): +class ComponentNodeExtractDynamicVariablesNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - mcp_id: Required[str] - """Unique ID of the MCP server""" - - mcp_tool_name: Required[str] - """Name of the MCP tool to call""" - - type: Required[Literal["mcp"]] + type: Required[Literal["extract_dynamic_variables"]] """Type of the node""" - wait_for_result: Required[bool] - """If true, will wait for result before transitioning to next node""" + variables: Required[Iterable[ComponentNodeExtractDynamicVariablesNodeVariable]] - display_position: ComponentNodeMcpNodeDisplayPosition + display_position: ComponentNodeExtractDynamicVariablesNodeDisplayPosition """Position for frontend display""" - edges: Iterable[ComponentNodeMcpNodeEdge] - - else_edge: ComponentNodeMcpNodeElseEdge + edges: Iterable[ComponentNodeExtractDynamicVariablesNodeEdge] - finetune_transition_examples: Iterable[ComponentNodeMcpNodeFinetuneTransitionExample] + else_edge: ComponentNodeExtractDynamicVariablesNodeElseEdge - global_node_setting: ComponentNodeMcpNodeGlobalNodeSetting + finetune_transition_examples: Iterable[ComponentNodeExtractDynamicVariablesNodeFinetuneTransitionExample] - instruction: ComponentNodeMcpNodeInstruction - """What to say when calling the function, only used when speak during execution""" + global_node_setting: ComponentNodeExtractDynamicVariablesNodeGlobalNodeSetting - model_choice: ComponentNodeMcpNodeModelChoice + model_choice: ComponentNodeExtractDynamicVariablesNodeModelChoice name: str """Optional name for display purposes""" - response_variables: Dict[str, str] - """ - Response variables to add to dynamic variables, key is the variable name, value - is the path to the variable in the response - """ - - speak_during_execution: bool - """If true, will speak during execution""" - -class ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -6473,44 +6419,44 @@ class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEqua """ -class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation]] +class ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] - prompt: Literal["Else"] - """Must be "Else" for else edge""" + prompt: Literal["Transfer failed"] + """Must be "Transfer failed" for transfer failed edge""" -class ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): - prompt: Required[Literal["Else"]] - """Must be "Else" for else edge""" +class ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Transfer failed"]] + """Must be "Transfer failed" for transfer failed edge""" type: Required[Literal["prompt"]] -ComponentNodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition, - ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition, - ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2, +ComponentNodeAgentSwapNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeAgentSwapNodeEdgeTransitionConditionPromptCondition, + ComponentNodeAgentSwapNodeEdgeTransitionConditionEquationCondition, + ComponentNodeAgentSwapNodeEdgeTransitionConditionUnionMember2, ] -class ComponentNodeComponentNodeElseEdge(TypedDict, total=False): - """Default edge when no other conditions are met""" +class ComponentNodeAgentSwapNodeEdge(TypedDict, total=False): + """Edge to transition to if agent swap fails""" id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeComponentNodeElseEdgeTransitionCondition] + transition_condition: Required[ComponentNodeAgentSwapNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeComponentNodeDisplayPosition(TypedDict, total=False): +class ComponentNodeAgentSwapNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -6518,94 +6464,7 @@ class ComponentNodeComponentNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): - prompt: Required[str] - """Prompt condition text""" - - type: Required[Literal["prompt"]] - - -class ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): - left: Required[str] - """Left side of the equation""" - - operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - - right: str - """Right side of the equation. - - The right side of the equation not required when "exists" or "not_exist" are - selected. - """ - - -class ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation]] - - operator: Required[Literal["||", "&&"]] - - type: Required[Literal["equation"]] - - -ComponentNodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition, - ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition, -] - - -class ComponentNodeComponentNodeEdge(TypedDict, total=False): - id: Required[str] - """Unique identifier for the edge""" - - transition_condition: Required[ComponentNodeComponentNodeEdgeTransitionCondition] - - destination_node_id: str - """ID of the destination node""" - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["agent", "user"]] - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): - arguments: Required[str] - - name: Required[str] - - role: Required[Literal["tool_call_invocation"]] - - tool_call_id: Required[str] - - -class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): - content: Required[str] - - role: Required[Literal["tool_call_result"]] - - tool_call_id: Required[str] - - -ComponentNodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, - ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, -] - - -class ComponentNodeComponentNodeFinetuneTransitionExample(TypedDict, total=False): - id: Required[str] - """Unique identifier for the example""" - - transcript: Required[Iterable[ComponentNodeComponentNodeFinetuneTransitionExampleTranscript]] - """The example transcript to finetune how the node should transition.""" - - destination_node_id: str - """Optional destination node ID""" - - -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( TypedDict, total=False ): prompt: Required[str] @@ -6614,7 +6473,7 @@ class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondit type: Required[Literal["prompt"]] -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -6630,11 +6489,11 @@ class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondit """ -class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( TypedDict, total=False ): equations: Required[ - Iterable[ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -6642,29 +6501,29 @@ class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondit type: Required[Literal["equation"]] -ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6674,7 +6533,7 @@ class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: Required[str] -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6682,25 +6541,25 @@ class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscri tool_call_id: Required[str] -ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6710,7 +6569,7 @@ class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: Required[str] -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6718,19 +6577,19 @@ class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscri tool_call_id: Required[str] -ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeComponentNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeAgentSwapNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -6740,54 +6599,121 @@ class ComponentNodeComponentNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeAgentSwapNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeComponentNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" - - component_id: Required[str] - """The reference ID of the component""" - - component_type: Required[Literal["local", "shared"]] - """Type of component: +class ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" - - local: stored in conversation flow's components array - - shared: stored in stand-alone conversation-flow-component table - """ + type: Required[Literal["prompt"]] + """Type of instruction""" - else_edge: Required[ComponentNodeComponentNodeElseEdge] - """Default edge when no other conditions are met""" - type: Required[Literal["component"]] - """Type of the node""" +class ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" - display_position: ComponentNodeComponentNodeDisplayPosition - """Position for frontend display""" + type: Required[Literal["static_text"]] + """Type of instruction""" - edges: Iterable[ComponentNodeComponentNodeEdge] - """Array of edges for conditional transitions""" - finetune_transition_examples: Iterable[ComponentNodeComponentNodeFinetuneTransitionExample] +ComponentNodeAgentSwapNodeInstruction: TypeAlias = Union[ + ComponentNodeAgentSwapNodeInstructionNodeInstructionPrompt, + ComponentNodeAgentSwapNodeInstructionNodeInstructionStaticText, +] - global_node_setting: ComponentNodeComponentNodeGlobalNodeSetting + +class ComponentNodeAgentSwapNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeAgentSwapNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + agent_id: Required[str] + """The ID of the agent to swap to""" + + edge: Required[ComponentNodeAgentSwapNodeEdge] + """Edge to transition to if agent swap fails""" + + post_call_analysis_setting: Required[Literal["both_agents", "only_destination_agent"]] + """Post call analysis setting for the agent swap""" + + type: Required[Literal["agent_swap"]] + """Type of the node""" + + agent_version: float + """The version of the agent to swap to. + + If not specified, will use the latest version + """ + + display_position: ComponentNodeAgentSwapNodeDisplayPosition + """Position for frontend display""" + + global_node_setting: ComponentNodeAgentSwapNodeGlobalNodeSetting + + instruction: ComponentNodeAgentSwapNodeInstruction + """What to say when swapping agents, only used when speak during execution""" + + keep_current_language: bool + """If true, keep the current language when swapping agents. Defaults to false.""" + + keep_current_voice: bool + """If true, keep the current voice when swapping agents. Defaults to false.""" + + model_choice: ComponentNodeAgentSwapNodeModelChoice name: str """Optional name for display purposes""" + speak_during_execution: bool + """If true, will speak during execution""" -class ComponentNodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): + webhook_setting: Literal["both_agents", "only_destination_agent", "only_source_agent"] + """Webhook setting for the agent swap, defaults to only source.""" + + +class ComponentNodeMcpNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -6795,18 +6721,14 @@ class ComponentNodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): y: float -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -6820,89 +6742,93 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionC """ -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] - ] +class ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeMcpNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +ComponentNodeMcpNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeEdgeTransitionConditionPromptCondition, + ComponentNodeMcpNodeEdgeTransitionConditionEquationCondition, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeMcpNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeMcpNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): - content: Required[str] +class ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - role: Required[Literal["agent", "user"]] + type: Required[Literal["prompt"]] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): - arguments: Required[str] +class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - name: Required[str] + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - role: Required[Literal["tool_call_invocation"]] + right: str + """Right side of the equation. - tool_call_id: Required[str] + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): - content: Required[str] +class ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeMcpNodeElseEdgeTransitionConditionEquationConditionEquation]] - role: Required[Literal["tool_call_result"]] + operator: Required[Literal["||", "&&"]] - tool_call_id: Required[str] + type: Required[Literal["equation"]] + prompt: Literal["Else"] + """Must be "Else" for else edge""" -ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, + +class ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +ComponentNodeMcpNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeMcpNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeMcpNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" +class ComponentNodeMcpNodeElseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + transition_condition: Required[ComponentNodeMcpNodeElseEdgeTransitionCondition] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -6912,9 +6838,7 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: Required[str] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): +class ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -6922,66 +6846,192 @@ class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: Required[str] -ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeMcpNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeMcpNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" +class ComponentNodeMcpNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + transcript: Required[Iterable[ComponentNodeMcpNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" -class ComponentNodeBridgeTransferNodeGlobalNodeSetting(TypedDict, total=False): - condition: Required[str] - """Condition for global node activation, cannot be empty""" + destination_node_id: str + """Optional destination node ID""" - cool_down: float - """ - The same global node won't be triggered again within the next N node - transitions. - """ - go_back_conditions: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition] - """The conditions for global node go back. +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - There would be no destination_node_id for these edges. - """ + type: Required[Literal["prompt"]] - negative_finetune_examples: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] - """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] - """Transition to this node""" +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] -class ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" + right: str + """Right side of the equation. - type: Required[Literal["prompt"]] - """Type of instruction""" + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -class ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" +class ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] - type: Required[Literal["static_text"]] - """Type of instruction""" + operator: Required[Literal["||", "&&"]] + type: Required[Literal["equation"]] -ComponentNodeBridgeTransferNodeInstruction: TypeAlias = Union[ - ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt, - ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText, + +ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class ComponentNodeBridgeTransferNodeModelChoice(TypedDict, total=False): - model: Required[ - Literal[ +class ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeMcpNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeMcpNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[ComponentNodeMcpNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[ComponentNodeMcpNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[ComponentNodeMcpNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class ComponentNodeMcpNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeMcpNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeMcpNodeInstruction: TypeAlias = Union[ + ComponentNodeMcpNodeInstructionNodeInstructionPrompt, ComponentNodeMcpNodeInstructionNodeInstructionStaticText +] + + +class ComponentNodeMcpNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", @@ -7010,53 +7060,59 @@ class ComponentNodeBridgeTransferNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeBridgeTransferNode(TypedDict, total=False): +class ComponentNodeMcpNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - type: Required[Literal["bridge_transfer"]] - """Type of the node - initiates a warm transfer by bridging the call""" + mcp_id: Required[str] + """Unique ID of the MCP server""" - display_position: ComponentNodeBridgeTransferNodeDisplayPosition + mcp_tool_name: Required[str] + """Name of the MCP tool to call""" + + type: Required[Literal["mcp"]] + """Type of the node""" + + wait_for_result: Required[bool] + """If true, will wait for result before transitioning to next node""" + + display_position: ComponentNodeMcpNodeDisplayPosition """Position for frontend display""" - global_node_setting: ComponentNodeBridgeTransferNodeGlobalNodeSetting + edges: Iterable[ComponentNodeMcpNodeEdge] - instruction: ComponentNodeBridgeTransferNodeInstruction - """Describes what to say to user when bridging the transfer. + else_edge: ComponentNodeMcpNodeElseEdge - Only applicable when speak_during_execution is true. - """ + finetune_transition_examples: Iterable[ComponentNodeMcpNodeFinetuneTransitionExample] - model_choice: ComponentNodeBridgeTransferNodeModelChoice + global_node_setting: ComponentNodeMcpNodeGlobalNodeSetting + + instruction: ComponentNodeMcpNodeInstruction + """What to say when calling the function, only used when speak during execution""" + + model_choice: ComponentNodeMcpNodeModelChoice name: str """Optional name for display purposes""" + response_variables: Dict[str, str] + """ + Response variables to add to dynamic variables, key is the variable name, value + is the path to the variable in the response + """ + speak_during_execution: bool """If true, will speak during execution""" -class ComponentNodeCancelTransferNodeDisplayPosition(TypedDict, total=False): - """Position for frontend display""" - - x: float - - y: float - - -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( - TypedDict, total=False -): +class ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( - TypedDict, total=False -): +class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7070,89 +7126,103 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionC """ -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( - TypedDict, total=False -): - equations: Required[ - Iterable[ - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation - ] - ] +class ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeComponentNodeElseEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] + prompt: Literal["Else"] + """Must be "Else" for else edge""" -ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, + +class ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Else"]] + """Must be "Else" for else edge""" + + type: Required[Literal["prompt"]] + + +ComponentNodeComponentNodeElseEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeElseEdgeTransitionConditionPromptCondition, + ComponentNodeComponentNodeElseEdgeTransitionConditionEquationCondition, + ComponentNodeComponentNodeElseEdgeTransitionConditionUnionMember2, ] -class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class ComponentNodeComponentNodeElseEdge(TypedDict, total=False): + """Default edge when no other conditions are met""" + id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[ComponentNodeComponentNodeElseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): - content: Required[str] +class ComponentNodeComponentNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" - role: Required[Literal["agent", "user"]] + x: float + y: float -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): - arguments: Required[str] - name: Required[str] +class ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - role: Required[Literal["tool_call_invocation"]] + type: Required[Literal["prompt"]] - tool_call_id: Required[str] +class ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( - TypedDict, total=False -): - content: Required[str] + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - role: Required[Literal["tool_call_result"]] + right: str + """Right side of the equation. - tool_call_id: Required[str] + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ -ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, -] +class ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[ComponentNodeComponentNodeEdgeTransitionConditionEquationConditionEquation]] + operator: Required[Literal["||", "&&"]] -class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] - """Find tune the transition condition to this global node""" + type: Required[Literal["equation"]] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( - TypedDict, total=False -): +ComponentNodeComponentNodeEdgeTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeEdgeTransitionConditionPromptCondition, + ComponentNodeComponentNodeEdgeTransitionConditionEquationCondition, +] + + +class ComponentNodeComponentNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeComponentNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( - TypedDict, total=False -): +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7162,9 +7232,102 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: Required[str] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( +class ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeComponentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember0, + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember1, + ComponentNodeComponentNodeFinetuneTransitionExampleTranscriptUnionMember2, +] + + +class ComponentNodeComponentNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[ComponentNodeComponentNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" + + destination_node_id: str + """Optional destination node ID""" + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( TypedDict, total=False ): + equations: Required[ + Iterable[ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeComponentNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7172,19 +7335,55 @@ class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTra tool_call_id: Required[str] -ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class ComponentNodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeComponentNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -7194,42 +7393,895 @@ class ComponentNodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[ComponentNodeComponentNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[ComponentNodeComponentNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[ComponentNodeComponentNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" +class ComponentNodeComponentNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + component_id: Required[str] + """The reference ID of the component""" + + component_type: Required[Literal["local", "shared"]] + """Type of component: + + - local: stored in conversation flow's components array + - shared: stored in stand-alone conversation-flow-component table + """ + + else_edge: Required[ComponentNodeComponentNodeElseEdge] + """Default edge when no other conditions are met""" + + type: Required[Literal["component"]] + """Type of the node""" + + display_position: ComponentNodeComponentNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[ComponentNodeComponentNodeEdge] + """Array of edges for conditional transitions""" + + finetune_transition_examples: Iterable[ComponentNodeComponentNodeFinetuneTransitionExample] + + global_node_setting: ComponentNodeComponentNodeGlobalNodeSetting + + name: str + """Optional name for display purposes""" + + +class ComponentNodeBridgeTransferNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeBridgeTransferNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[ComponentNodeBridgeTransferNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeBridgeTransferNodeInstruction: TypeAlias = Union[ + ComponentNodeBridgeTransferNodeInstructionNodeInstructionPrompt, + ComponentNodeBridgeTransferNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeBridgeTransferNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeBridgeTransferNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + type: Required[Literal["bridge_transfer"]] + """Type of the node - initiates a warm transfer by bridging the call""" + + display_position: ComponentNodeBridgeTransferNodeDisplayPosition + """Position for frontend display""" + + global_node_setting: ComponentNodeBridgeTransferNodeGlobalNodeSetting + + instruction: ComponentNodeBridgeTransferNodeInstruction + """Describes what to say to user when bridging the transfer. + + Only applicable when speak_during_execution is true. + """ + + model_choice: ComponentNodeBridgeTransferNodeModelChoice + + name: str + """Optional name for display purposes""" + + speak_during_execution: bool + """If true, will speak during execution""" + + +class ComponentNodeCancelTransferNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" + + x: float + + y: float + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition( + TypedDict, total=False +): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition( + TypedDict, total=False +): + equations: Required[ + Iterable[ + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation + ] + ] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + +ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackConditionTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1( + TypedDict, total=False +): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2( + TypedDict, total=False +): + content: Required[str] + + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] + + +class ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class ComponentNodeCancelTransferNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. + """ + + go_back_conditions: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. + + There would be no destination_node_id for these edges. + """ + + negative_finetune_examples: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[ComponentNodeCancelTransferNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" + + type: Required[Literal["static_text"]] + """Type of instruction""" + + +ComponentNodeCancelTransferNodeInstruction: TypeAlias = Union[ + ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt, + ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText, +] + + +class ComponentNodeCancelTransferNodeModelChoice(TypedDict, total=False): + model: Required[ + Literal[ + "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", + "claude-4.5-sonnet", + "claude-4.6-sonnet", + "claude-4.5-haiku", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3.0-flash", + ] + ] + """The LLM model to use""" + + type: Required[Literal["cascading"]] + """Type of model choice""" + + high_priority: bool + """Whether to use high priority pool with more dedicated resource, default false""" + + +class ComponentNodeCancelTransferNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + type: Required[Literal["cancel_transfer"]] + """Type of the node - cancels the warm transfer and ends the transfer agent call""" + + display_position: ComponentNodeCancelTransferNodeDisplayPosition + """Position for frontend display""" + + global_node_setting: ComponentNodeCancelTransferNodeGlobalNodeSetting + + instruction: ComponentNodeCancelTransferNodeInstruction + """Describes what to say to user when cancelling the transfer. + + Only applicable when speak_during_execution is true. + """ + + model_choice: ComponentNodeCancelTransferNodeModelChoice + + name: str + """Optional name for display purposes""" + + speak_during_execution: bool + """If true, will speak during execution""" + + +ComponentNode: TypeAlias = Union[ + ComponentNodeConversationNode, + ComponentNodeSubagentNode, + ComponentNodeEndNode, + ComponentNodeFunctionNode, + ComponentNodeCodeNode, + ComponentNodeTransferCallNode, + ComponentNodePressDigitNode, + ComponentNodeBranchNode, + ComponentNodeSMSNode, + ComponentNodeExtractDynamicVariablesNode, + ComponentNodeAgentSwapNode, + ComponentNodeMcpNode, + ComponentNodeComponentNode, + ComponentNodeBridgeTransferNode, + ComponentNodeCancelTransferNode, +] + + +class ComponentBeginTagDisplayPosition(TypedDict, total=False): + """Display position for the begin tag in the frontend""" + + x: float + + y: float + + +class ComponentMcp(TypedDict, total=False): + name: Required[str] + + url: Required[str] + """The URL of the MCP server.""" + + headers: Dict[str, str] + """Headers to add to the MCP connection request.""" + + query_params: Dict[str, str] + """Query parameters to append to the MCP connection request URL.""" + + timeout_ms: int + """Maximum time to wait for a connection to be established (in milliseconds). + + Default to 120,000 ms (2 minutes). + """ + + +class ComponentNoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class ComponentNoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class ComponentNote(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[ComponentNoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[ComponentNoteSize] + """Dimensions of the note on the canvas.""" + + +class ComponentToolCustomToolParameters(TypedDict, total=False): + """The parameters the functions accepts, described as a JSON Schema object. + + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. + """ + + properties: Required[Dict[str, object]] + """ + The value of properties is an object, where each key is the name of a property + and each value is a schema used to validate that property. + """ + + type: Required[Literal["object"]] + """Type must be "object" for a JSON Schema object.""" + + required: SequenceNotStr[str] + """List of names of required property when generating this parameter. + + LLM will do its best to generate the required properties in its function + arguments. Property must exist in properties. + """ + + +class ComponentToolCustomTool(TypedDict, total=False): + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["custom"]] + + url: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + args_at_root: bool + """ + If set to true, the parameters will be passed as root level JSON object instead + of nested under "args". + """ + + description: str + """Describes what this tool does and when to call this tool.""" + + execution_message_description: str + """The description for the sentence agent say during execution. + + Only applicable when speak_during_execution is true. Can write what to say or + even provide examples. The default is "The message you will say to callee when + calling this tool. Make sure it fits into the conversation smoothly.". + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + headers: Dict[str, str] + """Headers to add to the request.""" + + method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] + """Method to use for the request, default to POST.""" + + parameters: ComponentToolCustomToolParameters + """The parameters the functions accepts, described as a JSON Schema object. + + See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. Omitting parameters defines a function with + an empty parameter list. + """ + + query_params: Dict[str, str] + """Query parameters to append to the request URL.""" + + response_variables: Dict[str, str] + """A mapping of variable names to JSON paths in the response body. + + These values will be extracted from the response and made available as dynamic + variables for use. + """ + + speak_after_execution: bool + """ + Determines whether the agent would call LLM another time and speak when the + result of function is obtained. Usually this needs to get turned on so user can + get update for the function call. + """ + + speak_during_execution: bool + """ + Determines whether the agent would say sentence like "One moment, let me check + that." when executing the function. Recommend to turn on if your function call + takes over 1s (including network) to complete, so that your agent remains + responsive. + """ + + timeout_ms: int + """The maximum time in milliseconds the tool can run before it's considered + timeout. + + If the tool times out, the agent would have that info. The minimum value allowed + is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, + this is set to 120,000 ms (2 min). + """ + + tool_id: str + """Unique identifier for the tool""" + + +class ComponentToolCheckAvailabilityCalTool(TypedDict, total=False): + cal_api_key: Required[str] + """ + Cal.com Api key that have access to the cal.com event you want to check + availability for. + """ + + event_type_id: Required[Union[float, str]] + """ + Cal.com event type id number for the cal.com event you want to check + availability for. Can be a number or a dynamic variable in the format + `{{variable_name}}` that will be resolved at runtime. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["check_availability_cal"]] + + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + timezone: str + """ + Timezone to be used when checking availability, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ + + tool_id: str + """Unique identifier for the tool""" + + +class ComponentToolBookAppointmentCalTool(TypedDict, total=False): + cal_api_key: Required[str] + """ + Cal.com Api key that have access to the cal.com event you want to book + appointment. + """ + + event_type_id: Required[Union[float, str]] + """Cal.com event type id number for the cal.com event you want to book appointment. + + Can be a number or a dynamic variable in the format `{{variable_name}}` that + will be resolved at runtime. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["book_appointment_cal"]] + + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + timezone: str + """ + Timezone to be used when booking appointment, must be in + [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + Can also be a dynamic variable in the format `{{variable_name}}` that will be + resolved at runtime. If not specified, will check if user specified timezone in + call, and if not, will use the timezone of the Retell servers. + """ + + tool_id: str + """Unique identifier for the tool""" + + +ComponentTool: TypeAlias = Union[ + ComponentToolCustomTool, ComponentToolCheckAvailabilityCalTool, ComponentToolBookAppointmentCalTool +] + + +class Component(TypedDict, total=False): + name: Required[str] + """Name of the component""" + + nodes: Required[Iterable[ComponentNode]] + """Nodes that make up the component""" + + begin_tag_display_position: Optional[ComponentBeginTagDisplayPosition] + """Display position for the begin tag in the frontend""" + + mcps: Optional[Iterable[ComponentMcp]] + """A list of MCP server configurations to use for this component""" + + notes: Optional[Iterable[ComponentNote]] + """Visual annotations displayed on the flow canvas.""" + + start_node_id: Optional[str] + """ID of the starting node""" + + tools: Optional[Iterable[ComponentTool]] + """Tools available within the component""" + + +class KBConfig(TypedDict, total=False): + """Knowledge base configuration for RAG retrieval.""" + + filter_score: float + """Similarity threshold for filtering search results""" + + top_k: int + """Max number of knowledge base chunks to retrieve""" + + +class Mcp(TypedDict, total=False): + name: Required[str] - type: Required[Literal["prompt"]] - """Type of instruction""" + url: Required[str] + """The URL of the MCP server.""" + headers: Dict[str, str] + """Headers to add to the MCP connection request.""" -class ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" + query_params: Dict[str, str] + """Query parameters to append to the MCP connection request URL.""" - type: Required[Literal["static_text"]] - """Type of instruction""" + timeout_ms: int + """Maximum time to wait for a connection to be established (in milliseconds). + Default to 120,000 ms (2 minutes). + """ -ComponentNodeCancelTransferNodeInstruction: TypeAlias = Union[ - ComponentNodeCancelTransferNodeInstructionNodeInstructionPrompt, - ComponentNodeCancelTransferNodeInstructionNodeInstructionStaticText, -] +class ModelChoice(TypedDict, total=False): + """The model choice for the conversation flow.""" -class ComponentNodeCancelTransferNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -7260,338 +8312,362 @@ class ComponentNodeCancelTransferNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class ComponentNodeCancelTransferNode(TypedDict, total=False): - id: Required[str] - """Unique identifier for the node""" +class NodeConversationNodeInstructionNodeInstructionPrompt(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" - type: Required[Literal["cancel_transfer"]] - """Type of the node - cancels the warm transfer and ends the transfer agent call""" + type: Required[Literal["prompt"]] + """Type of instruction""" - display_position: ComponentNodeCancelTransferNodeDisplayPosition - """Position for frontend display""" - global_node_setting: ComponentNodeCancelTransferNodeGlobalNodeSetting +class NodeConversationNodeInstructionNodeInstructionStaticText(TypedDict, total=False): + text: Required[str] + """The static text for the instruction""" - instruction: ComponentNodeCancelTransferNodeInstruction - """Describes what to say to user when cancelling the transfer. + type: Required[Literal["static_text"]] + """Type of instruction""" - Only applicable when speak_during_execution is true. + +NodeConversationNodeInstruction: TypeAlias = Union[ + NodeConversationNodeInstructionNodeInstructionPrompt, NodeConversationNodeInstructionNodeInstructionStaticText +] + + +class NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" + + type: Required[Literal["prompt"]] + + +class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" + + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - model_choice: ComponentNodeCancelTransferNodeModelChoice - name: str - """Optional name for display purposes""" +class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] - speak_during_execution: bool - """If true, will speak during execution""" + operator: Required[Literal["||", "&&"]] + type: Required[Literal["equation"]] -ComponentNode: TypeAlias = Union[ - ComponentNodeConversationNode, - ComponentNodeEndNode, - ComponentNodeFunctionNode, - ComponentNodeCodeNode, - ComponentNodeTransferCallNode, - ComponentNodePressDigitNode, - ComponentNodeBranchNode, - ComponentNodeSMSNode, - ComponentNodeExtractDynamicVariablesNode, - ComponentNodeAgentSwapNode, - ComponentNodeMcpNode, - ComponentNodeComponentNode, - ComponentNodeBridgeTransferNode, - ComponentNodeCancelTransferNode, + prompt: Literal["Always"] + """Must be "Always" for always edge""" + + +class NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Always"]] + """Must be "Always" for always edge""" + + type: Required[Literal["prompt"]] + + +NodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class ComponentBeginTagDisplayPosition(TypedDict, total=False): - """Display position for the begin tag in the frontend""" +class NodeConversationNodeAlwaysEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeConversationNodeAlwaysEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeConversationNodeDisplayPosition(TypedDict, total=False): + """Position for frontend display""" x: float y: float -class ComponentMcp(TypedDict, total=False): - name: Required[str] +class NodeConversationNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - url: Required[str] - """The URL of the MCP server.""" + type: Required[Literal["prompt"]] - headers: Dict[str, str] - """Headers to add to the MCP connection request.""" - query_params: Dict[str, str] - """Query parameters to append to the MCP connection request URL.""" +class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - timeout_ms: int - """Maximum time to wait for a connection to be established (in milliseconds). + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - Default to 120,000 ms (2 minutes). + right: str + """Right side of the equation. + + The right side of the equation not required when "exists" or "not_exist" are + selected. """ -class ComponentToolCustomToolParameters(TypedDict, total=False): - """The parameters the functions accepts, described as a JSON Schema object. +class NodeConversationNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeConversationNodeEdgeTransitionConditionEquationConditionEquation]] - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. - """ + operator: Required[Literal["||", "&&"]] - properties: Required[Dict[str, object]] - """ - The value of properties is an object, where each key is the name of a property - and each value is a schema used to validate that property. - """ + type: Required[Literal["equation"]] - type: Required[Literal["object"]] - """Type must be "object" for a JSON Schema object.""" - required: SequenceNotStr[str] - """List of names of required property when generating this parameter. +NodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeEdgeTransitionConditionPromptCondition, + NodeConversationNodeEdgeTransitionConditionEquationCondition, +] - LLM will do its best to generate the required properties in its function - arguments. Property must exist in properties. - """ +class NodeConversationNodeEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeConversationNodeEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] -class ComponentToolCustomTool(TypedDict, total=False): name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + role: Required[Literal["tool_call_invocation"]] - type: Required[Literal["custom"]] + tool_call_id: Required[str] - url: Required[str] - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ - args_at_root: bool - """ - If set to true, the parameters will be passed as root level JSON object instead - of nested under "args". - """ +class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - description: str - """Describes what this tool does and when to call this tool.""" + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] + + +NodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +] + + +class NodeConversationNodeFinetuneConversationExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" + + transcript: Required[Iterable[NodeConversationNodeFinetuneConversationExampleTranscript]] + """The example transcript to finetune how the conversation should be.""" + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["agent", "user"]] + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + + name: Required[str] + + role: Required[Literal["tool_call_invocation"]] + + tool_call_id: Required[str] + + +class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] + + role: Required[Literal["tool_call_result"]] - execution_message_description: str - """The description for the sentence agent say during execution. + tool_call_id: Required[str] - Only applicable when speak_during_execution is true. Can write what to say or - even provide examples. The default is "The message you will say to callee when - calling this tool. Make sure it fits into the conversation smoothly.". - """ - execution_message_type: Literal["prompt", "static_text"] - """Type of execution message. +NodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +] - "prompt" means the agent will use execution_message_description as a prompt to - generate the message. "static_text" means the agent will speak the - execution_message_description directly. Defaults to "prompt". - """ - headers: Dict[str, str] - """Headers to add to the request.""" +class NodeConversationNodeFinetuneTransitionExample(TypedDict, total=False): + id: Required[str] + """Unique identifier for the example""" - method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] - """Method to use for the request, default to POST.""" + transcript: Required[Iterable[NodeConversationNodeFinetuneTransitionExampleTranscript]] + """The example transcript to finetune how the node should transition.""" - parameters: ComponentToolCustomToolParameters - """The parameters the functions accepts, described as a JSON Schema object. + destination_node_id: str + """Optional destination node ID""" - See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. Omitting parameters defines a function with - an empty parameter list. - """ - query_params: Dict[str, str] - """Query parameters to append to the request URL.""" +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" - response_variables: Dict[str, str] - """A mapping of variable names to JSON paths in the response body. + type: Required[Literal["prompt"]] - These values will be extracted from the response and made available as dynamic - variables for use. - """ - speak_after_execution: bool - """ - Determines whether the agent would call LLM another time and speak when the - result of function is obtained. Usually this needs to get turned on so user can - get update for the function call. - """ +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( + TypedDict, total=False +): + left: Required[str] + """Left side of the equation""" - speak_during_execution: bool - """ - Determines whether the agent would say sentence like "One moment, let me check - that." when executing the function. Recommend to turn on if your function call - takes over 1s (including network) to complete, so that your agent remains - responsive. - """ + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] - timeout_ms: int - """The maximum time in milliseconds the tool can run before it's considered - timeout. + right: str + """Right side of the equation. - If the tool times out, the agent would have that info. The minimum value allowed - is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 min). By default, - this is set to 120,000 ms (2 min). + The right side of the equation not required when "exists" or "not_exist" are + selected. """ - tool_id: str - """Unique identifier for the tool""" +class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[ + Iterable[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + ] -class ComponentToolCheckAvailabilityCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to check - availability for. - """ + operator: Required[Literal["||", "&&"]] - event_type_id: Required[Union[float, str]] - """ - Cal.com event type id number for the cal.com event you want to check - availability for. Can be a number or a dynamic variable in the format - `{{variable_name}}` that will be resolved at runtime. - """ + type: Required[Literal["equation"]] - name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ +NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +] - type: Required[Literal["check_availability_cal"]] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ +class NodeConversationNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" - timezone: str - """ - Timezone to be used when checking availability, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ + transition_condition: Required[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition] - tool_id: str - """Unique identifier for the tool""" + destination_node_id: str + """ID of the destination node""" -class ComponentToolBookAppointmentCalTool(TypedDict, total=False): - cal_api_key: Required[str] - """ - Cal.com Api key that have access to the cal.com event you want to book - appointment. - """ +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - event_type_id: Required[Union[float, str]] - """Cal.com event type id number for the cal.com event you want to book appointment. + role: Required[Literal["agent", "user"]] - Can be a number or a dynamic variable in the format `{{variable_name}}` that - will be resolved at runtime. - """ + +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] name: Required[str] - """Name of the tool. - Must be unique within all tools available to LLM at any given time (general - tools + state tools + state transitions). Must be consisted of a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64 (no space allowed). - """ + role: Required[Literal["tool_call_invocation"]] - type: Required[Literal["book_appointment_cal"]] + tool_call_id: Required[str] - description: str - """ - Describes what the tool does, sometimes can also include information about when - to call the tool. - """ - timezone: str - """ - Timezone to be used when booking appointment, must be in - [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - Can also be a dynamic variable in the format `{{variable_name}}` that will be - resolved at runtime. If not specified, will check if user specified timezone in - call, and if not, will use the timezone of the Retell servers. - """ +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] - tool_id: str - """Unique identifier for the tool""" + role: Required[Literal["tool_call_result"]] + + tool_call_id: Required[str] -ComponentTool: TypeAlias = Union[ - ComponentToolCustomTool, ComponentToolCheckAvailabilityCalTool, ComponentToolBookAppointmentCalTool +NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class Component(TypedDict, total=False): - name: Required[str] - """Name of the component""" +class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" - nodes: Required[Iterable[ComponentNode]] - """Nodes that make up the component""" - begin_tag_display_position: Optional[ComponentBeginTagDisplayPosition] - """Display position for the begin tag in the frontend""" +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): + content: Required[str] - mcps: Optional[Iterable[ComponentMcp]] - """A list of MCP server configurations to use for this component""" + role: Required[Literal["agent", "user"]] - start_node_id: Optional[str] - """ID of the starting node""" - tools: Optional[Iterable[ComponentTool]] - """Tools available within the component""" +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): + arguments: Required[str] + name: Required[str] -class KBConfig(TypedDict, total=False): - """Knowledge base configuration for RAG retrieval.""" + role: Required[Literal["tool_call_invocation"]] - filter_score: float - """Similarity threshold for filtering search results""" + tool_call_id: Required[str] - top_k: int - """Max number of knowledge base chunks to retrieve""" +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): + content: Required[str] -class Mcp(TypedDict, total=False): - name: Required[str] + role: Required[Literal["tool_call_result"]] - url: Required[str] - """The URL of the MCP server.""" + tool_call_id: Required[str] - headers: Dict[str, str] - """Headers to add to the MCP connection request.""" - query_params: Dict[str, str] - """Query parameters to append to the MCP connection request URL.""" +NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +] - timeout_ms: int - """Maximum time to wait for a connection to be established (in milliseconds). - Default to 120,000 ms (2 minutes). +class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] + """Find tune the transition condition to this global node""" + + +class NodeConversationNodeGlobalNodeSetting(TypedDict, total=False): + condition: Required[str] + """Condition for global node activation, cannot be empty""" + + cool_down: float + """ + The same global node won't be triggered again within the next N node + transitions. """ + go_back_conditions: Iterable[NodeConversationNodeGlobalNodeSettingGoBackCondition] + """The conditions for global node go back. -class ModelChoice(TypedDict, total=False): - """The model choice for the conversation flow.""" + There would be no destination_node_id for these edges. + """ + negative_finetune_examples: Iterable[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample] + """Don't transition to this node""" + + positive_finetune_examples: Iterable[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample] + """Transition to this node""" + + +class NodeConversationNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -7622,35 +8698,117 @@ class ModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeConversationNodeInstructionNodeInstructionPrompt(TypedDict, total=False): - text: Required[str] - """The prompt text for the instruction""" +class NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): + prompt: Required[str] + """Prompt condition text""" type: Required[Literal["prompt"]] - """Type of instruction""" -class NodeConversationNodeInstructionNodeInstructionStaticText(TypedDict, total=False): - text: Required[str] - """The static text for the instruction""" +class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): + left: Required[str] + """Left side of the equation""" - type: Required[Literal["static_text"]] - """Type of instruction""" + operator: Required[Literal["==", "!=", ">", ">=", "<", "<=", "contains", "not_contains", "exists", "not_exist"]] + right: str + """Right side of the equation. -NodeConversationNodeInstruction: TypeAlias = Union[ - NodeConversationNodeInstructionNodeInstructionPrompt, NodeConversationNodeInstructionNodeInstructionStaticText + The right side of the equation not required when "exists" or "not_exist" are + selected. + """ + + +class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] + + operator: Required[Literal["||", "&&"]] + + type: Required[Literal["equation"]] + + prompt: Literal["Skip response"] + """Must be "Skip response" for skip response edge""" + + +class NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): + prompt: Required[Literal["Skip response"]] + """Must be "Skip response" for skip response edge""" + + type: Required[Literal["prompt"]] + + +NodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeConversationNodeSkipResponseEdge(TypedDict, total=False): + id: Required[str] + """Unique identifier for the edge""" + + transition_condition: Required[NodeConversationNodeSkipResponseEdgeTransitionCondition] + + destination_node_id: str + """ID of the destination node""" + + +class NodeConversationNode(TypedDict, total=False): + id: Required[str] + """Unique identifier for the node""" + + instruction: Required[NodeConversationNodeInstruction] + + type: Required[Literal["conversation"]] + """Type of the node""" + + always_edge: NodeConversationNodeAlwaysEdge + + display_position: NodeConversationNodeDisplayPosition + """Position for frontend display""" + + edges: Iterable[NodeConversationNodeEdge] + + finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + + finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + + global_node_setting: NodeConversationNodeGlobalNodeSetting + + interruption_sensitivity: Optional[float] + + knowledge_base_ids: Optional[SequenceNotStr[str]] + """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" + + model_choice: NodeConversationNodeModelChoice + + name: str + """Optional name for display purposes""" + + responsiveness: Optional[float] + + skip_response_edge: NodeConversationNodeSkipResponseEdge + + voice_speed: Optional[float] + + +class NodeSubagentNodeInstruction(TypedDict, total=False): + text: Required[str] + """The prompt text for the instruction""" + + type: Required[Literal["prompt"]] + """Type of instruction""" + + +class NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7664,8 +8822,8 @@ class NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation """ -class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeConversationNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] +class NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeAlwaysEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] @@ -7675,31 +8833,31 @@ class NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition(TypedDi """Must be "Always" for always edge""" -class NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Always"]] """Must be "Always" for always edge""" type: Required[Literal["prompt"]] -NodeConversationNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeAlwaysEdgeTransitionConditionPromptCondition, - NodeConversationNodeAlwaysEdgeTransitionConditionEquationCondition, - NodeConversationNodeAlwaysEdgeTransitionConditionUnionMember2, +NodeSubagentNodeAlwaysEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeAlwaysEdgeTransitionConditionPromptCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionEquationCondition, + NodeSubagentNodeAlwaysEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeAlwaysEdge(TypedDict, total=False): +class NodeSubagentNodeAlwaysEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeConversationNodeAlwaysEdgeTransitionCondition] + transition_condition: Required[NodeSubagentNodeAlwaysEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeConversationNodeDisplayPosition(TypedDict, total=False): +class NodeSubagentNodeDisplayPosition(TypedDict, total=False): """Position for frontend display""" x: float @@ -7707,14 +8865,14 @@ class NodeConversationNodeDisplayPosition(TypedDict, total=False): y: float -class NodeConversationNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeSubagentNodeEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -7728,37 +8886,36 @@ class NodeConversationNodeEdgeTransitionConditionEquationConditionEquation(Typed """ -class NodeConversationNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeConversationNodeEdgeTransitionConditionEquationConditionEquation]] +class NodeSubagentNodeEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] type: Required[Literal["equation"]] -NodeConversationNodeEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeEdgeTransitionConditionPromptCondition, - NodeConversationNodeEdgeTransitionConditionEquationCondition, +NodeSubagentNodeEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeEdgeTransitionConditionPromptCondition, NodeSubagentNodeEdgeTransitionConditionEquationCondition ] -class NodeConversationNodeEdge(TypedDict, total=False): +class NodeSubagentNodeEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeConversationNodeEdgeTransitionCondition] + transition_condition: Required[NodeSubagentNodeEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7768,7 +8925,7 @@ class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1(Type tool_call_id: Required[str] -class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7776,28 +8933,28 @@ class NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2(Type tool_call_id: Required[str] -NodeConversationNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember0, - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember1, - NodeConversationNodeFinetuneConversationExampleTranscriptUnionMember2, +NodeSubagentNodeFinetuneConversationExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneConversationExampleTranscriptUnionMember2, ] -class NodeConversationNodeFinetuneConversationExample(TypedDict, total=False): +class NodeSubagentNodeFinetuneConversationExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[NodeConversationNodeFinetuneConversationExampleTranscript]] + transcript: Required[Iterable[NodeSubagentNodeFinetuneConversationExampleTranscript]] """The example transcript to finetune how the conversation should be.""" -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7807,7 +8964,7 @@ class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1(TypedD tool_call_id: Required[str] -class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7815,32 +8972,32 @@ class NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2(TypedD tool_call_id: Required[str] -NodeConversationNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember0, - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember1, - NodeConversationNodeFinetuneTransitionExampleTranscriptUnionMember2, +NodeSubagentNodeFinetuneTransitionExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember0, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember1, + NodeSubagentNodeFinetuneTransitionExampleTranscriptUnionMember2, ] -class NodeConversationNodeFinetuneTransitionExample(TypedDict, total=False): +class NodeSubagentNodeFinetuneTransitionExample(TypedDict, total=False): id: Required[str] """Unique identifier for the example""" - transcript: Required[Iterable[NodeConversationNodeFinetuneTransitionExampleTranscript]] + transcript: Required[Iterable[NodeSubagentNodeFinetuneTransitionExampleTranscript]] """The example transcript to finetune how the node should transition.""" destination_node_id: str """Optional destination node ID""" -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation( TypedDict, total=False ): left: Required[str] @@ -7856,9 +9013,9 @@ class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu """ -class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition(TypedDict, total=False): equations: Required[ - Iterable[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] + Iterable[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationConditionEquation] ] operator: Required[Literal["||", "&&"]] @@ -7866,29 +9023,29 @@ class NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEqu type: Required[Literal["equation"]] -NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, - NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, +NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionPromptCondition, + NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionConditionEquationCondition, ] -class NodeConversationNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingGoBackCondition(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeConversationNodeGlobalNodeSettingGoBackConditionTransitionCondition] + transition_condition: Required[NodeSubagentNodeGlobalNodeSettingGoBackConditionTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7898,7 +9055,7 @@ class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7906,25 +9063,25 @@ class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnio tool_call_id: Required[str] -NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, - NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, +NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscriptUnionMember2, ] -class NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] +class NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0(TypedDict, total=False): content: Required[str] role: Required[Literal["agent", "user"]] -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1(TypedDict, total=False): arguments: Required[str] name: Required[str] @@ -7934,7 +9091,7 @@ class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2(TypedDict, total=False): content: Required[str] role: Required[Literal["tool_call_result"]] @@ -7942,19 +9099,19 @@ class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnio tool_call_id: Required[str] -NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, - NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, +NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript: TypeAlias = Union[ + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember0, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember1, + NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscriptUnionMember2, ] -class NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): - transcript: Required[Iterable[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] +class NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample(TypedDict, total=False): + transcript: Required[Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExampleTranscript]] """Find tune the transition condition to this global node""" -class NodeConversationNodeGlobalNodeSetting(TypedDict, total=False): +class NodeSubagentNodeGlobalNodeSetting(TypedDict, total=False): condition: Required[str] """Condition for global node activation, cannot be empty""" @@ -7964,20 +9121,20 @@ class NodeConversationNodeGlobalNodeSetting(TypedDict, total=False): transitions. """ - go_back_conditions: Iterable[NodeConversationNodeGlobalNodeSettingGoBackCondition] + go_back_conditions: Iterable[NodeSubagentNodeGlobalNodeSettingGoBackCondition] """The conditions for global node go back. There would be no destination_node_id for these edges. """ - negative_finetune_examples: Iterable[NodeConversationNodeGlobalNodeSettingNegativeFinetuneExample] + negative_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingNegativeFinetuneExample] """Don't transition to this node""" - positive_finetune_examples: Iterable[NodeConversationNodeGlobalNodeSettingPositiveFinetuneExample] + positive_finetune_examples: Iterable[NodeSubagentNodeGlobalNodeSettingPositiveFinetuneExample] """Transition to this node""" -class NodeConversationNodeModelChoice(TypedDict, total=False): +class NodeSubagentNodeModelChoice(TypedDict, total=False): model: Required[ Literal[ "gpt-4.1", @@ -8008,14 +9165,14 @@ class NodeConversationNodeModelChoice(TypedDict, total=False): """Whether to use high priority pool with more dedicated resource, default false""" -class NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition(TypedDict, total=False): prompt: Required[str] """Prompt condition text""" type: Required[Literal["prompt"]] -class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation(TypedDict, total=False): left: Required[str] """Left side of the equation""" @@ -8029,8 +9186,8 @@ class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEq """ -class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): - equations: Required[Iterable[NodeConversationNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] +class NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition(TypedDict, total=False): + equations: Required[Iterable[NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationConditionEquation]] operator: Required[Literal["||", "&&"]] @@ -8040,31 +9197,31 @@ class NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition(T """Must be "Skip response" for skip response edge""" -class NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): +class NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2(TypedDict, total=False): prompt: Required[Literal["Skip response"]] """Must be "Skip response" for skip response edge""" type: Required[Literal["prompt"]] -NodeConversationNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ - NodeConversationNodeSkipResponseEdgeTransitionConditionPromptCondition, - NodeConversationNodeSkipResponseEdgeTransitionConditionEquationCondition, - NodeConversationNodeSkipResponseEdgeTransitionConditionUnionMember2, +NodeSubagentNodeSkipResponseEdgeTransitionCondition: TypeAlias = Union[ + NodeSubagentNodeSkipResponseEdgeTransitionConditionPromptCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionEquationCondition, + NodeSubagentNodeSkipResponseEdgeTransitionConditionUnionMember2, ] -class NodeConversationNodeSkipResponseEdge(TypedDict, total=False): +class NodeSubagentNodeSkipResponseEdge(TypedDict, total=False): id: Required[str] """Unique identifier for the edge""" - transition_condition: Required[NodeConversationNodeSkipResponseEdgeTransitionCondition] + transition_condition: Required[NodeSubagentNodeSkipResponseEdgeTransitionCondition] destination_node_id: str """ID of the destination node""" -class NodeConversationNodeToolEndCallTool(TypedDict, total=False): +class NodeSubagentNodeToolEndCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8099,7 +9256,7 @@ class NodeConversationNodeToolEndCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined(TypedDict, total=False): number: Required[str] """ The number to transfer to in E.164 format or a dynamic variable like @@ -8117,7 +9274,7 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """ -class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred(TypedDict, total=False): prompt: Required[str] """The prompt to be used to help infer the transfer destination. @@ -8130,13 +9287,13 @@ class NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestina """The type of transfer destination.""" -NodeConversationNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, - NodeConversationNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, +NodeSubagentNodeToolTransferCallToolTransferDestination: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationPredefined, + NodeSubagentNodeToolTransferCallToolTransferDestinationTransferDestinationInferred, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False): type: Required[Literal["cold_transfer"]] """The type of the transfer.""" @@ -8164,7 +9321,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption(TypedDict, total=False): """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -8176,7 +9333,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -8185,7 +9342,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -8194,13 +9351,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -8209,7 +9366,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -8218,13 +9375,13 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False): type: Required[Literal["warm_transfer"]] """The type of the transfer.""" @@ -8234,7 +9391,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr enable_bridge_audio_cue: bool """Whether to play an audio cue when bridging the call. Defaults to true.""" - ivr_option: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption + ivr_option: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferIvrOption """IVR navigation option to run when doing human detection. This prompt will guide the AI on how to navigate the IVR system. @@ -8250,7 +9407,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ private_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPrivateHandoffOption ) """ If set, when transfer is connected, will say the handoff message only to the @@ -8259,7 +9416,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -8281,7 +9438,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTr """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent( TypedDict, total=False ): """The agent that will mediate the transfer decision.""" @@ -8298,7 +9455,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The version of the transfer agent to use.""" -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig( TypedDict, total=False ): """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -8309,7 +9466,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti Defaults to cancel_transfer. """ - transfer_agent: NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent + transfer_agent: NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfigTransferAgent """The agent that will mediate the transfer decision.""" transfer_timeout_ms: float @@ -8319,7 +9476,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt( TypedDict, total=False ): prompt: str @@ -8328,7 +9485,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["prompt"] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage( TypedDict, total=False ): message: str @@ -8337,15 +9494,15 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti type: Literal["static_message"] -NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, +NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferPrompt, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOptionWarmTransferStaticMessage, ] -class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer(TypedDict, total=False): agentic_transfer_config: Required[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferAgenticTransferConfig ] """Configuration for agentic warm transfer. Required for agentic warm transfer.""" @@ -8359,7 +9516,7 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """The music to play while the caller is being transferred.""" public_handoff_option: ( - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransferPublicHandoffOption ) """ If set, when transfer is successful, will say the handoff message to both the @@ -8381,14 +9538,14 @@ class NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenti """ -NodeConversationNodeToolTransferCallToolTransferOption: TypeAlias = Union[ - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, - NodeConversationNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, +NodeSubagentNodeToolTransferCallToolTransferOption: TypeAlias = Union[ + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionColdTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionWarmTransfer, + NodeSubagentNodeToolTransferCallToolTransferOptionTransferOptionAgenticWarmTransfer, ] -class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): +class NodeSubagentNodeToolTransferCallTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8396,9 +9553,9 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): tools + state tools + state edges). """ - transfer_destination: Required[NodeConversationNodeToolTransferCallToolTransferDestination] + transfer_destination: Required[NodeSubagentNodeToolTransferCallToolTransferDestination] - transfer_option: Required[NodeConversationNodeToolTransferCallToolTransferOption] + transfer_option: Required[NodeSubagentNodeToolTransferCallToolTransferOption] type: Required[Literal["transfer_call"]] @@ -8437,7 +9594,7 @@ class NodeConversationNodeToolTransferCallTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): +class NodeSubagentNodeToolCheckAvailabilityCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to check @@ -8477,7 +9634,7 @@ class NodeConversationNodeToolCheckAvailabilityCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): +class NodeSubagentNodeToolBookAppointmentCalTool(TypedDict, total=False): cal_api_key: Required[str] """ Cal.com Api key that have access to the cal.com event you want to book @@ -8517,7 +9674,7 @@ class NodeConversationNodeToolBookAppointmentCalTool(TypedDict, total=False): """ -class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): +class NodeSubagentNodeToolAgentSwapTool(TypedDict, total=False): agent_id: Required[str] """The id of the agent to swap to.""" @@ -8568,7 +9725,7 @@ class NodeConversationNodeToolAgentSwapTool(TypedDict, total=False): """Webhook setting for the agent swap, defaults to only source.""" -class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): +class NodeSubagentNodeToolPressDigitTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8593,14 +9750,14 @@ class NodeConversationNodeToolPressDigitTool(TypedDict, total=False): """ -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined(TypedDict, total=False): content: str """The static message to be sent in the SMS. Can contain dynamic variables.""" type: Literal["predefined"] -class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, total=False): prompt: str """The prompt to be used to help infer the SMS content. @@ -8611,13 +9768,13 @@ class NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred(TypedDict, type: Literal["inferred"] -NodeConversationNodeToolSendSMSToolSMSContent: TypeAlias = Union[ - NodeConversationNodeToolSendSMSToolSMSContentSMSContentPredefined, - NodeConversationNodeToolSendSMSToolSMSContentSMSContentInferred, +NodeSubagentNodeToolSendSMSToolSMSContent: TypeAlias = Union[ + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentPredefined, + NodeSubagentNodeToolSendSMSToolSMSContentSMSContentInferred, ] -class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): +class NodeSubagentNodeToolSendSMSTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8625,7 +9782,7 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): tools + state tools + state edges). """ - sms_content: Required[NodeConversationNodeToolSendSMSToolSMSContent] + sms_content: Required[NodeSubagentNodeToolSendSMSToolSMSContent] type: Required[Literal["send_sms"]] @@ -8635,8 +9792,28 @@ class NodeConversationNodeToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + -class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): +class NodeSubagentNodeToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting parameters defines a function with an empty parameter list. @@ -8659,7 +9836,7 @@ class NodeConversationNodeToolCustomToolParameters(TypedDict, total=False): """ -class NodeConversationNodeToolCustomTool(TypedDict, total=False): +class NodeSubagentNodeToolCustomTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8707,7 +9884,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] """Method to use for the request, default to POST.""" - parameters: NodeConversationNodeToolCustomToolParameters + parameters: NodeSubagentNodeToolCustomToolParameters """The parameters the functions accepts, described as a JSON Schema object. See [JSON Schema reference](https://json-schema.org/understanding-json-schema/) @@ -8750,7 +9927,7 @@ class NodeConversationNodeToolCustomTool(TypedDict, total=False): """ -class NodeConversationNodeToolCodeTool(TypedDict, total=False): +class NodeSubagentNodeToolCodeTool(TypedDict, total=False): code: Required[str] """JavaScript code to execute in the sandbox.""" @@ -8807,7 +9984,7 @@ class NodeConversationNodeToolCodeTool(TypedDict, total=False): """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8817,6 +9994,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -8827,7 +10011,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisDa """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): choices: Required[SequenceNotStr[str]] """The possible values of the variable, must be non empty array.""" @@ -8840,6 +10024,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8847,7 +10038,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8857,6 +10048,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8864,7 +10062,7 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisD """ -class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): description: Required[str] """Description of the variable.""" @@ -8874,6 +10072,13 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -8881,15 +10086,15 @@ class NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisDa """ -NodeConversationNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ - NodeConversationNodeToolExtractDynamicVariableToolVariableStringAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, - NodeConversationNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, +NodeSubagentNodeToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + NodeSubagentNodeToolExtractDynamicVariableToolVariableStringAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableEnumAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableBooleanAnalysisData, + NodeSubagentNodeToolExtractDynamicVariableToolVariableNumberAnalysisData, ] -class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False): +class NodeSubagentNodeToolExtractDynamicVariableTool(TypedDict, total=False): description: Required[str] """ Describes what the tool does, sometimes can also include information about when @@ -8906,11 +10111,11 @@ class NodeConversationNodeToolExtractDynamicVariableTool(TypedDict, total=False) type: Required[Literal["extract_dynamic_variable"]] - variables: Required[Iterable[NodeConversationNodeToolExtractDynamicVariableToolVariable]] + variables: Required[Iterable[NodeSubagentNodeToolExtractDynamicVariableToolVariable]] """The variables to be extracted.""" -class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolBridgeTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8947,7 +10152,7 @@ class NodeConversationNodeToolBridgeTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): +class NodeSubagentNodeToolCancelTransferTool(TypedDict, total=False): name: Required[str] """Name of the tool. @@ -8984,7 +10189,7 @@ class NodeConversationNodeToolCancelTransferTool(TypedDict, total=False): """If true, will speak during execution.""" -class NodeConversationNodeToolMcpTool(TypedDict, total=False): +class NodeSubagentNodeToolMcpTool(TypedDict, total=False): description: Required[str] """Description of the MCP tool.""" @@ -9037,67 +10242,67 @@ class NodeConversationNodeToolMcpTool(TypedDict, total=False): """ -NodeConversationNodeTool: TypeAlias = Union[ - NodeConversationNodeToolEndCallTool, - NodeConversationNodeToolTransferCallTool, - NodeConversationNodeToolCheckAvailabilityCalTool, - NodeConversationNodeToolBookAppointmentCalTool, - NodeConversationNodeToolAgentSwapTool, - NodeConversationNodeToolPressDigitTool, - NodeConversationNodeToolSendSMSTool, - NodeConversationNodeToolCustomTool, - NodeConversationNodeToolCodeTool, - NodeConversationNodeToolExtractDynamicVariableTool, - NodeConversationNodeToolBridgeTransferTool, - NodeConversationNodeToolCancelTransferTool, - NodeConversationNodeToolMcpTool, +NodeSubagentNodeTool: TypeAlias = Union[ + NodeSubagentNodeToolEndCallTool, + NodeSubagentNodeToolTransferCallTool, + NodeSubagentNodeToolCheckAvailabilityCalTool, + NodeSubagentNodeToolBookAppointmentCalTool, + NodeSubagentNodeToolAgentSwapTool, + NodeSubagentNodeToolPressDigitTool, + NodeSubagentNodeToolSendSMSTool, + NodeSubagentNodeToolCustomTool, + NodeSubagentNodeToolCodeTool, + NodeSubagentNodeToolExtractDynamicVariableTool, + NodeSubagentNodeToolBridgeTransferTool, + NodeSubagentNodeToolCancelTransferTool, + NodeSubagentNodeToolMcpTool, ] -class NodeConversationNode(TypedDict, total=False): +class NodeSubagentNode(TypedDict, total=False): id: Required[str] """Unique identifier for the node""" - instruction: Required[NodeConversationNodeInstruction] + instruction: Required[NodeSubagentNodeInstruction] - type: Required[Literal["conversation"]] + type: Required[Literal["subagent"]] """Type of the node""" - always_edge: NodeConversationNodeAlwaysEdge + always_edge: NodeSubagentNodeAlwaysEdge - display_position: NodeConversationNodeDisplayPosition + display_position: NodeSubagentNodeDisplayPosition """Position for frontend display""" - edges: Iterable[NodeConversationNodeEdge] + edges: Iterable[NodeSubagentNodeEdge] - finetune_conversation_examples: Iterable[NodeConversationNodeFinetuneConversationExample] + finetune_conversation_examples: Iterable[NodeSubagentNodeFinetuneConversationExample] - finetune_transition_examples: Iterable[NodeConversationNodeFinetuneTransitionExample] + finetune_transition_examples: Iterable[NodeSubagentNodeFinetuneTransitionExample] - global_node_setting: NodeConversationNodeGlobalNodeSetting + global_node_setting: NodeSubagentNodeGlobalNodeSetting interruption_sensitivity: Optional[float] knowledge_base_ids: Optional[SequenceNotStr[str]] """Knowledge base IDs for RAG (Retrieval-Augmented Generation).""" - model_choice: NodeConversationNodeModelChoice + model_choice: NodeSubagentNodeModelChoice name: str """Optional name for display purposes""" responsiveness: Optional[float] - skip_response_edge: NodeConversationNodeSkipResponseEdge + skip_response_edge: NodeSubagentNodeSkipResponseEdge tool_ids: Optional[SequenceNotStr[str]] """ The tool ids of the tools defined in main conversation flow or component that - can be used in this conversation node. + can be used in this subagent node. """ - tools: Optional[Iterable[NodeConversationNodeTool]] - """The tools owned by this conversation node. + tools: Optional[Iterable[NodeSubagentNodeTool]] + """The tools owned by this subagent node. This includes other tool types like transfer_call, agent_swap, etc. """ @@ -11692,6 +12897,13 @@ class NodeExtractDynamicVariablesNodeVariableStringAnalysisData(TypedDict, total type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -11715,6 +12927,13 @@ class NodeExtractDynamicVariablesNodeVariableEnumAnalysisData(TypedDict, total=F type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -11732,6 +12951,13 @@ class NodeExtractDynamicVariablesNodeVariableBooleanAnalysisData(TypedDict, tota type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -11749,6 +12975,13 @@ class NodeExtractDynamicVariablesNodeVariableNumberAnalysisData(TypedDict, total type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -13631,6 +14864,7 @@ class NodeCancelTransferNode(TypedDict, total=False): Node: TypeAlias = Union[ NodeConversationNode, + NodeSubagentNode, NodeEndNode, NodeFunctionNode, NodeCodeNode, @@ -13647,6 +14881,39 @@ class NodeCancelTransferNode(TypedDict, total=False): ] +class NoteDisplayPosition(TypedDict, total=False): + """Position of the note on the canvas.""" + + x: float + + y: float + + +class NoteSize(TypedDict, total=False): + """Dimensions of the note on the canvas.""" + + height: float + + width: float + + +class Note(TypedDict, total=False): + id: Required[str] + """Unique identifier for the note.""" + + content: Required[str] + """ + Text content of the note, can contain refs to images in the format + "" + """ + + display_position: Required[NoteDisplayPosition] + """Position of the note on the canvas.""" + + size: Required[NoteSize] + """Dimensions of the note on the canvas.""" + + class ToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index ad6c9faf..ed6c8b41 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -789,6 +789,26 @@ class GeneralToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class GeneralToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. @@ -971,6 +991,13 @@ class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -994,6 +1021,13 @@ class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, t type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1011,6 +1045,13 @@ class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1028,6 +1069,13 @@ class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1852,6 +1900,26 @@ class StateToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class StateToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. @@ -2034,6 +2102,13 @@ class StateToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, t type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -2057,6 +2132,13 @@ class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, tot type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -2074,6 +2156,13 @@ class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -2091,6 +2180,13 @@ class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, t type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index 33cb2815..cfd3c171 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -671,6 +671,26 @@ class GeneralToolSendSMSTool(BaseModel): to call the tool. """ + execution_message_description: Optional[str] = None + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: Optional[bool] = None + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class GeneralToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. @@ -853,6 +873,13 @@ class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel) type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -876,6 +903,13 @@ class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -893,6 +927,13 @@ class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -910,6 +951,13 @@ class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel) type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1736,6 +1784,26 @@ class StateToolSendSMSTool(BaseModel): to call the tool. """ + execution_message_description: Optional[str] = None + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Optional[Literal["prompt", "static_text"]] = None + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: Optional[bool] = None + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class StateToolCustomToolParameters(BaseModel): """The parameters the functions accepts, described as a JSON Schema object. @@ -1918,6 +1986,13 @@ class StateToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): type: Literal["string"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: Optional[List[str]] = None """Examples of the variable value to teach model the style and syntax.""" @@ -1941,6 +2016,13 @@ class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): type: Literal["enum"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1958,6 +2040,13 @@ class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): type: Literal["boolean"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. @@ -1975,6 +2064,13 @@ class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): type: Literal["number"] """Type of the variable to extract.""" + conditional_prompt: Optional[str] = None + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: Optional[bool] = None """Whether this data is required. diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index 7f557fa4..10817723 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -793,6 +793,26 @@ class GeneralToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class GeneralToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. @@ -975,6 +995,13 @@ class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -998,6 +1025,13 @@ class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, t type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1015,6 +1049,13 @@ class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1032,6 +1073,13 @@ class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -1856,6 +1904,26 @@ class StateToolSendSMSTool(TypedDict, total=False): to call the tool. """ + execution_message_description: str + """Describes what to say before sending the SMS. + + Only applicable when speak_during_execution is true. + """ + + execution_message_type: Literal["prompt", "static_text"] + """Type of execution message. + + "prompt" means the agent will use execution_message_description as a prompt to + generate the message. "static_text" means the agent will speak the + execution_message_description directly. Defaults to "prompt". + """ + + speak_during_execution: bool + """If true, the agent will speak a short line before sending the SMS. + + If omitted, defaults to true (same as end_call / transfer_call tools). + """ + class StateToolCustomToolParameters(TypedDict, total=False): """The parameters the functions accepts, described as a JSON Schema object. @@ -2038,6 +2106,13 @@ class StateToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, t type: Required[Literal["string"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + examples: SequenceNotStr[str] """Examples of the variable value to teach model the style and syntax.""" @@ -2061,6 +2136,13 @@ class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, tot type: Required[Literal["enum"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -2078,6 +2160,13 @@ class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, type: Required[Literal["boolean"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. @@ -2095,6 +2184,13 @@ class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, t type: Required[Literal["number"]] """Type of the variable to extract.""" + conditional_prompt: str + """ + Optional instruction to help decide whether this field needs to be populated in + the analysis. If not set, the field is always included. If required is true, + this is ignored. + """ + required: bool """Whether this data is required. diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index 9d620e0e..a4001ec1 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -70,6 +70,17 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, interruption_sensitivity=1, is_public=False, ivr_option={"action": {"type": "hangup"}}, @@ -86,6 +97,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -104,6 +116,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: ring_duration_ms=30000, signed_url_expiration_ms=86400000, stt_mode="fast", + timezone="America/New_York", user_dtmf_options={ "digit_limit": 1, "termination_key": "#", @@ -256,6 +269,17 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, interruption_sensitivity=1, is_public=False, ivr_option={"action": {"type": "hangup"}}, @@ -272,6 +296,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -295,6 +320,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: ring_duration_ms=30000, signed_url_expiration_ms=86400000, stt_mode="fast", + timezone="America/New_York", user_dtmf_options={ "digit_limit": 1, "termination_key": "#", @@ -575,6 +601,17 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, interruption_sensitivity=1, is_public=False, ivr_option={"action": {"type": "hangup"}}, @@ -591,6 +628,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -609,6 +647,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> ring_duration_ms=30000, signed_url_expiration_ms=86400000, stt_mode="fast", + timezone="America/New_York", user_dtmf_options={ "digit_limit": 1, "termination_key": "#", @@ -761,6 +800,17 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, interruption_sensitivity=1, is_public=False, ivr_option={"action": {"type": "hangup"}}, @@ -777,6 +827,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -800,6 +851,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> ring_duration_ms=30000, signed_url_expiration_ms=86400000, stt_mode="fast", + timezone="America/New_York", user_dtmf_options={ "digit_limit": 1, "termination_key": "#", diff --git a/tests/api_resources/test_batch_call.py b/tests/api_resources/test_batch_call.py index 1d99ac61..003c864c 100644 --- a/tests/api_resources/test_batch_call.py +++ b/tests/api_resources/test_batch_call.py @@ -63,6 +63,17 @@ def test_method_create_batch_call_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -79,6 +90,7 @@ def test_method_create_batch_call_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -102,6 +114,7 @@ def test_method_create_batch_call_with_all_params(self, client: Retell) -> None: "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -263,6 +276,17 @@ async def test_method_create_batch_call_with_all_params(self, async_client: Asyn "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -279,6 +303,7 @@ async def test_method_create_batch_call_with_all_params(self, async_client: Asyn "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -302,6 +327,7 @@ async def test_method_create_batch_call_with_all_params(self, async_client: Asyn "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", diff --git a/tests/api_resources/test_call.py b/tests/api_resources/test_call.py index 1b6978ae..338bcca6 100644 --- a/tests/api_resources/test_call.py +++ b/tests/api_resources/test_call.py @@ -281,6 +281,17 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -297,6 +308,7 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -320,6 +332,7 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -456,6 +469,17 @@ def test_method_create_web_call_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -472,6 +496,7 @@ def test_method_create_web_call_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -495,6 +520,7 @@ def test_method_create_web_call_with_all_params(self, client: Retell) -> None: "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -628,6 +654,17 @@ def test_method_register_phone_call_with_all_params(self, client: Retell) -> Non "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -644,6 +681,7 @@ def test_method_register_phone_call_with_all_params(self, client: Retell) -> Non "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -667,6 +705,7 @@ def test_method_register_phone_call_with_all_params(self, client: Retell) -> Non "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -1024,6 +1063,17 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -1040,6 +1090,7 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -1063,6 +1114,7 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -1199,6 +1251,17 @@ async def test_method_create_web_call_with_all_params(self, async_client: AsyncR "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -1215,6 +1278,7 @@ async def test_method_create_web_call_with_all_params(self, async_client: AsyncR "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -1238,6 +1302,7 @@ async def test_method_create_web_call_with_all_params(self, async_client: AsyncR "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", @@ -1371,6 +1436,17 @@ async def test_method_register_phone_call_with_all_params(self, async_client: As "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + "handbook_config": { + "ai_disclosure": True, + "default_personality": True, + "echo_verification": True, + "high_empathy": True, + "nato_phonetic_alphabet": True, + "natural_filler_words": True, + "scope_boundaries": True, + "smart_matching": True, + "speech_normalization": True, + }, "interruption_sensitivity": 1, "is_public": False, "ivr_option": {"action": {"type": "hangup"}}, @@ -1387,6 +1463,7 @@ async def test_method_register_phone_call_with_all_params(self, async_client: As "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -1410,6 +1487,7 @@ async def test_method_register_phone_call_with_all_params(self, async_client: As "ring_duration_ms": 30000, "signed_url_expiration_ms": 86400000, "stt_mode": "fast", + "timezone": "America/New_York", "user_dtmf_options": { "digit_limit": 1, "termination_key": "#", diff --git a/tests/api_resources/test_chat_agent.py b/tests/api_resources/test_chat_agent.py index 25e1cd69..c1644919 100644 --- a/tests/api_resources/test_chat_agent.py +++ b/tests/api_resources/test_chat_agent.py @@ -53,6 +53,12 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "high_empathy": True, + "scope_boundaries": True, + }, is_public=False, language="en-US", opt_in_signed_url=True, @@ -65,12 +71,14 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } ], post_chat_analysis_model="gpt-4.1-mini", signed_url_expiration_ms=86400000, + timezone="America/New_York", webhook_events=["chat_started"], webhook_timeout_ms=10000, webhook_url="https://webhook-url-here", @@ -186,6 +194,12 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "high_empathy": True, + "scope_boundaries": True, + }, is_public=False, language="en-US", opt_in_signed_url=True, @@ -198,6 +212,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -209,6 +224,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "version": 0, }, signed_url_expiration_ms=86400000, + timezone="America/New_York", webhook_events=["chat_started"], webhook_timeout_ms=10000, webhook_url="https://webhook-url-here", @@ -451,6 +467,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "high_empathy": True, + "scope_boundaries": True, + }, is_public=False, language="en-US", opt_in_signed_url=True, @@ -463,12 +485,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } ], post_chat_analysis_model="gpt-4.1-mini", signed_url_expiration_ms=86400000, + timezone="America/New_York", webhook_events=["chat_started"], webhook_timeout_ms=10000, webhook_url="https://webhook-url-here", @@ -584,6 +608,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "input_topics": ["platform_integrity_jailbreaking"], "output_topics": ["harassment"], }, + handbook_config={ + "ai_disclosure": True, + "default_personality": True, + "high_empathy": True, + "scope_boundaries": True, + }, is_public=False, language="en-US", opt_in_signed_url=True, @@ -596,6 +626,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "description": "The name of the customer.", "name": "customer_name", "type": "string", + "conditional_prompt": "conditional_prompt", "examples": ["John Doe", "Jane Smith"], "required": True, } @@ -607,6 +638,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "version": 0, }, signed_url_expiration_ms=86400000, + timezone="America/New_York", webhook_events=["chat_started"], webhook_timeout_ms=10000, webhook_url="https://webhook-url-here", diff --git a/tests/api_resources/test_conversation_flow.py b/tests/api_resources/test_conversation_flow.py index 0a307d1a..ddfad726 100644 --- a/tests/api_resources/test_conversation_flow.py +++ b/tests/api_resources/test_conversation_flow.py @@ -155,17 +155,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -282,17 +271,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -312,6 +290,20 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "timeout_ms": 0, } ], + "notes": [ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], "start_node_id": "collect_info", "tools": [ { @@ -366,6 +358,20 @@ def test_method_create_with_all_params(self, client: Retell) -> None: } ], model_temperature=0.7, + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="start", tool_call_strict_mode=True, tools=[ @@ -629,17 +635,6 @@ def test_method_update_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -659,6 +654,20 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "timeout_ms": 0, } ], + "notes": [ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], "start_node_id": "collect_info", "tools": [ { @@ -822,20 +831,23 @@ def test_method_update_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="start", start_speaker="agent", tool_call_strict_mode=True, @@ -1124,17 +1136,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -1251,17 +1252,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -1281,6 +1271,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "timeout_ms": 0, } ], + "notes": [ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], "start_node_id": "collect_info", "tools": [ { @@ -1335,6 +1339,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> } ], model_temperature=0.7, + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="start", tool_call_strict_mode=True, tools=[ @@ -1598,17 +1616,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -1628,6 +1635,20 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "timeout_ms": 0, } ], + "notes": [ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], "start_node_id": "collect_info", "tools": [ { @@ -1791,20 +1812,23 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="start", start_speaker="agent", tool_call_strict_mode=True, diff --git a/tests/api_resources/test_conversation_flow_component.py b/tests/api_resources/test_conversation_flow_component.py index 1d6ebc4b..f8421851 100644 --- a/tests/api_resources/test_conversation_flow_component.py +++ b/tests/api_resources/test_conversation_flow_component.py @@ -147,17 +147,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -177,6 +166,20 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "timeout_ms": 0, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="collect_info", tools=[ { @@ -432,20 +435,23 @@ def test_method_update_with_all_params(self, client: Retell) -> None: }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="collect_info", tools=[ { @@ -718,17 +724,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], @@ -748,6 +743,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "timeout_ms": 0, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="collect_info", tools=[ { @@ -1003,20 +1012,23 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> }, "destination_node_id": "destination_node_id", }, - "tool_ids": ["string"], - "tools": [ - { - "name": "name", - "type": "end_call", - "description": "description", - "execution_message_description": "execution_message_description", - "execution_message_type": "prompt", - "speak_during_execution": True, - } - ], "voice_speed": 0.5, } ], + notes=[ + { + "id": "note_abc123", + "content": "Remember to handle edge cases here.", + "display_position": { + "x": 300, + "y": 150, + }, + "size": { + "height": 100, + "width": 200, + }, + } + ], start_node_id="collect_info", tools=[ { From 562cf0eaf25351c03428e9592f2f6a3889733983 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 17:46:32 +0000 Subject: [PATCH 3/3] release: 5.24.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/retell/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 09aab9a4..969c522a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.23.0" + ".": "5.24.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ed2f37..13339fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.24.0 (2026-04-01) + +Full Changelog: [v5.23.0...v5.24.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.23.0...v5.24.0) + +### Features + +* **api:** api update ([bef8663](https://github.com/RetellAI/retell-python-sdk/commit/bef8663280eb89c6bf06f990a37059ebcb0f80ca)) + ## 5.23.0 (2026-03-27) Full Changelog: [v5.22.2...v5.23.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.22.2...v5.23.0) diff --git a/pyproject.toml b/pyproject.toml index a1a21e07..b6e9474c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "5.23.0" +version = "5.24.0" description = "The official Python library for the retell API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/retell/_version.py b/src/retell/_version.py index 26761ae3..22a8ad54 100644 --- a/src/retell/_version.py +++ b/src/retell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "retell" -__version__ = "5.23.0" # x-release-please-version +__version__ = "5.24.0" # x-release-please-version