@unboundcx/sdk 4.13.102 → 4.13.104

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
@@ -370,6 +370,9 @@ const response = await api.ai.generative.chat({
370
370
  model: 'gpt-4',
371
371
  temperature: 0.7,
372
372
  method: 'openai',
373
+ // optional, telemetry-only attribution — never affects the prompt,
374
+ // session, caching, or response (contracts §9):
375
+ // usageContext: { feature: 'sentiment', taskId, sipCallId, queueId, cdrId }
373
376
  });
374
377
 
375
378
  // Text-to-Speech
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.102",
3
+ "version": "4.13.104",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/services/ai.js CHANGED
@@ -85,6 +85,7 @@ export class GenerativeService {
85
85
  meta,
86
86
  qualityCheck,
87
87
  isPublic,
88
+ usageContext,
88
89
  }) {
89
90
  this.sdk.validateParams(
90
91
  {
@@ -112,6 +113,7 @@ export class GenerativeService {
112
113
  meta,
113
114
  qualityCheck,
114
115
  isPublic,
116
+ usageContext,
115
117
  },
116
118
  {
117
119
  prompt: { type: 'string', required: false },
@@ -138,6 +140,9 @@ export class GenerativeService {
138
140
  meta: { type: 'object', required: false },
139
141
  qualityCheck: { type: 'boolean', required: false },
140
142
  isPublic: { type: 'boolean', required: false },
143
+ // Telemetry-only (contracts §9): { feature?, taskId?, sipCallId?,
144
+ // queueId?, cdrId? } -- never affects the prompt/session/cache/response.
145
+ usageContext: { type: 'object', required: false },
141
146
  },
142
147
  );
143
148
 
@@ -168,6 +173,9 @@ export class GenerativeService {
168
173
  meta,
169
174
  qualityCheck,
170
175
  isPublic,
176
+ // Only included when the caller actually passed one -- keeps the
177
+ // wire payload identical to today for every existing caller.
178
+ ...(usageContext !== undefined ? { usageContext } : {}),
171
179
  },
172
180
  // Return raw response for streaming to allow client-side stream handling
173
181
  returnRawResponse: stream === true,
@@ -7,22 +7,6 @@ export class WorkflowsService {
7
7
  this.sessions = new WorkflowSessionsService(sdk);
8
8
  }
9
9
 
10
- async getSettings(type) {
11
- this.sdk.validateParams(
12
- { type },
13
- {
14
- type: { type: 'string', required: true },
15
- },
16
- );
17
-
18
- const params = {
19
- query: { type },
20
- };
21
-
22
- const result = await internalRequest(this.sdk, '/workflows/settings', 'GET', params);
23
- return result;
24
- }
25
-
26
10
  async listModules() {
27
11
  const params = {
28
12
  query: {},
@@ -403,11 +387,10 @@ export class WorkflowSessionsService {
403
387
  },
404
388
  );
405
389
 
406
- const result = await internalRequest(this.sdk,
407
- `/workflows/sessions/${sessionId}`,
408
- 'GET',
409
- );
410
- return result;
390
+ return this.sdk.objects.byId({
391
+ object: 'workflowSessions',
392
+ id: sessionId,
393
+ });
411
394
  }
412
395
 
413
396
  async update(sessionId, updateData) {
@@ -449,21 +432,6 @@ export class WorkflowSessionsService {
449
432
  return result;
450
433
  }
451
434
 
452
- async delete(sessionId) {
453
- this.sdk.validateParams(
454
- { sessionId },
455
- {
456
- sessionId: { type: 'string', required: true },
457
- },
458
- );
459
-
460
- const result = await internalRequest(this.sdk,
461
- `/workflows/sessions/${sessionId}`,
462
- 'DELETE',
463
- );
464
- return result;
465
- }
466
-
467
435
  async logTranscript(sessionId, transcriptData) {
468
436
  this.sdk.validateParams(
469
437
  { sessionId },