@thisispamela/sdk 1.0.2 → 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.
- package/README.md +5 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/src/index.ts +13 -0
package/README.md
CHANGED
|
@@ -25,6 +25,10 @@ const call = await client.createCall({
|
|
|
25
25
|
to: '+1234567890',
|
|
26
26
|
task: 'Order a large pizza for delivery',
|
|
27
27
|
locale: 'en-US',
|
|
28
|
+
max_duration_seconds: 299,
|
|
29
|
+
voice: 'female',
|
|
30
|
+
agent_name: 'Pamela',
|
|
31
|
+
caller_name: 'John from Acme',
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
console.log('Call created:', call.id);
|
|
@@ -253,6 +257,7 @@ All exceptions have:
|
|
|
253
257
|
- `getCall(callId)` - Get call status and details
|
|
254
258
|
- `listCalls(params?)` - List calls with optional filters
|
|
255
259
|
- `cancelCall(callId)` - Cancel an in-progress call
|
|
260
|
+
- `hangupCall(callId)` - Force hangup an in-progress call
|
|
256
261
|
|
|
257
262
|
### Tools
|
|
258
263
|
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export interface CreateCallRequest {
|
|
|
13
13
|
locale?: string;
|
|
14
14
|
task: string;
|
|
15
15
|
instructions?: string;
|
|
16
|
+
max_duration_seconds?: number;
|
|
17
|
+
voice?: 'male' | 'female' | 'auto';
|
|
18
|
+
agent_name?: string;
|
|
19
|
+
caller_name?: string;
|
|
16
20
|
end_user_id?: string;
|
|
17
21
|
metadata?: Record<string, any>;
|
|
18
22
|
tools?: Array<Record<string, any>>;
|
|
@@ -37,6 +41,7 @@ export interface CallStatus {
|
|
|
37
41
|
started_at?: string;
|
|
38
42
|
completed_at?: string;
|
|
39
43
|
duration_seconds?: number;
|
|
44
|
+
max_duration_seconds?: number;
|
|
40
45
|
transcript?: Array<Record<string, any>>;
|
|
41
46
|
summary?: string;
|
|
42
47
|
metadata: Record<string, any>;
|
|
@@ -111,6 +116,14 @@ export declare class PamelaClient {
|
|
|
111
116
|
call_id: string;
|
|
112
117
|
status: string;
|
|
113
118
|
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Force hangup an in-progress call.
|
|
121
|
+
*/
|
|
122
|
+
hangupCall(callId: string): Promise<{
|
|
123
|
+
success: boolean;
|
|
124
|
+
call_id: string;
|
|
125
|
+
status: string;
|
|
126
|
+
}>;
|
|
114
127
|
/**
|
|
115
128
|
* Register a tool.
|
|
116
129
|
*/
|
package/dist/index.js
CHANGED
|
@@ -161,6 +161,13 @@ class PamelaClient {
|
|
|
161
161
|
const response = await this.client.post(`/calls/${callId}/cancel`);
|
|
162
162
|
return response.data;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Force hangup an in-progress call.
|
|
166
|
+
*/
|
|
167
|
+
async hangupCall(callId) {
|
|
168
|
+
const response = await this.client.post(`/calls/${callId}/hangup`);
|
|
169
|
+
return response.data;
|
|
170
|
+
}
|
|
164
171
|
/**
|
|
165
172
|
* Register a tool.
|
|
166
173
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -24,6 +24,10 @@ export interface CreateCallRequest {
|
|
|
24
24
|
locale?: string;
|
|
25
25
|
task: string;
|
|
26
26
|
instructions?: string;
|
|
27
|
+
max_duration_seconds?: number;
|
|
28
|
+
voice?: 'male' | 'female' | 'auto';
|
|
29
|
+
agent_name?: string;
|
|
30
|
+
caller_name?: string;
|
|
27
31
|
end_user_id?: string;
|
|
28
32
|
metadata?: Record<string, any>;
|
|
29
33
|
tools?: Array<Record<string, any>>;
|
|
@@ -50,6 +54,7 @@ export interface CallStatus {
|
|
|
50
54
|
started_at?: string;
|
|
51
55
|
completed_at?: string;
|
|
52
56
|
duration_seconds?: number;
|
|
57
|
+
max_duration_seconds?: number;
|
|
53
58
|
transcript?: Array<Record<string, any>>;
|
|
54
59
|
summary?: string;
|
|
55
60
|
metadata: Record<string, any>;
|
|
@@ -222,6 +227,14 @@ export class PamelaClient {
|
|
|
222
227
|
return response.data;
|
|
223
228
|
}
|
|
224
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Force hangup an in-progress call.
|
|
232
|
+
*/
|
|
233
|
+
async hangupCall(callId: string): Promise<{ success: boolean; call_id: string; status: string }> {
|
|
234
|
+
const response = await this.client.post(`/calls/${callId}/hangup`);
|
|
235
|
+
return response.data;
|
|
236
|
+
}
|
|
237
|
+
|
|
225
238
|
/**
|
|
226
239
|
* Register a tool.
|
|
227
240
|
*/
|