phonic 0.29.1 → 0.29.3

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/README.md CHANGED
@@ -80,6 +80,7 @@ const result = await phonic.agents.create({
80
80
  timezone: "Australia/Melbourne", // Defaults to "America/Los_Angeles"
81
81
  audioFormat: "mulaw_8000", // Defaults to "pcm_44100". Must be "mulaw_8000" when `phoneNumber` is "assign-automatically"
82
82
  voiceId: "sarah", // Defaults to "grant"
83
+ audioSpeed: 1.1, // Defaults to 1.0. Must be between 0.5 and 1.5, multiple of 0.1
83
84
  welcomeMessage: "Hello, how can I help you?", // Defaults to ""
84
85
  systemPrompt: "You are an expert in {{subject}}. Be kind to {{user_name}}.", // Defaults to "Respond in 1-2 sentences."
85
86
  templateVariables: {
@@ -117,6 +118,7 @@ const result = await phonic.agents.update("chris", {
117
118
  timezone: "Australia/Melbourne",
118
119
  voiceId: "sarah",
119
120
  audioFormat: "mulaw_8000", // Must be "mulaw_8000" when `phoneNumber` is "assign-automatically"
121
+ audioSpeed: 1.1, // Must be between 0.5 and 1.5, multiple of 0.1
120
122
  welcomeMessage: "Hello, how can I help you?",
121
123
  systemPrompt: "You are an expert in {{subject}}. Be kind to {{user_name}}.",
122
124
  templateVariables: {
@@ -154,6 +156,7 @@ const result = await phonic.agents.upsert({
154
156
  timezone: "Australia/Melbourne",
155
157
  voiceId: "sarah",
156
158
  audioFormat: "mulaw_8000", // Must be "mulaw_8000" when `phoneNumber` is "assign-automatically"
159
+ audioSpeed: 1.1, // Defaults to 1.0. Must be between 0.5 and 1.5, multiple of 0.1
157
160
  welcomeMessage: "Hello, how can I help you?",
158
161
  systemPrompt: "You are an expert in {{subject}}. Be kind to {{user_name}}.",
159
162
  templateVariables: {
package/dist/index.d.mts CHANGED
@@ -47,41 +47,65 @@ type TaskResult = {
47
47
  type TaskResults = {
48
48
  results: Array<TaskResult>;
49
49
  };
50
+ type ToolCall = {
51
+ id: string;
52
+ tool: {
53
+ id: string;
54
+ name: string;
55
+ };
56
+ endpoint_url: string | null;
57
+ endpoint_headers: Record<string, string> | null;
58
+ endpoint_timeout_ms: number | null;
59
+ endpoint_called_at: string | null;
60
+ request_body: Record<string, unknown> | null;
61
+ response_body: Record<string, unknown> | null;
62
+ response_status_code: number | null;
63
+ timed_out: boolean | null;
64
+ error_message: string | null;
65
+ };
50
66
  type ConversationItem = {
51
- role: "user";
52
67
  item_idx: number;
53
- text: string;
68
+ role: "user";
69
+ live_transcript: string;
70
+ post_call_transcript: string | null;
54
71
  duration_ms: number;
55
72
  started_at: string;
56
73
  } | {
57
- role: "assistant";
58
74
  item_idx: number;
59
- text: string;
75
+ role: "assistant";
76
+ live_transcript: string;
60
77
  voice_id: string;
61
78
  system_prompt: string;
62
79
  audio_speed: number;
63
80
  duration_ms: number;
64
81
  started_at: string;
82
+ tool_calls: Array<ToolCall>;
65
83
  };
66
84
  type Conversation = {
67
85
  id: string;
68
- external_id: string | null;
69
- workspace: string;
70
86
  agent: {
71
87
  id: string;
72
88
  name: string;
89
+ is_deleted: boolean;
73
90
  } | null;
91
+ workspace: string;
92
+ project: {
93
+ id: string;
94
+ name: string;
95
+ };
96
+ external_id: string | null;
74
97
  model: string;
75
98
  welcome_message: string | null;
99
+ template_variables: Record<string, string>;
76
100
  input_format: "pcm_44100" | "mulaw_8000";
77
101
  output_format: "pcm_44100" | "mulaw_8000";
78
102
  live_transcript: string;
79
103
  post_call_transcript: string | null;
80
- audio_url: string | null;
81
104
  duration_ms: number;
82
- task_results: TaskResults;
105
+ audio_url: string | null;
83
106
  started_at: ISODateTime;
84
107
  ended_at: ISODateTime | null;
108
+ task_results: TaskResults;
85
109
  items: Array<ConversationItem>;
86
110
  };
87
111
  type ConversationEndedWebhookPayload = {
@@ -115,6 +139,7 @@ interface PhonicSTSConfigBase {
115
139
  input_format: "pcm_44100" | "mulaw_8000";
116
140
  output_format?: "pcm_44100" | "mulaw_8000";
117
141
  voice_id?: string;
142
+ audio_speed?: number;
118
143
  welcome_message?: string;
119
144
  system_prompt?: string;
120
145
  template_variables?: Record<string, string>;
@@ -275,6 +300,7 @@ interface AgentOptionalParams {
275
300
  project?: string;
276
301
  timezone?: string;
277
302
  voiceId?: string;
303
+ audioSpeed?: number;
278
304
  welcomeMessage?: string;
279
305
  systemPrompt?: string;
280
306
  templateVariables?: Record<string, {
package/dist/index.d.ts CHANGED
@@ -47,41 +47,65 @@ type TaskResult = {
47
47
  type TaskResults = {
48
48
  results: Array<TaskResult>;
49
49
  };
50
+ type ToolCall = {
51
+ id: string;
52
+ tool: {
53
+ id: string;
54
+ name: string;
55
+ };
56
+ endpoint_url: string | null;
57
+ endpoint_headers: Record<string, string> | null;
58
+ endpoint_timeout_ms: number | null;
59
+ endpoint_called_at: string | null;
60
+ request_body: Record<string, unknown> | null;
61
+ response_body: Record<string, unknown> | null;
62
+ response_status_code: number | null;
63
+ timed_out: boolean | null;
64
+ error_message: string | null;
65
+ };
50
66
  type ConversationItem = {
51
- role: "user";
52
67
  item_idx: number;
53
- text: string;
68
+ role: "user";
69
+ live_transcript: string;
70
+ post_call_transcript: string | null;
54
71
  duration_ms: number;
55
72
  started_at: string;
56
73
  } | {
57
- role: "assistant";
58
74
  item_idx: number;
59
- text: string;
75
+ role: "assistant";
76
+ live_transcript: string;
60
77
  voice_id: string;
61
78
  system_prompt: string;
62
79
  audio_speed: number;
63
80
  duration_ms: number;
64
81
  started_at: string;
82
+ tool_calls: Array<ToolCall>;
65
83
  };
66
84
  type Conversation = {
67
85
  id: string;
68
- external_id: string | null;
69
- workspace: string;
70
86
  agent: {
71
87
  id: string;
72
88
  name: string;
89
+ is_deleted: boolean;
73
90
  } | null;
91
+ workspace: string;
92
+ project: {
93
+ id: string;
94
+ name: string;
95
+ };
96
+ external_id: string | null;
74
97
  model: string;
75
98
  welcome_message: string | null;
99
+ template_variables: Record<string, string>;
76
100
  input_format: "pcm_44100" | "mulaw_8000";
77
101
  output_format: "pcm_44100" | "mulaw_8000";
78
102
  live_transcript: string;
79
103
  post_call_transcript: string | null;
80
- audio_url: string | null;
81
104
  duration_ms: number;
82
- task_results: TaskResults;
105
+ audio_url: string | null;
83
106
  started_at: ISODateTime;
84
107
  ended_at: ISODateTime | null;
108
+ task_results: TaskResults;
85
109
  items: Array<ConversationItem>;
86
110
  };
87
111
  type ConversationEndedWebhookPayload = {
@@ -115,6 +139,7 @@ interface PhonicSTSConfigBase {
115
139
  input_format: "pcm_44100" | "mulaw_8000";
116
140
  output_format?: "pcm_44100" | "mulaw_8000";
117
141
  voice_id?: string;
142
+ audio_speed?: number;
118
143
  welcome_message?: string;
119
144
  system_prompt?: string;
120
145
  template_variables?: Record<string, string>;
@@ -275,6 +300,7 @@ interface AgentOptionalParams {
275
300
  project?: string;
276
301
  timezone?: string;
277
302
  voiceId?: string;
303
+ audioSpeed?: number;
278
304
  welcomeMessage?: string;
279
305
  systemPrompt?: string;
280
306
  templateVariables?: Record<string, {
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ __export(index_exports, {
35
35
  module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // package.json
38
- var version = "0.29.1";
38
+ var version = "0.29.3";
39
39
 
40
40
  // src/agents/index.ts
41
41
  var Agents = class {
@@ -92,6 +92,7 @@ var Agents = class {
92
92
  phone_number: params.phoneNumber,
93
93
  timezone: params.timezone,
94
94
  audio_format: params.phoneNumber === "assign-automatically" ? "mulaw_8000" : params.audioFormat,
95
+ audio_speed: params.audioSpeed,
95
96
  voice_id: params.voiceId,
96
97
  welcome_message: params.welcomeMessage,
97
98
  system_prompt: params.systemPrompt,
@@ -119,6 +120,7 @@ var Agents = class {
119
120
  timezone: params.timezone,
120
121
  audio_format: params.phoneNumber === "assign-automatically" ? "mulaw_8000" : params.audioFormat,
121
122
  voice_id: params.voiceId,
123
+ audio_speed: params.audioSpeed,
122
124
  welcome_message: params.welcomeMessage,
123
125
  system_prompt: params.systemPrompt,
124
126
  template_variables: this.getTemplateVariablesForBody(
@@ -147,6 +149,7 @@ var Agents = class {
147
149
  voice_id: params.voiceId,
148
150
  welcome_message: params.welcomeMessage,
149
151
  system_prompt: params.systemPrompt,
152
+ audio_speed: params.audioSpeed,
150
153
  template_variables: this.getTemplateVariablesForBody(
151
154
  params.templateVariables
152
155
  ),
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.29.1";
2
+ var version = "0.29.3";
3
3
 
4
4
  // src/agents/index.ts
5
5
  var Agents = class {
@@ -56,6 +56,7 @@ var Agents = class {
56
56
  phone_number: params.phoneNumber,
57
57
  timezone: params.timezone,
58
58
  audio_format: params.phoneNumber === "assign-automatically" ? "mulaw_8000" : params.audioFormat,
59
+ audio_speed: params.audioSpeed,
59
60
  voice_id: params.voiceId,
60
61
  welcome_message: params.welcomeMessage,
61
62
  system_prompt: params.systemPrompt,
@@ -83,6 +84,7 @@ var Agents = class {
83
84
  timezone: params.timezone,
84
85
  audio_format: params.phoneNumber === "assign-automatically" ? "mulaw_8000" : params.audioFormat,
85
86
  voice_id: params.voiceId,
87
+ audio_speed: params.audioSpeed,
86
88
  welcome_message: params.welcomeMessage,
87
89
  system_prompt: params.systemPrompt,
88
90
  template_variables: this.getTemplateVariablesForBody(
@@ -111,6 +113,7 @@ var Agents = class {
111
113
  voice_id: params.voiceId,
112
114
  welcome_message: params.welcomeMessage,
113
115
  system_prompt: params.systemPrompt,
116
+ audio_speed: params.audioSpeed,
114
117
  template_variables: this.getTemplateVariablesForBody(
115
118
  params.templateVariables
116
119
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.29.1",
3
+ "version": "0.29.3",
4
4
  "description": "Phonic Node.js SDK",
5
5
  "scripts": {
6
6
  "build": "tsup",