@unboundcx/sdk 4.13.102 → 4.13.103

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.103",
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,