retell-sdk 4.25.0 → 4.26.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.
@@ -4,7 +4,9 @@ export {
4
4
  Agent,
5
5
  type AgentResponse,
6
6
  type AgentListResponse,
7
+ type AgentGetVersionsResponse,
7
8
  type AgentCreateParams,
9
+ type AgentRetrieveParams,
8
10
  type AgentUpdateParams,
9
11
  } from './agent';
10
12
  export { BatchCall, type BatchCallResponse, type BatchCallCreateBatchCallParams } from './batch-call';
@@ -33,6 +35,7 @@ export {
33
35
  type LlmResponse,
34
36
  type LlmListResponse,
35
37
  type LlmCreateParams,
38
+ type LlmRetrieveParams,
36
39
  type LlmUpdateParams,
37
40
  } from './llm';
38
41
  export {
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
4
5
  import * as Core from '../core';
5
6
 
6
7
  export class Llm extends APIResource {
@@ -15,15 +16,37 @@ export class Llm extends APIResource {
15
16
  /**
16
17
  * Retrieve details of a specific Retell LLM Response Engine
17
18
  */
18
- retrieve(llmId: string, options?: Core.RequestOptions): Core.APIPromise<LlmResponse> {
19
- return this._client.get(`/get-retell-llm/${llmId}`, options);
19
+ retrieve(
20
+ llmId: string,
21
+ query?: LlmRetrieveParams,
22
+ options?: Core.RequestOptions,
23
+ ): Core.APIPromise<LlmResponse>;
24
+ retrieve(llmId: string, options?: Core.RequestOptions): Core.APIPromise<LlmResponse>;
25
+ retrieve(
26
+ llmId: string,
27
+ query: LlmRetrieveParams | Core.RequestOptions = {},
28
+ options?: Core.RequestOptions,
29
+ ): Core.APIPromise<LlmResponse> {
30
+ if (isRequestOptions(query)) {
31
+ return this.retrieve(llmId, {}, query);
32
+ }
33
+ return this._client.get(`/get-retell-llm/${llmId}`, { query, ...options });
20
34
  }
21
35
 
22
36
  /**
23
37
  * Update an existing Retell LLM Response Engine
24
38
  */
25
- update(llmId: string, body: LlmUpdateParams, options?: Core.RequestOptions): Core.APIPromise<LlmResponse> {
26
- return this._client.patch(`/update-retell-llm/${llmId}`, { body, ...options });
39
+ update(
40
+ llmId: string,
41
+ params: LlmUpdateParams,
42
+ options?: Core.RequestOptions,
43
+ ): Core.APIPromise<LlmResponse> {
44
+ const { query_version, ...body } = params;
45
+ return this._client.patch(`/update-retell-llm/${llmId}`, {
46
+ query: { version: query_version },
47
+ body,
48
+ ...options,
49
+ });
27
50
  }
28
51
 
29
52
  /**
@@ -156,6 +179,11 @@ export interface LlmResponse {
156
179
  * processing is needed. Default to false.
157
180
  */
158
181
  tool_call_strict_mode?: boolean;
182
+
183
+ /**
184
+ * Version of the Retell LLM.
185
+ */
186
+ version?: number | null;
159
187
  }
160
188
 
161
189
  export namespace LlmResponse {
@@ -945,6 +973,11 @@ export interface LlmCreateParams {
945
973
  * processing is needed. Default to false.
946
974
  */
947
975
  tool_call_strict_mode?: boolean;
976
+
977
+ /**
978
+ * Version of the Retell LLM.
979
+ */
980
+ version?: number | null;
948
981
  }
949
982
 
950
983
  export namespace LlmCreateParams {
@@ -1631,22 +1664,36 @@ export namespace LlmCreateParams {
1631
1664
  }
1632
1665
  }
1633
1666
 
1667
+ export interface LlmRetrieveParams {
1668
+ /**
1669
+ * Optional version of the API to use for this request. Default to 0.
1670
+ */
1671
+ version?: number;
1672
+ }
1673
+
1634
1674
  export interface LlmUpdateParams {
1635
1675
  /**
1636
- * First utterance said by the agent in the call. If not set, LLM will dynamically
1637
- * generate a message. If set to "", agent will wait for user to speak first.
1676
+ * Query param: Optional version of the API to use for this request. Default to 0.
1677
+ */
1678
+ query_version?: number;
1679
+
1680
+ /**
1681
+ * Body param: First utterance said by the agent in the call. If not set, LLM will
1682
+ * dynamically generate a message. If set to "", agent will wait for user to speak
1683
+ * first.
1638
1684
  */
1639
1685
  begin_message?: string | null;
1640
1686
 
1641
1687
  /**
1642
- * Default dynamic variables represented as key-value pairs of strings. These are
1643
- * injected into your Retell LLM prompt and tool description when specific values
1644
- * are not provided in a request. Only applicable for Retell LLM.
1688
+ * Body param: Default dynamic variables represented as key-value pairs of strings.
1689
+ * These are injected into your Retell LLM prompt and tool description when
1690
+ * specific values are not provided in a request. Only applicable for Retell LLM.
1645
1691
  */
1646
1692
  default_dynamic_variables?: Record<string, string> | null;
1647
1693
 
1648
1694
  /**
1649
- * General prompt appended to system prompt no matter what state the agent is in.
1695
+ * Body param: General prompt appended to system prompt no matter what state the
1696
+ * agent is in.
1650
1697
  *
1651
1698
  * - System prompt (with state) = general prompt + state prompt.
1652
1699
  *
@@ -1655,9 +1702,10 @@ export interface LlmUpdateParams {
1655
1702
  general_prompt?: string | null;
1656
1703
 
1657
1704
  /**
1658
- * A list of tools the model may call (to get external knowledge, call API, etc).
1659
- * You can select from some common predefined tools like end call, transfer call,
1660
- * etc; or you can create your own custom tool (last option) for the LLM to use.
1705
+ * Body param: A list of tools the model may call (to get external knowledge, call
1706
+ * API, etc). You can select from some common predefined tools like end call,
1707
+ * transfer call, etc; or you can create your own custom tool (last option) for the
1708
+ * LLM to use.
1661
1709
  *
1662
1710
  * - Tools of LLM (with state) = general tools + state tools + state transitions
1663
1711
  *
@@ -1673,13 +1721,13 @@ export interface LlmUpdateParams {
1673
1721
  > | null;
1674
1722
 
1675
1723
  /**
1676
- * A list of knowledge base ids to use for this resource. Set to null to remove all
1677
- * knowledge bases.
1724
+ * Body param: A list of knowledge base ids to use for this resource. Set to null
1725
+ * to remove all knowledge bases.
1678
1726
  */
1679
1727
  knowledge_base_ids?: Array<string> | null;
1680
1728
 
1681
1729
  /**
1682
- * Select the underlying text LLM. If not set, would default to gpt-4o.
1730
+ * Body param: Select the underlying text LLM. If not set, would default to gpt-4o.
1683
1731
  */
1684
1732
  model?:
1685
1733
  | 'gpt-4o'
@@ -1691,47 +1739,52 @@ export interface LlmUpdateParams {
1691
1739
  | null;
1692
1740
 
1693
1741
  /**
1694
- * If set to true, will use high priority pool with more dedicated resource to
1695
- * ensure lower and more consistent latency, default to false. This feature usually
1696
- * comes with a higher cost.
1742
+ * Body param: If set to true, will use high priority pool with more dedicated
1743
+ * resource to ensure lower and more consistent latency, default to false. This
1744
+ * feature usually comes with a higher cost.
1697
1745
  */
1698
1746
  model_high_priority?: boolean;
1699
1747
 
1700
1748
  /**
1701
- * If set, will control the randomness of the response. Value ranging from [0,1].
1702
- * Lower value means more deterministic, while higher value means more random. If
1703
- * unset, default value 0 will apply. Note that for tool calling, a lower value is
1704
- * recommended.
1749
+ * Body param: If set, will control the randomness of the response. Value ranging
1750
+ * from [0,1]. Lower value means more deterministic, while higher value means more
1751
+ * random. If unset, default value 0 will apply. Note that for tool calling, a
1752
+ * lower value is recommended.
1705
1753
  */
1706
1754
  model_temperature?: number;
1707
1755
 
1708
1756
  /**
1709
- * Select the underlying speech to speech model. Can only set this or model, not
1710
- * both.
1757
+ * Body param: Select the underlying speech to speech model. Can only set this or
1758
+ * model, not both.
1711
1759
  */
1712
1760
  s2s_model?: 'gpt-4o-realtime' | 'gpt-4o-mini-realtime' | null;
1713
1761
 
1714
1762
  /**
1715
- * Name of the starting state. Required if states is not empty.
1763
+ * Body param: Name of the starting state. Required if states is not empty.
1716
1764
  */
1717
1765
  starting_state?: string | null;
1718
1766
 
1719
1767
  /**
1720
- * States of the LLM. This is to help reduce prompt length and tool choices when
1721
- * the call can be broken into distinct states. With shorter prompts and less
1722
- * tools, the LLM can better focus and follow the rules, minimizing hallucination.
1723
- * If this field is not set, the agent would only have general prompt and general
1724
- * tools (essentially one state).
1768
+ * Body param: States of the LLM. This is to help reduce prompt length and tool
1769
+ * choices when the call can be broken into distinct states. With shorter prompts
1770
+ * and less tools, the LLM can better focus and follow the rules, minimizing
1771
+ * hallucination. If this field is not set, the agent would only have general
1772
+ * prompt and general tools (essentially one state).
1725
1773
  */
1726
1774
  states?: Array<LlmUpdateParams.State> | null;
1727
1775
 
1728
1776
  /**
1729
- * Only applicable when model is gpt-4o or gpt-4o mini. If set to true, will use
1730
- * structured output to make sure tool call arguments follow the json schema. The
1731
- * time to save a new tool or change to a tool will be longer as additional
1732
- * processing is needed. Default to false.
1777
+ * Body param: Only applicable when model is gpt-4o or gpt-4o mini. If set to true,
1778
+ * will use structured output to make sure tool call arguments follow the json
1779
+ * schema. The time to save a new tool or change to a tool will be longer as
1780
+ * additional processing is needed. Default to false.
1733
1781
  */
1734
1782
  tool_call_strict_mode?: boolean;
1783
+
1784
+ /**
1785
+ * Body param: Version of the Retell LLM.
1786
+ */
1787
+ body_version?: number | null;
1735
1788
  }
1736
1789
 
1737
1790
  export namespace LlmUpdateParams {
@@ -2423,6 +2476,7 @@ export declare namespace Llm {
2423
2476
  type LlmResponse as LlmResponse,
2424
2477
  type LlmListResponse as LlmListResponse,
2425
2478
  type LlmCreateParams as LlmCreateParams,
2479
+ type LlmRetrieveParams as LlmRetrieveParams,
2426
2480
  type LlmUpdateParams as LlmUpdateParams,
2427
2481
  };
2428
2482
  }
@@ -80,6 +80,11 @@ export interface PhoneNumberResponse {
80
80
  */
81
81
  inbound_agent_id?: string | null;
82
82
 
83
+ /**
84
+ * The version of the inbound agent.
85
+ */
86
+ inbound_agent_version?: number | null;
87
+
83
88
  /**
84
89
  * If set, will send a webhook for inbound calls, where you can to override agent
85
90
  * id, set dynamic variables and other fields specific to that call.
@@ -98,6 +103,11 @@ export interface PhoneNumberResponse {
98
103
  */
99
104
  outbound_agent_id?: string | null;
100
105
 
106
+ /**
107
+ * The version of the outbound agent.
108
+ */
109
+ outbound_agent_version?: number | null;
110
+
101
111
  /**
102
112
  * Pretty printed phone number, provided for your reference.
103
113
  */
@@ -125,6 +135,12 @@ export interface PhoneNumberCreateParams {
125
135
  */
126
136
  inbound_agent_id?: string | null;
127
137
 
138
+ /**
139
+ * Version of the inbound agent to bind to the number. If not provided, will
140
+ * default to 0.
141
+ */
142
+ inbound_agent_version?: number | null;
143
+
128
144
  /**
129
145
  * If set, will send a webhook for inbound calls, where you can to override agent
130
146
  * id, set dynamic variables and other fields specific to that call.
@@ -147,6 +163,12 @@ export interface PhoneNumberCreateParams {
147
163
  * initiate outbound call without agent id override.
148
164
  */
149
165
  outbound_agent_id?: string | null;
166
+
167
+ /**
168
+ * Version of the outbound agent to bind to the number. If not provided, will
169
+ * default to 0.
170
+ */
171
+ outbound_agent_version?: number | null;
150
172
  }
151
173
 
152
174
  export interface PhoneNumberUpdateParams {
@@ -157,6 +179,12 @@ export interface PhoneNumberUpdateParams {
157
179
  */
158
180
  inbound_agent_id?: string | null;
159
181
 
182
+ /**
183
+ * Version of the inbound agent to bind to the number. If not provided, will
184
+ * default to 0.
185
+ */
186
+ inbound_agent_version?: number | null;
187
+
160
188
  /**
161
189
  * If set, will send a webhook for inbound calls, where you can to override agent
162
190
  * id, set dynamic variables and other fields specific to that call.
@@ -174,6 +202,12 @@ export interface PhoneNumberUpdateParams {
174
202
  * able to initiate outbound call without agent id override.
175
203
  */
176
204
  outbound_agent_id?: string | null;
205
+
206
+ /**
207
+ * Version of the outbound agent to bind to the number. If not provided, will
208
+ * default to 0.
209
+ */
210
+ outbound_agent_version?: number | null;
177
211
  }
178
212
 
179
213
  export interface PhoneNumberImportParams {
@@ -198,6 +232,12 @@ export interface PhoneNumberImportParams {
198
232
  */
199
233
  inbound_agent_id?: string | null;
200
234
 
235
+ /**
236
+ * Version of the inbound agent to bind to the number. If not provided, will
237
+ * default to 0.
238
+ */
239
+ inbound_agent_version?: number | null;
240
+
201
241
  /**
202
242
  * If set, will send a webhook for inbound calls, where you can to override agent
203
243
  * id, set dynamic variables and other fields specific to that call.
@@ -214,7 +254,13 @@ export interface PhoneNumberImportParams {
214
254
  * agent when conducting outbound calls. If null, this number would not be able to
215
255
  * initiate outbound call without agent id override.
216
256
  */
217
- outbound_agent_id?: string | null;
257
+ outbound_agent_id?: string;
258
+
259
+ /**
260
+ * Version of the outbound agent to bind to the number. If not provided, will
261
+ * default to 0.
262
+ */
263
+ outbound_agent_version?: number | null;
218
264
 
219
265
  /**
220
266
  * The password used for authentication for the SIP trunk.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.25.0'; // x-release-please-version
1
+ export const VERSION = '4.26.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.25.0";
1
+ export declare const VERSION = "4.26.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.25.0'; // x-release-please-version
4
+ exports.VERSION = '4.26.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.25.0'; // x-release-please-version
1
+ export const VERSION = '4.26.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map