retell-sdk 5.23.0 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/agent.d.mts +3 -3
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +3 -3
- package/resources/agent.d.ts.map +1 -1
- package/resources/batch-call.d.mts +2 -2
- package/resources/batch-call.d.mts.map +1 -1
- package/resources/batch-call.d.ts +2 -2
- package/resources/batch-call.d.ts.map +1 -1
- package/resources/call.d.mts +1165 -16
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +1165 -16
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js.map +1 -1
- package/resources/call.mjs.map +1 -1
- package/resources/llm.d.mts +3 -3
- package/resources/llm.d.mts.map +1 -1
- package/resources/llm.d.ts +3 -3
- package/resources/llm.d.ts.map +1 -1
- package/src/resources/agent.ts +6 -0
- package/src/resources/batch-call.ts +3 -1
- package/src/resources/call.ts +1440 -13
- package/src/resources/llm.ts +3 -3
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/call.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import * as CallAPI from "./call.mjs";
|
|
3
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
4
|
export declare class Call extends APIResource {
|
|
@@ -1835,22 +1834,1172 @@ export interface CallListResponse {
|
|
|
1835
1834
|
* Whether more results are available.
|
|
1836
1835
|
*/
|
|
1837
1836
|
has_more?: boolean;
|
|
1838
|
-
items?: Array<CallListResponse.
|
|
1837
|
+
items?: Array<CallListResponse.V3WebCallResponse | CallListResponse.V3PhoneCallResponse>;
|
|
1839
1838
|
/**
|
|
1840
1839
|
* Pagination key for the next page.
|
|
1841
1840
|
*/
|
|
1842
1841
|
pagination_key?: string;
|
|
1843
1842
|
}
|
|
1844
1843
|
export declare namespace CallListResponse {
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1844
|
+
interface V3WebCallResponse {
|
|
1845
|
+
/**
|
|
1846
|
+
* Access token to enter the web call room. This needs to be passed to your
|
|
1847
|
+
* frontend to join the call.
|
|
1848
|
+
*/
|
|
1849
|
+
access_token: string;
|
|
1850
|
+
/**
|
|
1851
|
+
* Corresponding agent id of this call.
|
|
1852
|
+
*/
|
|
1853
|
+
agent_id: string;
|
|
1854
|
+
/**
|
|
1855
|
+
* The version of the agent.
|
|
1856
|
+
*/
|
|
1857
|
+
agent_version: number;
|
|
1858
|
+
/**
|
|
1859
|
+
* Unique id of the call. Used to identify the call in the LLM websocket and used
|
|
1860
|
+
* to authenticate in the audio websocket.
|
|
1861
|
+
*/
|
|
1862
|
+
call_id: string;
|
|
1863
|
+
/**
|
|
1864
|
+
* Status of call.
|
|
1865
|
+
*
|
|
1866
|
+
* - `registered`: Call id issued, starting to make a call using this id.
|
|
1867
|
+
* - `ongoing`: Call connected and ongoing.
|
|
1868
|
+
* - `ended`: The underlying websocket has ended for the call. Either user or agent
|
|
1869
|
+
* hung up, or call transferred.
|
|
1870
|
+
* - `error`: Call encountered error.
|
|
1871
|
+
*/
|
|
1872
|
+
call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
|
|
1873
|
+
/**
|
|
1874
|
+
* Type of the call. Used to distinguish between web call and phone call.
|
|
1875
|
+
*/
|
|
1876
|
+
call_type: 'web_call';
|
|
1877
|
+
/**
|
|
1878
|
+
* Name of the agent.
|
|
1879
|
+
*/
|
|
1880
|
+
agent_name?: string;
|
|
1881
|
+
/**
|
|
1882
|
+
* Post call analysis that includes information such as sentiment, status, summary,
|
|
1883
|
+
* and custom defined data to extract. Available after call ends. Subscribe to
|
|
1884
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
1885
|
+
*/
|
|
1886
|
+
call_analysis?: V3WebCallResponse.CallAnalysis;
|
|
1887
|
+
/**
|
|
1888
|
+
* Cost of the call, including all the products and their costs and discount.
|
|
1889
|
+
*/
|
|
1890
|
+
call_cost?: V3WebCallResponse.CallCost;
|
|
1891
|
+
/**
|
|
1892
|
+
* Dynamic variables collected from the call. Only available after the call ends.
|
|
1893
|
+
*/
|
|
1894
|
+
collected_dynamic_variables?: {
|
|
1895
|
+
[key: string]: unknown;
|
|
1896
|
+
};
|
|
1897
|
+
/**
|
|
1898
|
+
* Custom SIP headers to be added to the call.
|
|
1899
|
+
*/
|
|
1900
|
+
custom_sip_headers?: {
|
|
1901
|
+
[key: string]: string;
|
|
1902
|
+
};
|
|
1903
|
+
/**
|
|
1904
|
+
* Data storage setting for this call's agent. "everything" stores all data,
|
|
1905
|
+
* "everything_except_pii" excludes PII when possible, "basic_attributes_only"
|
|
1906
|
+
* stores only metadata.
|
|
1907
|
+
*/
|
|
1908
|
+
data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
|
|
1909
|
+
/**
|
|
1910
|
+
* The reason for the disconnection of the call. Read detailed description about
|
|
1911
|
+
* reasons listed here at
|
|
1912
|
+
* [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
|
|
1913
|
+
*/
|
|
1914
|
+
disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped';
|
|
1915
|
+
/**
|
|
1916
|
+
* Duration of the call in milliseconds. Available after call ends.
|
|
1917
|
+
*/
|
|
1918
|
+
duration_ms?: number;
|
|
1919
|
+
/**
|
|
1920
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
1921
|
+
*/
|
|
1922
|
+
end_timestamp?: number;
|
|
1923
|
+
/**
|
|
1924
|
+
* URL to the knowledge base retrieved contents of the call. Available after call
|
|
1925
|
+
* ends if the call utilizes knowledge base feature. It consists of the respond id
|
|
1926
|
+
* and the retrieved contents related to that response. It's already rendered in
|
|
1927
|
+
* call history tab of dashboard, and you can also manually download and check
|
|
1928
|
+
* against the transcript to view the knowledge base retrieval results.
|
|
1929
|
+
*/
|
|
1930
|
+
knowledge_base_retrieved_contents_url?: string;
|
|
1931
|
+
/**
|
|
1932
|
+
* Latency tracking of the call, available after call ends. Not all fields here
|
|
1933
|
+
* will be available, as it depends on the type of call and feature used.
|
|
1934
|
+
*/
|
|
1935
|
+
latency?: V3WebCallResponse.Latency;
|
|
1936
|
+
/**
|
|
1937
|
+
* LLM token usage of the call, available after call ends. Not populated if using
|
|
1938
|
+
* custom LLM, realtime API, or no LLM call is made.
|
|
1939
|
+
*/
|
|
1940
|
+
llm_token_usage?: V3WebCallResponse.LlmTokenUsage;
|
|
1941
|
+
/**
|
|
1942
|
+
* An arbitrary object for storage purpose only. You can put anything here like
|
|
1943
|
+
* your internal customer id associated with the call. Not used for processing. You
|
|
1944
|
+
* can later get this field from the call object.
|
|
1945
|
+
*/
|
|
1946
|
+
metadata?: unknown;
|
|
1947
|
+
/**
|
|
1948
|
+
* Whether this agent opts in for signed URLs for public logs and recordings. When
|
|
1949
|
+
* enabled, the generated URLs will include security signatures that restrict
|
|
1950
|
+
* access and automatically expire after 24 hours.
|
|
1951
|
+
*/
|
|
1952
|
+
opt_in_signed_url?: boolean;
|
|
1953
|
+
/**
|
|
1954
|
+
* Public log of the call, containing details about all the requests and responses
|
|
1955
|
+
* received in LLM WebSocket, latency tracking for each turntaking, helpful for
|
|
1956
|
+
* debugging and tracing. Available after call ends.
|
|
1957
|
+
*/
|
|
1958
|
+
public_log_url?: string;
|
|
1959
|
+
/**
|
|
1960
|
+
* Recording of the call, with each party's audio stored in a separate channel.
|
|
1961
|
+
* Available after the call ends.
|
|
1962
|
+
*/
|
|
1963
|
+
recording_multi_channel_url?: string;
|
|
1964
|
+
/**
|
|
1965
|
+
* Recording of the call. Available after call ends.
|
|
1966
|
+
*/
|
|
1967
|
+
recording_url?: string;
|
|
1968
|
+
/**
|
|
1969
|
+
* Add optional dynamic variables in key value pairs of string that injects into
|
|
1970
|
+
* your Response Engine prompt and tool description. Only applicable for Response
|
|
1971
|
+
* Engine.
|
|
1972
|
+
*/
|
|
1973
|
+
retell_llm_dynamic_variables?: {
|
|
1974
|
+
[key: string]: unknown;
|
|
1975
|
+
};
|
|
1976
|
+
/**
|
|
1977
|
+
* Recording of the call without PII, with each party's audio stored in a separate
|
|
1978
|
+
* channel. Available after the call ends.
|
|
1979
|
+
*/
|
|
1980
|
+
scrubbed_recording_multi_channel_url?: string;
|
|
1981
|
+
/**
|
|
1982
|
+
* Recording of the call without PII. Available after call ends.
|
|
1983
|
+
*/
|
|
1984
|
+
scrubbed_recording_url?: string;
|
|
1985
|
+
/**
|
|
1986
|
+
* Begin timestamp (milliseconds since epoch) of the call. Available after call
|
|
1987
|
+
* starts.
|
|
1988
|
+
*/
|
|
1989
|
+
start_timestamp?: number;
|
|
1990
|
+
/**
|
|
1991
|
+
* The destination number or identifier where the call was transferred to. Only
|
|
1992
|
+
* populated when the disconnection reason was `call_transfer`. Can be a phone
|
|
1993
|
+
* number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
|
|
1994
|
+
* ";transport=..." portion (if transport is known) where the transport type can be
|
|
1995
|
+
* "tls", "tcp" or "udp".
|
|
1996
|
+
*/
|
|
1997
|
+
transfer_destination?: string | null;
|
|
1998
|
+
/**
|
|
1999
|
+
* Transfer end timestamp (milliseconds since epoch) of the call. Available after
|
|
2000
|
+
* transfer call ends.
|
|
2001
|
+
*/
|
|
2002
|
+
transfer_end_timestamp?: number;
|
|
2003
|
+
}
|
|
2004
|
+
namespace V3WebCallResponse {
|
|
2005
|
+
/**
|
|
2006
|
+
* Post call analysis that includes information such as sentiment, status, summary,
|
|
2007
|
+
* and custom defined data to extract. Available after call ends. Subscribe to
|
|
2008
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
2009
|
+
*/
|
|
2010
|
+
interface CallAnalysis {
|
|
2011
|
+
/**
|
|
2012
|
+
* Whether the agent seems to have a successful call with the user, where the agent
|
|
2013
|
+
* finishes the task, and the call was complete without being cutoff.
|
|
2014
|
+
*/
|
|
2015
|
+
call_successful?: boolean;
|
|
2016
|
+
/**
|
|
2017
|
+
* A high level summary of the call.
|
|
2018
|
+
*/
|
|
2019
|
+
call_summary?: string;
|
|
2020
|
+
/**
|
|
2021
|
+
* Custom analysis data that was extracted based on the schema defined in agent
|
|
2022
|
+
* post call analysis data. Can be empty if nothing is specified.
|
|
2023
|
+
*/
|
|
2024
|
+
custom_analysis_data?: unknown;
|
|
2025
|
+
/**
|
|
2026
|
+
* Whether the call is entered voicemail.
|
|
2027
|
+
*/
|
|
2028
|
+
in_voicemail?: boolean;
|
|
2029
|
+
/**
|
|
2030
|
+
* Sentiment of the user in the call.
|
|
2031
|
+
*/
|
|
2032
|
+
user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* Cost of the call, including all the products and their costs and discount.
|
|
2036
|
+
*/
|
|
2037
|
+
interface CallCost {
|
|
2038
|
+
/**
|
|
2039
|
+
* Combined cost of all individual costs in cents
|
|
2040
|
+
*/
|
|
2041
|
+
combined_cost: number;
|
|
2042
|
+
/**
|
|
2043
|
+
* List of products with their unit prices and costs in cents
|
|
2044
|
+
*/
|
|
2045
|
+
product_costs: Array<CallCost.ProductCost>;
|
|
2046
|
+
/**
|
|
2047
|
+
* Total duration of the call in seconds
|
|
2048
|
+
*/
|
|
2049
|
+
total_duration_seconds: number;
|
|
2050
|
+
/**
|
|
2051
|
+
* Total unit duration price of all products in cents per second
|
|
2052
|
+
*/
|
|
2053
|
+
total_duration_unit_price: number;
|
|
2054
|
+
}
|
|
2055
|
+
namespace CallCost {
|
|
2056
|
+
interface ProductCost {
|
|
2057
|
+
/**
|
|
2058
|
+
* Cost for the product in cents for the duration of the call.
|
|
2059
|
+
*/
|
|
2060
|
+
cost: number;
|
|
2061
|
+
/**
|
|
2062
|
+
* Product name that has a cost associated with it.
|
|
2063
|
+
*/
|
|
2064
|
+
product: string;
|
|
2065
|
+
/**
|
|
2066
|
+
* True if this cost item is for a transfer segment.
|
|
2067
|
+
*/
|
|
2068
|
+
is_transfer_leg_cost?: boolean;
|
|
2069
|
+
/**
|
|
2070
|
+
* Unit price of the product in cents per second.
|
|
2071
|
+
*/
|
|
2072
|
+
unit_price?: number;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
/**
|
|
2076
|
+
* Latency tracking of the call, available after call ends. Not all fields here
|
|
2077
|
+
* will be available, as it depends on the type of call and feature used.
|
|
2078
|
+
*/
|
|
2079
|
+
interface Latency {
|
|
2080
|
+
/**
|
|
2081
|
+
* Transcription latency (diff between the duration of the chunks streamed and the
|
|
2082
|
+
* durations of the transcribed part) tracking of the call.
|
|
2083
|
+
*/
|
|
2084
|
+
asr?: Latency.Asr;
|
|
2085
|
+
/**
|
|
2086
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
2087
|
+
* the call. This latency does not account for the network trip time from Retell
|
|
2088
|
+
* server to user frontend. The latency is tracked every time turn change between
|
|
2089
|
+
* user and agent.
|
|
2090
|
+
*/
|
|
2091
|
+
e2e?: Latency.E2E;
|
|
2092
|
+
/**
|
|
2093
|
+
* Knowledge base latency (from the triggering of knowledge base retrival to all
|
|
2094
|
+
* relevant context received) tracking of the call. Only populated when using
|
|
2095
|
+
* knowledge base feature for the agent of the call.
|
|
2096
|
+
*/
|
|
2097
|
+
knowledge_base?: Latency.KnowledgeBase;
|
|
2098
|
+
/**
|
|
2099
|
+
* LLM latency (from issue of LLM call to first speakable chunk received) tracking
|
|
2100
|
+
* of the call. When using custom LLM. this latency includes LLM websocket
|
|
2101
|
+
* roundtrip time between user server and Retell server.
|
|
2102
|
+
*/
|
|
2103
|
+
llm?: Latency.Llm;
|
|
2104
|
+
/**
|
|
2105
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
2106
|
+
* of the call. Only populated for calls using custom LLM.
|
|
2107
|
+
*/
|
|
2108
|
+
llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
|
|
2109
|
+
/**
|
|
2110
|
+
* Speech-to-speech latency (from requesting responses of a S2S model to first byte
|
|
2111
|
+
* received) tracking of the call. Only populated for calls that uses S2S model
|
|
2112
|
+
* like Realtime API.
|
|
2113
|
+
*/
|
|
2114
|
+
s2s?: Latency.S2s;
|
|
2115
|
+
/**
|
|
2116
|
+
* Text-to-speech latency (from the triggering of TTS to first byte received)
|
|
2117
|
+
* tracking of the call.
|
|
2118
|
+
*/
|
|
2119
|
+
tts?: Latency.Tts;
|
|
2120
|
+
}
|
|
2121
|
+
namespace Latency {
|
|
2122
|
+
/**
|
|
2123
|
+
* Transcription latency (diff between the duration of the chunks streamed and the
|
|
2124
|
+
* durations of the transcribed part) tracking of the call.
|
|
2125
|
+
*/
|
|
2126
|
+
interface Asr {
|
|
2127
|
+
/**
|
|
2128
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2129
|
+
*/
|
|
2130
|
+
max?: number;
|
|
2131
|
+
/**
|
|
2132
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2133
|
+
*/
|
|
2134
|
+
min?: number;
|
|
2135
|
+
/**
|
|
2136
|
+
* Number of data points (number of times latency is tracked).
|
|
2137
|
+
*/
|
|
2138
|
+
num?: number;
|
|
2139
|
+
/**
|
|
2140
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2141
|
+
*/
|
|
2142
|
+
p50?: number;
|
|
2143
|
+
/**
|
|
2144
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2145
|
+
*/
|
|
2146
|
+
p90?: number;
|
|
2147
|
+
/**
|
|
2148
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2149
|
+
*/
|
|
2150
|
+
p95?: number;
|
|
2151
|
+
/**
|
|
2152
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2153
|
+
*/
|
|
2154
|
+
p99?: number;
|
|
2155
|
+
/**
|
|
2156
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2157
|
+
*/
|
|
2158
|
+
values?: Array<number>;
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
2162
|
+
* the call. This latency does not account for the network trip time from Retell
|
|
2163
|
+
* server to user frontend. The latency is tracked every time turn change between
|
|
2164
|
+
* user and agent.
|
|
2165
|
+
*/
|
|
2166
|
+
interface E2E {
|
|
2167
|
+
/**
|
|
2168
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2169
|
+
*/
|
|
2170
|
+
max?: number;
|
|
2171
|
+
/**
|
|
2172
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2173
|
+
*/
|
|
2174
|
+
min?: number;
|
|
2175
|
+
/**
|
|
2176
|
+
* Number of data points (number of times latency is tracked).
|
|
2177
|
+
*/
|
|
2178
|
+
num?: number;
|
|
2179
|
+
/**
|
|
2180
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2181
|
+
*/
|
|
2182
|
+
p50?: number;
|
|
2183
|
+
/**
|
|
2184
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2185
|
+
*/
|
|
2186
|
+
p90?: number;
|
|
2187
|
+
/**
|
|
2188
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2189
|
+
*/
|
|
2190
|
+
p95?: number;
|
|
2191
|
+
/**
|
|
2192
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2193
|
+
*/
|
|
2194
|
+
p99?: number;
|
|
2195
|
+
/**
|
|
2196
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2197
|
+
*/
|
|
2198
|
+
values?: Array<number>;
|
|
2199
|
+
}
|
|
2200
|
+
/**
|
|
2201
|
+
* Knowledge base latency (from the triggering of knowledge base retrival to all
|
|
2202
|
+
* relevant context received) tracking of the call. Only populated when using
|
|
2203
|
+
* knowledge base feature for the agent of the call.
|
|
2204
|
+
*/
|
|
2205
|
+
interface KnowledgeBase {
|
|
2206
|
+
/**
|
|
2207
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2208
|
+
*/
|
|
2209
|
+
max?: number;
|
|
2210
|
+
/**
|
|
2211
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2212
|
+
*/
|
|
2213
|
+
min?: number;
|
|
2214
|
+
/**
|
|
2215
|
+
* Number of data points (number of times latency is tracked).
|
|
2216
|
+
*/
|
|
2217
|
+
num?: number;
|
|
2218
|
+
/**
|
|
2219
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2220
|
+
*/
|
|
2221
|
+
p50?: number;
|
|
2222
|
+
/**
|
|
2223
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2224
|
+
*/
|
|
2225
|
+
p90?: number;
|
|
2226
|
+
/**
|
|
2227
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2228
|
+
*/
|
|
2229
|
+
p95?: number;
|
|
2230
|
+
/**
|
|
2231
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2232
|
+
*/
|
|
2233
|
+
p99?: number;
|
|
2234
|
+
/**
|
|
2235
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2236
|
+
*/
|
|
2237
|
+
values?: Array<number>;
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* LLM latency (from issue of LLM call to first speakable chunk received) tracking
|
|
2241
|
+
* of the call. When using custom LLM. this latency includes LLM websocket
|
|
2242
|
+
* roundtrip time between user server and Retell server.
|
|
2243
|
+
*/
|
|
2244
|
+
interface Llm {
|
|
2245
|
+
/**
|
|
2246
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2247
|
+
*/
|
|
2248
|
+
max?: number;
|
|
2249
|
+
/**
|
|
2250
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2251
|
+
*/
|
|
2252
|
+
min?: number;
|
|
2253
|
+
/**
|
|
2254
|
+
* Number of data points (number of times latency is tracked).
|
|
2255
|
+
*/
|
|
2256
|
+
num?: number;
|
|
2257
|
+
/**
|
|
2258
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2259
|
+
*/
|
|
2260
|
+
p50?: number;
|
|
2261
|
+
/**
|
|
2262
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2263
|
+
*/
|
|
2264
|
+
p90?: number;
|
|
2265
|
+
/**
|
|
2266
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2267
|
+
*/
|
|
2268
|
+
p95?: number;
|
|
2269
|
+
/**
|
|
2270
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2271
|
+
*/
|
|
2272
|
+
p99?: number;
|
|
2273
|
+
/**
|
|
2274
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2275
|
+
*/
|
|
2276
|
+
values?: Array<number>;
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
2280
|
+
* of the call. Only populated for calls using custom LLM.
|
|
2281
|
+
*/
|
|
2282
|
+
interface LlmWebsocketNetworkRtt {
|
|
2283
|
+
/**
|
|
2284
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2285
|
+
*/
|
|
2286
|
+
max?: number;
|
|
2287
|
+
/**
|
|
2288
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2289
|
+
*/
|
|
2290
|
+
min?: number;
|
|
2291
|
+
/**
|
|
2292
|
+
* Number of data points (number of times latency is tracked).
|
|
2293
|
+
*/
|
|
2294
|
+
num?: number;
|
|
2295
|
+
/**
|
|
2296
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2297
|
+
*/
|
|
2298
|
+
p50?: number;
|
|
2299
|
+
/**
|
|
2300
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2301
|
+
*/
|
|
2302
|
+
p90?: number;
|
|
2303
|
+
/**
|
|
2304
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2305
|
+
*/
|
|
2306
|
+
p95?: number;
|
|
2307
|
+
/**
|
|
2308
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2309
|
+
*/
|
|
2310
|
+
p99?: number;
|
|
2311
|
+
/**
|
|
2312
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2313
|
+
*/
|
|
2314
|
+
values?: Array<number>;
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Speech-to-speech latency (from requesting responses of a S2S model to first byte
|
|
2318
|
+
* received) tracking of the call. Only populated for calls that uses S2S model
|
|
2319
|
+
* like Realtime API.
|
|
2320
|
+
*/
|
|
2321
|
+
interface S2s {
|
|
2322
|
+
/**
|
|
2323
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2324
|
+
*/
|
|
2325
|
+
max?: number;
|
|
2326
|
+
/**
|
|
2327
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2328
|
+
*/
|
|
2329
|
+
min?: number;
|
|
2330
|
+
/**
|
|
2331
|
+
* Number of data points (number of times latency is tracked).
|
|
2332
|
+
*/
|
|
2333
|
+
num?: number;
|
|
2334
|
+
/**
|
|
2335
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2336
|
+
*/
|
|
2337
|
+
p50?: number;
|
|
2338
|
+
/**
|
|
2339
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2340
|
+
*/
|
|
2341
|
+
p90?: number;
|
|
2342
|
+
/**
|
|
2343
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2344
|
+
*/
|
|
2345
|
+
p95?: number;
|
|
2346
|
+
/**
|
|
2347
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2348
|
+
*/
|
|
2349
|
+
p99?: number;
|
|
2350
|
+
/**
|
|
2351
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2352
|
+
*/
|
|
2353
|
+
values?: Array<number>;
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* Text-to-speech latency (from the triggering of TTS to first byte received)
|
|
2357
|
+
* tracking of the call.
|
|
2358
|
+
*/
|
|
2359
|
+
interface Tts {
|
|
2360
|
+
/**
|
|
2361
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2362
|
+
*/
|
|
2363
|
+
max?: number;
|
|
2364
|
+
/**
|
|
2365
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2366
|
+
*/
|
|
2367
|
+
min?: number;
|
|
2368
|
+
/**
|
|
2369
|
+
* Number of data points (number of times latency is tracked).
|
|
2370
|
+
*/
|
|
2371
|
+
num?: number;
|
|
2372
|
+
/**
|
|
2373
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2374
|
+
*/
|
|
2375
|
+
p50?: number;
|
|
2376
|
+
/**
|
|
2377
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2378
|
+
*/
|
|
2379
|
+
p90?: number;
|
|
2380
|
+
/**
|
|
2381
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2382
|
+
*/
|
|
2383
|
+
p95?: number;
|
|
2384
|
+
/**
|
|
2385
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2386
|
+
*/
|
|
2387
|
+
p99?: number;
|
|
2388
|
+
/**
|
|
2389
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2390
|
+
*/
|
|
2391
|
+
values?: Array<number>;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* LLM token usage of the call, available after call ends. Not populated if using
|
|
2396
|
+
* custom LLM, realtime API, or no LLM call is made.
|
|
2397
|
+
*/
|
|
2398
|
+
interface LlmTokenUsage {
|
|
2399
|
+
/**
|
|
2400
|
+
* Average token count of the call.
|
|
2401
|
+
*/
|
|
2402
|
+
average: number;
|
|
2403
|
+
/**
|
|
2404
|
+
* Number of requests made to the LLM.
|
|
2405
|
+
*/
|
|
2406
|
+
num_requests: number;
|
|
2407
|
+
/**
|
|
2408
|
+
* All the token count values in the call.
|
|
2409
|
+
*/
|
|
2410
|
+
values: Array<number>;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
interface V3PhoneCallResponse {
|
|
2414
|
+
/**
|
|
2415
|
+
* Corresponding agent id of this call.
|
|
2416
|
+
*/
|
|
2417
|
+
agent_id: string;
|
|
2418
|
+
/**
|
|
2419
|
+
* The version of the agent.
|
|
2420
|
+
*/
|
|
2421
|
+
agent_version: number;
|
|
2422
|
+
/**
|
|
2423
|
+
* Unique id of the call. Used to identify the call in the LLM websocket and used
|
|
2424
|
+
* to authenticate in the audio websocket.
|
|
2425
|
+
*/
|
|
2426
|
+
call_id: string;
|
|
2427
|
+
/**
|
|
2428
|
+
* Status of call.
|
|
2429
|
+
*
|
|
2430
|
+
* - `registered`: Call id issued, starting to make a call using this id.
|
|
2431
|
+
* - `ongoing`: Call connected and ongoing.
|
|
2432
|
+
* - `ended`: The underlying websocket has ended for the call. Either user or agent
|
|
2433
|
+
* hung up, or call transferred.
|
|
2434
|
+
* - `error`: Call encountered error.
|
|
2435
|
+
*/
|
|
2436
|
+
call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
|
|
2437
|
+
/**
|
|
2438
|
+
* Type of the call. Used to distinguish between web call and phone call.
|
|
2439
|
+
*/
|
|
2440
|
+
call_type: 'phone_call';
|
|
2441
|
+
/**
|
|
2442
|
+
* Direction of the phone call.
|
|
2443
|
+
*/
|
|
2444
|
+
direction: 'inbound' | 'outbound';
|
|
2445
|
+
/**
|
|
2446
|
+
* The caller number.
|
|
2447
|
+
*/
|
|
2448
|
+
from_number: string;
|
|
2449
|
+
/**
|
|
2450
|
+
* The callee number.
|
|
2451
|
+
*/
|
|
2452
|
+
to_number: string;
|
|
2453
|
+
/**
|
|
2454
|
+
* Name of the agent.
|
|
2455
|
+
*/
|
|
2456
|
+
agent_name?: string;
|
|
2457
|
+
/**
|
|
2458
|
+
* Post call analysis that includes information such as sentiment, status, summary,
|
|
2459
|
+
* and custom defined data to extract. Available after call ends. Subscribe to
|
|
2460
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
2461
|
+
*/
|
|
2462
|
+
call_analysis?: V3PhoneCallResponse.CallAnalysis;
|
|
2463
|
+
/**
|
|
2464
|
+
* Cost of the call, including all the products and their costs and discount.
|
|
2465
|
+
*/
|
|
2466
|
+
call_cost?: V3PhoneCallResponse.CallCost;
|
|
2467
|
+
/**
|
|
2468
|
+
* Dynamic variables collected from the call. Only available after the call ends.
|
|
2469
|
+
*/
|
|
2470
|
+
collected_dynamic_variables?: {
|
|
2471
|
+
[key: string]: unknown;
|
|
2472
|
+
};
|
|
2473
|
+
/**
|
|
2474
|
+
* Custom SIP headers to be added to the call.
|
|
2475
|
+
*/
|
|
2476
|
+
custom_sip_headers?: {
|
|
2477
|
+
[key: string]: string;
|
|
2478
|
+
};
|
|
2479
|
+
/**
|
|
2480
|
+
* Data storage setting for this call's agent. "everything" stores all data,
|
|
2481
|
+
* "everything_except_pii" excludes PII when possible, "basic_attributes_only"
|
|
2482
|
+
* stores only metadata.
|
|
2483
|
+
*/
|
|
2484
|
+
data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
|
|
2485
|
+
/**
|
|
2486
|
+
* The reason for the disconnection of the call. Read detailed description about
|
|
2487
|
+
* reasons listed here at
|
|
2488
|
+
* [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
|
|
2489
|
+
*/
|
|
2490
|
+
disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped';
|
|
2491
|
+
/**
|
|
2492
|
+
* Duration of the call in milliseconds. Available after call ends.
|
|
2493
|
+
*/
|
|
2494
|
+
duration_ms?: number;
|
|
2495
|
+
/**
|
|
2496
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
2497
|
+
*/
|
|
2498
|
+
end_timestamp?: number;
|
|
2499
|
+
/**
|
|
2500
|
+
* URL to the knowledge base retrieved contents of the call. Available after call
|
|
2501
|
+
* ends if the call utilizes knowledge base feature. It consists of the respond id
|
|
2502
|
+
* and the retrieved contents related to that response. It's already rendered in
|
|
2503
|
+
* call history tab of dashboard, and you can also manually download and check
|
|
2504
|
+
* against the transcript to view the knowledge base retrieval results.
|
|
2505
|
+
*/
|
|
2506
|
+
knowledge_base_retrieved_contents_url?: string;
|
|
2507
|
+
/**
|
|
2508
|
+
* Latency tracking of the call, available after call ends. Not all fields here
|
|
2509
|
+
* will be available, as it depends on the type of call and feature used.
|
|
2510
|
+
*/
|
|
2511
|
+
latency?: V3PhoneCallResponse.Latency;
|
|
2512
|
+
/**
|
|
2513
|
+
* LLM token usage of the call, available after call ends. Not populated if using
|
|
2514
|
+
* custom LLM, realtime API, or no LLM call is made.
|
|
2515
|
+
*/
|
|
2516
|
+
llm_token_usage?: V3PhoneCallResponse.LlmTokenUsage;
|
|
2517
|
+
/**
|
|
2518
|
+
* An arbitrary object for storage purpose only. You can put anything here like
|
|
2519
|
+
* your internal customer id associated with the call. Not used for processing. You
|
|
2520
|
+
* can later get this field from the call object.
|
|
2521
|
+
*/
|
|
2522
|
+
metadata?: unknown;
|
|
2523
|
+
/**
|
|
2524
|
+
* Whether this agent opts in for signed URLs for public logs and recordings. When
|
|
2525
|
+
* enabled, the generated URLs will include security signatures that restrict
|
|
2526
|
+
* access and automatically expire after 24 hours.
|
|
2527
|
+
*/
|
|
2528
|
+
opt_in_signed_url?: boolean;
|
|
2529
|
+
/**
|
|
2530
|
+
* Public log of the call, containing details about all the requests and responses
|
|
2531
|
+
* received in LLM WebSocket, latency tracking for each turntaking, helpful for
|
|
2532
|
+
* debugging and tracing. Available after call ends.
|
|
2533
|
+
*/
|
|
2534
|
+
public_log_url?: string;
|
|
2535
|
+
/**
|
|
2536
|
+
* Recording of the call, with each party's audio stored in a separate channel.
|
|
2537
|
+
* Available after the call ends.
|
|
2538
|
+
*/
|
|
2539
|
+
recording_multi_channel_url?: string;
|
|
2540
|
+
/**
|
|
2541
|
+
* Recording of the call. Available after call ends.
|
|
2542
|
+
*/
|
|
2543
|
+
recording_url?: string;
|
|
2544
|
+
/**
|
|
2545
|
+
* Add optional dynamic variables in key value pairs of string that injects into
|
|
2546
|
+
* your Response Engine prompt and tool description. Only applicable for Response
|
|
2547
|
+
* Engine.
|
|
2548
|
+
*/
|
|
2549
|
+
retell_llm_dynamic_variables?: {
|
|
2550
|
+
[key: string]: unknown;
|
|
2551
|
+
};
|
|
2552
|
+
/**
|
|
2553
|
+
* Recording of the call without PII, with each party's audio stored in a separate
|
|
2554
|
+
* channel. Available after the call ends.
|
|
2555
|
+
*/
|
|
2556
|
+
scrubbed_recording_multi_channel_url?: string;
|
|
2557
|
+
/**
|
|
2558
|
+
* Recording of the call without PII. Available after call ends.
|
|
2559
|
+
*/
|
|
2560
|
+
scrubbed_recording_url?: string;
|
|
2561
|
+
/**
|
|
2562
|
+
* Begin timestamp (milliseconds since epoch) of the call. Available after call
|
|
2563
|
+
* starts.
|
|
2564
|
+
*/
|
|
2565
|
+
start_timestamp?: number;
|
|
2566
|
+
/**
|
|
2567
|
+
* Telephony identifier of the call, populated when available. Tracking purposes
|
|
2568
|
+
* only.
|
|
2569
|
+
*/
|
|
2570
|
+
telephony_identifier?: V3PhoneCallResponse.TelephonyIdentifier;
|
|
2571
|
+
/**
|
|
2572
|
+
* The destination number or identifier where the call was transferred to. Only
|
|
2573
|
+
* populated when the disconnection reason was `call_transfer`. Can be a phone
|
|
2574
|
+
* number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
|
|
2575
|
+
* ";transport=..." portion (if transport is known) where the transport type can be
|
|
2576
|
+
* "tls", "tcp" or "udp".
|
|
2577
|
+
*/
|
|
2578
|
+
transfer_destination?: string | null;
|
|
2579
|
+
/**
|
|
2580
|
+
* Transfer end timestamp (milliseconds since epoch) of the call. Available after
|
|
2581
|
+
* transfer call ends.
|
|
2582
|
+
*/
|
|
2583
|
+
transfer_end_timestamp?: number;
|
|
1849
2584
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
2585
|
+
namespace V3PhoneCallResponse {
|
|
2586
|
+
/**
|
|
2587
|
+
* Post call analysis that includes information such as sentiment, status, summary,
|
|
2588
|
+
* and custom defined data to extract. Available after call ends. Subscribe to
|
|
2589
|
+
* `call_analyzed` webhook event type to receive it once ready.
|
|
2590
|
+
*/
|
|
2591
|
+
interface CallAnalysis {
|
|
2592
|
+
/**
|
|
2593
|
+
* Whether the agent seems to have a successful call with the user, where the agent
|
|
2594
|
+
* finishes the task, and the call was complete without being cutoff.
|
|
2595
|
+
*/
|
|
2596
|
+
call_successful?: boolean;
|
|
2597
|
+
/**
|
|
2598
|
+
* A high level summary of the call.
|
|
2599
|
+
*/
|
|
2600
|
+
call_summary?: string;
|
|
2601
|
+
/**
|
|
2602
|
+
* Custom analysis data that was extracted based on the schema defined in agent
|
|
2603
|
+
* post call analysis data. Can be empty if nothing is specified.
|
|
2604
|
+
*/
|
|
2605
|
+
custom_analysis_data?: unknown;
|
|
2606
|
+
/**
|
|
2607
|
+
* Whether the call is entered voicemail.
|
|
2608
|
+
*/
|
|
2609
|
+
in_voicemail?: boolean;
|
|
2610
|
+
/**
|
|
2611
|
+
* Sentiment of the user in the call.
|
|
2612
|
+
*/
|
|
2613
|
+
user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Cost of the call, including all the products and their costs and discount.
|
|
2617
|
+
*/
|
|
2618
|
+
interface CallCost {
|
|
2619
|
+
/**
|
|
2620
|
+
* Combined cost of all individual costs in cents
|
|
2621
|
+
*/
|
|
2622
|
+
combined_cost: number;
|
|
2623
|
+
/**
|
|
2624
|
+
* List of products with their unit prices and costs in cents
|
|
2625
|
+
*/
|
|
2626
|
+
product_costs: Array<CallCost.ProductCost>;
|
|
2627
|
+
/**
|
|
2628
|
+
* Total duration of the call in seconds
|
|
2629
|
+
*/
|
|
2630
|
+
total_duration_seconds: number;
|
|
2631
|
+
/**
|
|
2632
|
+
* Total unit duration price of all products in cents per second
|
|
2633
|
+
*/
|
|
2634
|
+
total_duration_unit_price: number;
|
|
2635
|
+
}
|
|
2636
|
+
namespace CallCost {
|
|
2637
|
+
interface ProductCost {
|
|
2638
|
+
/**
|
|
2639
|
+
* Cost for the product in cents for the duration of the call.
|
|
2640
|
+
*/
|
|
2641
|
+
cost: number;
|
|
2642
|
+
/**
|
|
2643
|
+
* Product name that has a cost associated with it.
|
|
2644
|
+
*/
|
|
2645
|
+
product: string;
|
|
2646
|
+
/**
|
|
2647
|
+
* True if this cost item is for a transfer segment.
|
|
2648
|
+
*/
|
|
2649
|
+
is_transfer_leg_cost?: boolean;
|
|
2650
|
+
/**
|
|
2651
|
+
* Unit price of the product in cents per second.
|
|
2652
|
+
*/
|
|
2653
|
+
unit_price?: number;
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
/**
|
|
2657
|
+
* Latency tracking of the call, available after call ends. Not all fields here
|
|
2658
|
+
* will be available, as it depends on the type of call and feature used.
|
|
2659
|
+
*/
|
|
2660
|
+
interface Latency {
|
|
2661
|
+
/**
|
|
2662
|
+
* Transcription latency (diff between the duration of the chunks streamed and the
|
|
2663
|
+
* durations of the transcribed part) tracking of the call.
|
|
2664
|
+
*/
|
|
2665
|
+
asr?: Latency.Asr;
|
|
2666
|
+
/**
|
|
2667
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
2668
|
+
* the call. This latency does not account for the network trip time from Retell
|
|
2669
|
+
* server to user frontend. The latency is tracked every time turn change between
|
|
2670
|
+
* user and agent.
|
|
2671
|
+
*/
|
|
2672
|
+
e2e?: Latency.E2E;
|
|
2673
|
+
/**
|
|
2674
|
+
* Knowledge base latency (from the triggering of knowledge base retrival to all
|
|
2675
|
+
* relevant context received) tracking of the call. Only populated when using
|
|
2676
|
+
* knowledge base feature for the agent of the call.
|
|
2677
|
+
*/
|
|
2678
|
+
knowledge_base?: Latency.KnowledgeBase;
|
|
2679
|
+
/**
|
|
2680
|
+
* LLM latency (from issue of LLM call to first speakable chunk received) tracking
|
|
2681
|
+
* of the call. When using custom LLM. this latency includes LLM websocket
|
|
2682
|
+
* roundtrip time between user server and Retell server.
|
|
2683
|
+
*/
|
|
2684
|
+
llm?: Latency.Llm;
|
|
2685
|
+
/**
|
|
2686
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
2687
|
+
* of the call. Only populated for calls using custom LLM.
|
|
2688
|
+
*/
|
|
2689
|
+
llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
|
|
2690
|
+
/**
|
|
2691
|
+
* Speech-to-speech latency (from requesting responses of a S2S model to first byte
|
|
2692
|
+
* received) tracking of the call. Only populated for calls that uses S2S model
|
|
2693
|
+
* like Realtime API.
|
|
2694
|
+
*/
|
|
2695
|
+
s2s?: Latency.S2s;
|
|
2696
|
+
/**
|
|
2697
|
+
* Text-to-speech latency (from the triggering of TTS to first byte received)
|
|
2698
|
+
* tracking of the call.
|
|
2699
|
+
*/
|
|
2700
|
+
tts?: Latency.Tts;
|
|
2701
|
+
}
|
|
2702
|
+
namespace Latency {
|
|
2703
|
+
/**
|
|
2704
|
+
* Transcription latency (diff between the duration of the chunks streamed and the
|
|
2705
|
+
* durations of the transcribed part) tracking of the call.
|
|
2706
|
+
*/
|
|
2707
|
+
interface Asr {
|
|
2708
|
+
/**
|
|
2709
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2710
|
+
*/
|
|
2711
|
+
max?: number;
|
|
2712
|
+
/**
|
|
2713
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2714
|
+
*/
|
|
2715
|
+
min?: number;
|
|
2716
|
+
/**
|
|
2717
|
+
* Number of data points (number of times latency is tracked).
|
|
2718
|
+
*/
|
|
2719
|
+
num?: number;
|
|
2720
|
+
/**
|
|
2721
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2722
|
+
*/
|
|
2723
|
+
p50?: number;
|
|
2724
|
+
/**
|
|
2725
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2726
|
+
*/
|
|
2727
|
+
p90?: number;
|
|
2728
|
+
/**
|
|
2729
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2730
|
+
*/
|
|
2731
|
+
p95?: number;
|
|
2732
|
+
/**
|
|
2733
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2734
|
+
*/
|
|
2735
|
+
p99?: number;
|
|
2736
|
+
/**
|
|
2737
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2738
|
+
*/
|
|
2739
|
+
values?: Array<number>;
|
|
2740
|
+
}
|
|
2741
|
+
/**
|
|
2742
|
+
* End to end latency (from user stops talking to agent start talking) tracking of
|
|
2743
|
+
* the call. This latency does not account for the network trip time from Retell
|
|
2744
|
+
* server to user frontend. The latency is tracked every time turn change between
|
|
2745
|
+
* user and agent.
|
|
2746
|
+
*/
|
|
2747
|
+
interface E2E {
|
|
2748
|
+
/**
|
|
2749
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2750
|
+
*/
|
|
2751
|
+
max?: number;
|
|
2752
|
+
/**
|
|
2753
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2754
|
+
*/
|
|
2755
|
+
min?: number;
|
|
2756
|
+
/**
|
|
2757
|
+
* Number of data points (number of times latency is tracked).
|
|
2758
|
+
*/
|
|
2759
|
+
num?: number;
|
|
2760
|
+
/**
|
|
2761
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2762
|
+
*/
|
|
2763
|
+
p50?: number;
|
|
2764
|
+
/**
|
|
2765
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2766
|
+
*/
|
|
2767
|
+
p90?: number;
|
|
2768
|
+
/**
|
|
2769
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2770
|
+
*/
|
|
2771
|
+
p95?: number;
|
|
2772
|
+
/**
|
|
2773
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2774
|
+
*/
|
|
2775
|
+
p99?: number;
|
|
2776
|
+
/**
|
|
2777
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2778
|
+
*/
|
|
2779
|
+
values?: Array<number>;
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Knowledge base latency (from the triggering of knowledge base retrival to all
|
|
2783
|
+
* relevant context received) tracking of the call. Only populated when using
|
|
2784
|
+
* knowledge base feature for the agent of the call.
|
|
2785
|
+
*/
|
|
2786
|
+
interface KnowledgeBase {
|
|
2787
|
+
/**
|
|
2788
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2789
|
+
*/
|
|
2790
|
+
max?: number;
|
|
2791
|
+
/**
|
|
2792
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2793
|
+
*/
|
|
2794
|
+
min?: number;
|
|
2795
|
+
/**
|
|
2796
|
+
* Number of data points (number of times latency is tracked).
|
|
2797
|
+
*/
|
|
2798
|
+
num?: number;
|
|
2799
|
+
/**
|
|
2800
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2801
|
+
*/
|
|
2802
|
+
p50?: number;
|
|
2803
|
+
/**
|
|
2804
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2805
|
+
*/
|
|
2806
|
+
p90?: number;
|
|
2807
|
+
/**
|
|
2808
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2809
|
+
*/
|
|
2810
|
+
p95?: number;
|
|
2811
|
+
/**
|
|
2812
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2813
|
+
*/
|
|
2814
|
+
p99?: number;
|
|
2815
|
+
/**
|
|
2816
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2817
|
+
*/
|
|
2818
|
+
values?: Array<number>;
|
|
2819
|
+
}
|
|
2820
|
+
/**
|
|
2821
|
+
* LLM latency (from issue of LLM call to first speakable chunk received) tracking
|
|
2822
|
+
* of the call. When using custom LLM. this latency includes LLM websocket
|
|
2823
|
+
* roundtrip time between user server and Retell server.
|
|
2824
|
+
*/
|
|
2825
|
+
interface Llm {
|
|
2826
|
+
/**
|
|
2827
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2828
|
+
*/
|
|
2829
|
+
max?: number;
|
|
2830
|
+
/**
|
|
2831
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2832
|
+
*/
|
|
2833
|
+
min?: number;
|
|
2834
|
+
/**
|
|
2835
|
+
* Number of data points (number of times latency is tracked).
|
|
2836
|
+
*/
|
|
2837
|
+
num?: number;
|
|
2838
|
+
/**
|
|
2839
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2840
|
+
*/
|
|
2841
|
+
p50?: number;
|
|
2842
|
+
/**
|
|
2843
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2844
|
+
*/
|
|
2845
|
+
p90?: number;
|
|
2846
|
+
/**
|
|
2847
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2848
|
+
*/
|
|
2849
|
+
p95?: number;
|
|
2850
|
+
/**
|
|
2851
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2852
|
+
*/
|
|
2853
|
+
p99?: number;
|
|
2854
|
+
/**
|
|
2855
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2856
|
+
*/
|
|
2857
|
+
values?: Array<number>;
|
|
2858
|
+
}
|
|
2859
|
+
/**
|
|
2860
|
+
* LLM websocket roundtrip latency (between user server and Retell server) tracking
|
|
2861
|
+
* of the call. Only populated for calls using custom LLM.
|
|
2862
|
+
*/
|
|
2863
|
+
interface LlmWebsocketNetworkRtt {
|
|
2864
|
+
/**
|
|
2865
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2866
|
+
*/
|
|
2867
|
+
max?: number;
|
|
2868
|
+
/**
|
|
2869
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2870
|
+
*/
|
|
2871
|
+
min?: number;
|
|
2872
|
+
/**
|
|
2873
|
+
* Number of data points (number of times latency is tracked).
|
|
2874
|
+
*/
|
|
2875
|
+
num?: number;
|
|
2876
|
+
/**
|
|
2877
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2878
|
+
*/
|
|
2879
|
+
p50?: number;
|
|
2880
|
+
/**
|
|
2881
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2882
|
+
*/
|
|
2883
|
+
p90?: number;
|
|
2884
|
+
/**
|
|
2885
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2886
|
+
*/
|
|
2887
|
+
p95?: number;
|
|
2888
|
+
/**
|
|
2889
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2890
|
+
*/
|
|
2891
|
+
p99?: number;
|
|
2892
|
+
/**
|
|
2893
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2894
|
+
*/
|
|
2895
|
+
values?: Array<number>;
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* Speech-to-speech latency (from requesting responses of a S2S model to first byte
|
|
2899
|
+
* received) tracking of the call. Only populated for calls that uses S2S model
|
|
2900
|
+
* like Realtime API.
|
|
2901
|
+
*/
|
|
2902
|
+
interface S2s {
|
|
2903
|
+
/**
|
|
2904
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2905
|
+
*/
|
|
2906
|
+
max?: number;
|
|
2907
|
+
/**
|
|
2908
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2909
|
+
*/
|
|
2910
|
+
min?: number;
|
|
2911
|
+
/**
|
|
2912
|
+
* Number of data points (number of times latency is tracked).
|
|
2913
|
+
*/
|
|
2914
|
+
num?: number;
|
|
2915
|
+
/**
|
|
2916
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2917
|
+
*/
|
|
2918
|
+
p50?: number;
|
|
2919
|
+
/**
|
|
2920
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2921
|
+
*/
|
|
2922
|
+
p90?: number;
|
|
2923
|
+
/**
|
|
2924
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2925
|
+
*/
|
|
2926
|
+
p95?: number;
|
|
2927
|
+
/**
|
|
2928
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2929
|
+
*/
|
|
2930
|
+
p99?: number;
|
|
2931
|
+
/**
|
|
2932
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2933
|
+
*/
|
|
2934
|
+
values?: Array<number>;
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* Text-to-speech latency (from the triggering of TTS to first byte received)
|
|
2938
|
+
* tracking of the call.
|
|
2939
|
+
*/
|
|
2940
|
+
interface Tts {
|
|
2941
|
+
/**
|
|
2942
|
+
* Maximum latency in the call, measured in milliseconds.
|
|
2943
|
+
*/
|
|
2944
|
+
max?: number;
|
|
2945
|
+
/**
|
|
2946
|
+
* Minimum latency in the call, measured in milliseconds.
|
|
2947
|
+
*/
|
|
2948
|
+
min?: number;
|
|
2949
|
+
/**
|
|
2950
|
+
* Number of data points (number of times latency is tracked).
|
|
2951
|
+
*/
|
|
2952
|
+
num?: number;
|
|
2953
|
+
/**
|
|
2954
|
+
* 50 percentile of latency, measured in milliseconds.
|
|
2955
|
+
*/
|
|
2956
|
+
p50?: number;
|
|
2957
|
+
/**
|
|
2958
|
+
* 90 percentile of latency, measured in milliseconds.
|
|
2959
|
+
*/
|
|
2960
|
+
p90?: number;
|
|
2961
|
+
/**
|
|
2962
|
+
* 95 percentile of latency, measured in milliseconds.
|
|
2963
|
+
*/
|
|
2964
|
+
p95?: number;
|
|
2965
|
+
/**
|
|
2966
|
+
* 99 percentile of latency, measured in milliseconds.
|
|
2967
|
+
*/
|
|
2968
|
+
p99?: number;
|
|
2969
|
+
/**
|
|
2970
|
+
* All the latency data points in the call, measured in milliseconds.
|
|
2971
|
+
*/
|
|
2972
|
+
values?: Array<number>;
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
/**
|
|
2976
|
+
* LLM token usage of the call, available after call ends. Not populated if using
|
|
2977
|
+
* custom LLM, realtime API, or no LLM call is made.
|
|
2978
|
+
*/
|
|
2979
|
+
interface LlmTokenUsage {
|
|
2980
|
+
/**
|
|
2981
|
+
* Average token count of the call.
|
|
2982
|
+
*/
|
|
2983
|
+
average: number;
|
|
2984
|
+
/**
|
|
2985
|
+
* Number of requests made to the LLM.
|
|
2986
|
+
*/
|
|
2987
|
+
num_requests: number;
|
|
2988
|
+
/**
|
|
2989
|
+
* All the token count values in the call.
|
|
2990
|
+
*/
|
|
2991
|
+
values: Array<number>;
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* Telephony identifier of the call, populated when available. Tracking purposes
|
|
2995
|
+
* only.
|
|
2996
|
+
*/
|
|
2997
|
+
interface TelephonyIdentifier {
|
|
2998
|
+
/**
|
|
2999
|
+
* Twilio call sid.
|
|
3000
|
+
*/
|
|
3001
|
+
twilio_call_sid?: string;
|
|
3002
|
+
}
|
|
1854
3003
|
}
|
|
1855
3004
|
}
|
|
1856
3005
|
export interface CallUpdateParams {
|
|
@@ -2865,7 +4014,7 @@ export declare namespace CallCreatePhoneCallParams {
|
|
|
2865
4014
|
* available voice models. Set to null to remove voice model selection, and default
|
|
2866
4015
|
* ones will apply. Check out dashboard for more details of each voice model.
|
|
2867
4016
|
*/
|
|
2868
|
-
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
|
|
4017
|
+
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
|
|
2869
4018
|
/**
|
|
2870
4019
|
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
|
|
2871
4020
|
* speech, while higher value means faster speech rate. If unset, default value 1
|
|
@@ -3412,7 +4561,7 @@ export declare namespace CallCreatePhoneCallParams {
|
|
|
3412
4561
|
* Select the underlying speech to speech model. Can only set this or model, not
|
|
3413
4562
|
* both.
|
|
3414
4563
|
*/
|
|
3415
|
-
s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
4564
|
+
s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
3416
4565
|
/**
|
|
3417
4566
|
* The speaker who starts the conversation. Required. Must be either 'user' or
|
|
3418
4567
|
* 'agent'.
|
|
@@ -3814,7 +4963,7 @@ export declare namespace CallCreateWebCallParams {
|
|
|
3814
4963
|
* available voice models. Set to null to remove voice model selection, and default
|
|
3815
4964
|
* ones will apply. Check out dashboard for more details of each voice model.
|
|
3816
4965
|
*/
|
|
3817
|
-
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
|
|
4966
|
+
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
|
|
3818
4967
|
/**
|
|
3819
4968
|
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
|
|
3820
4969
|
* speech, while higher value means faster speech rate. If unset, default value 1
|
|
@@ -4361,7 +5510,7 @@ export declare namespace CallCreateWebCallParams {
|
|
|
4361
5510
|
* Select the underlying speech to speech model. Can only set this or model, not
|
|
4362
5511
|
* both.
|
|
4363
5512
|
*/
|
|
4364
|
-
s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
5513
|
+
s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
4365
5514
|
/**
|
|
4366
5515
|
* The speaker who starts the conversation. Required. Must be either 'user' or
|
|
4367
5516
|
* 'agent'.
|
|
@@ -4762,7 +5911,7 @@ export declare namespace CallRegisterPhoneCallParams {
|
|
|
4762
5911
|
* available voice models. Set to null to remove voice model selection, and default
|
|
4763
5912
|
* ones will apply. Check out dashboard for more details of each voice model.
|
|
4764
5913
|
*/
|
|
4765
|
-
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
|
|
5914
|
+
voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
|
|
4766
5915
|
/**
|
|
4767
5916
|
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
|
|
4768
5917
|
* speech, while higher value means faster speech rate. If unset, default value 1
|
|
@@ -5309,7 +6458,7 @@ export declare namespace CallRegisterPhoneCallParams {
|
|
|
5309
6458
|
* Select the underlying speech to speech model. Can only set this or model, not
|
|
5310
6459
|
* both.
|
|
5311
6460
|
*/
|
|
5312
|
-
s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
6461
|
+
s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
|
|
5313
6462
|
/**
|
|
5314
6463
|
* The speaker who starts the conversation. Required. Must be either 'user' or
|
|
5315
6464
|
* 'agent'.
|