agentphone 1.0.3 → 1.0.4

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.
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentphone",
46
- "X-Fern-SDK-Version": "1.0.3",
47
- "User-Agent": "agentphone/1.0.3",
46
+ "X-Fern-SDK-Version": "1.0.4",
47
+ "User-Agent": "agentphone/1.0.4",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -10,6 +10,16 @@ export declare namespace AgentsClient {
10
10
  export declare class AgentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
12
12
  constructor(options: AgentsClient.Options);
13
+ /**
14
+ * Return available voices from the call provider (Retell).
15
+ *
16
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @example
19
+ * await client.agents.listVoices()
20
+ */
21
+ listVoices(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
22
+ private __listVoices;
13
23
  /**
14
24
  * List all agents for this account.
15
25
  *
@@ -66,6 +66,46 @@ class AgentsClient {
66
66
  constructor(options) {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
+ /**
70
+ * Return available voices from the call provider (Retell).
71
+ *
72
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @example
75
+ * await client.agents.listVoices()
76
+ */
77
+ listVoices(requestOptions) {
78
+ return core.HttpResponsePromise.fromPromise(this.__listVoices(requestOptions));
79
+ }
80
+ __listVoices(requestOptions) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
83
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
84
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
+ const _response = yield core.fetcher({
86
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Default, "v1/agents/voices"),
87
+ method: "GET",
88
+ headers: _headers,
89
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
90
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
91
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
92
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
93
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
94
+ logging: this._options.logging,
95
+ });
96
+ if (_response.ok) {
97
+ return { data: _response.body, rawResponse: _response.rawResponse };
98
+ }
99
+ if (_response.error.reason === "status-code") {
100
+ throw new errors.AgentPhoneError({
101
+ statusCode: _response.error.statusCode,
102
+ body: _response.error.body,
103
+ rawResponse: _response.rawResponse,
104
+ });
105
+ }
106
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/agents/voices");
107
+ });
108
+ }
69
109
  /**
70
110
  * List all agents for this account.
71
111
  *
@@ -8,6 +8,7 @@ export interface CreateAgentRequest {
8
8
  name: string;
9
9
  description?: string | null;
10
10
  voiceMode?: string | null;
11
+ modelTier?: string | null;
11
12
  systemPrompt?: string | null;
12
13
  beginMessage?: string | null;
13
14
  voice?: string | null;
@@ -9,6 +9,7 @@ export interface UpdateAgentRequest {
9
9
  name?: string | null;
10
10
  description?: string | null;
11
11
  voiceMode?: string | null;
12
+ modelTier?: string | null;
12
13
  systemPrompt?: string | null;
13
14
  beginMessage?: string | null;
14
15
  voice?: string | null;
@@ -14,8 +14,8 @@ export interface CreateOutboundCallRequest {
14
14
  fromNumberId?: string | null;
15
15
  /** Optional initial greeting to speak when recipient answers */
16
16
  initialGreeting?: string | null;
17
- /** Voice to use for speaking (default: Polly.Amy) */
18
- voice?: string;
17
+ /** Voice ID override for this call (uses agent's configured voice if omitted) */
18
+ voice?: string | null;
19
19
  /** When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. */
20
20
  systemPrompt?: string | null;
21
21
  }
@@ -4,6 +4,7 @@ export interface AgentResponse {
4
4
  name: string;
5
5
  description: string | null;
6
6
  voiceMode: string;
7
+ modelTier?: string;
7
8
  systemPrompt?: string | null;
8
9
  beginMessage?: string | null;
9
10
  voice: string;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.3";
1
+ export declare const SDK_VERSION = "1.0.4";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.3";
4
+ exports.SDK_VERSION = "1.0.4";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.3",
10
- "User-Agent": "agentphone/1.0.3",
9
+ "X-Fern-SDK-Version": "1.0.4",
10
+ "User-Agent": "agentphone/1.0.4",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -10,6 +10,16 @@ export declare namespace AgentsClient {
10
10
  export declare class AgentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
12
12
  constructor(options: AgentsClient.Options);
13
+ /**
14
+ * Return available voices from the call provider (Retell).
15
+ *
16
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @example
19
+ * await client.agents.listVoices()
20
+ */
21
+ listVoices(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
22
+ private __listVoices;
13
23
  /**
14
24
  * List all agents for this account.
15
25
  *
@@ -30,6 +30,46 @@ export class AgentsClient {
30
30
  constructor(options) {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
+ /**
34
+ * Return available voices from the call provider (Retell).
35
+ *
36
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @example
39
+ * await client.agents.listVoices()
40
+ */
41
+ listVoices(requestOptions) {
42
+ return core.HttpResponsePromise.fromPromise(this.__listVoices(requestOptions));
43
+ }
44
+ __listVoices(requestOptions) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
48
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
49
+ const _response = yield core.fetcher({
50
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Default, "v1/agents/voices"),
51
+ method: "GET",
52
+ headers: _headers,
53
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
54
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
55
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
56
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
57
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
58
+ logging: this._options.logging,
59
+ });
60
+ if (_response.ok) {
61
+ return { data: _response.body, rawResponse: _response.rawResponse };
62
+ }
63
+ if (_response.error.reason === "status-code") {
64
+ throw new errors.AgentPhoneError({
65
+ statusCode: _response.error.statusCode,
66
+ body: _response.error.body,
67
+ rawResponse: _response.rawResponse,
68
+ });
69
+ }
70
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents/voices");
71
+ });
72
+ }
33
73
  /**
34
74
  * List all agents for this account.
35
75
  *
@@ -8,6 +8,7 @@ export interface CreateAgentRequest {
8
8
  name: string;
9
9
  description?: string | null;
10
10
  voiceMode?: string | null;
11
+ modelTier?: string | null;
11
12
  systemPrompt?: string | null;
12
13
  beginMessage?: string | null;
13
14
  voice?: string | null;
@@ -9,6 +9,7 @@ export interface UpdateAgentRequest {
9
9
  name?: string | null;
10
10
  description?: string | null;
11
11
  voiceMode?: string | null;
12
+ modelTier?: string | null;
12
13
  systemPrompt?: string | null;
13
14
  beginMessage?: string | null;
14
15
  voice?: string | null;
@@ -14,8 +14,8 @@ export interface CreateOutboundCallRequest {
14
14
  fromNumberId?: string | null;
15
15
  /** Optional initial greeting to speak when recipient answers */
16
16
  initialGreeting?: string | null;
17
- /** Voice to use for speaking (default: Polly.Amy) */
18
- voice?: string;
17
+ /** Voice ID override for this call (uses agent's configured voice if omitted) */
18
+ voice?: string | null;
19
19
  /** When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. */
20
20
  systemPrompt?: string | null;
21
21
  }
@@ -4,6 +4,7 @@ export interface AgentResponse {
4
4
  name: string;
5
5
  description: string | null;
6
6
  voiceMode: string;
7
+ modelTier?: string;
7
8
  systemPrompt?: string | null;
8
9
  beginMessage?: string | null;
9
10
  voice: string;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.3";
1
+ export declare const SDK_VERSION = "1.0.4";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.3";
1
+ export const SDK_VERSION = "1.0.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentphone",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Reference
2
2
  ## Agents
3
+ <details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">listVoices</a>() -> unknown</code></summary>
4
+ <dl>
5
+ <dd>
6
+
7
+ #### 📝 Description
8
+
9
+ <dl>
10
+ <dd>
11
+
12
+ <dl>
13
+ <dd>
14
+
15
+ Return available voices from the call provider (Retell).
16
+ </dd>
17
+ </dl>
18
+ </dd>
19
+ </dl>
20
+
21
+ #### 🔌 Usage
22
+
23
+ <dl>
24
+ <dd>
25
+
26
+ <dl>
27
+ <dd>
28
+
29
+ ```typescript
30
+ await client.agents.listVoices();
31
+
32
+ ```
33
+ </dd>
34
+ </dl>
35
+ </dd>
36
+ </dl>
37
+
38
+ #### ⚙️ Parameters
39
+
40
+ <dl>
41
+ <dd>
42
+
43
+ <dl>
44
+ <dd>
45
+
46
+ **requestOptions:** `AgentsClient.RequestOptions`
47
+
48
+ </dd>
49
+ </dl>
50
+ </dd>
51
+ </dl>
52
+
53
+
54
+ </dd>
55
+ </dl>
56
+ </details>
57
+
3
58
  <details><summary><code>client.agents.<a href="/src/api/resources/agents/client/Client.ts">listAgents</a>({ ...params }) -> AgentPhone.AgentListResponse</code></summary>
4
59
  <dl>
5
60
  <dd>