@boldvideo/bold-js 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @boldvideo/bold-js
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7aff057: Align SDK with API specification
8
+
9
+ - Renamed `synthesize` to `includeGuidance` in `RecommendOptions` to match API
10
+ - Renamed `why` to `reason` in `RecommendationVideo` type to match API response
11
+ - Added `tags` filter to `AskOptions` and `SearchOptions`
12
+ - Added `currentTime` to `ChatOptions` for playback context
13
+
3
14
  ## 1.6.0
4
15
 
5
16
  ### Minor Changes
package/README.md CHANGED
@@ -133,7 +133,7 @@ console.log(response.recommendations);
133
133
  | `limit` | `number` | Max videos per topic (default: 5, max: 20) |
134
134
  | `collectionId` | `string` | Filter to a specific collection |
135
135
  | `tags` | `string[]` | Filter by tags |
136
- | `synthesize` | `boolean` | Include AI guidance (default: true) |
136
+ | `includeGuidance` | `boolean` | Include AI learning path narrative (default: true) |
137
137
  | `context` | `string` | User context for personalized guidance |
138
138
 
139
139
  ### Coach / Ask
@@ -186,6 +186,12 @@ const stream = await bold.ai.chat('video-id', {
186
186
  for await (const event of stream) {
187
187
  if (event.type === 'text_delta') process.stdout.write(event.delta);
188
188
  }
189
+
190
+ // With playback context - helps AI understand what viewer just watched
191
+ const stream = await bold.ai.chat('video-id', {
192
+ prompt: 'What does she mean by that?',
193
+ currentTime: 847 // seconds
194
+ });
189
195
  ```
190
196
 
191
197
  ### Multi-turn Conversations
package/dist/index.cjs CHANGED
@@ -306,6 +306,8 @@ function createAI(config) {
306
306
  const body = { prompt: options.prompt };
307
307
  if (options.collectionId)
308
308
  body.collection_id = options.collectionId;
309
+ if (options.tags)
310
+ body.tags = options.tags;
309
311
  if (options.stream === false) {
310
312
  body.stream = false;
311
313
  return jsonRequest(path, body, config);
@@ -324,6 +326,8 @@ function createAI(config) {
324
326
  body.collection_id = options.collectionId;
325
327
  if (options.videoId)
326
328
  body.video_id = options.videoId;
329
+ if (options.tags)
330
+ body.tags = options.tags;
327
331
  if (options.context)
328
332
  body.context = options.context;
329
333
  if (options.stream === false) {
@@ -335,6 +339,8 @@ function createAI(config) {
335
339
  async function chat(videoId, options) {
336
340
  const path = options.conversationId ? `ai/videos/${videoId}/chat/${options.conversationId}` : `ai/videos/${videoId}/chat`;
337
341
  const body = { prompt: options.prompt };
342
+ if (options.currentTime !== void 0)
343
+ body.current_time = options.currentTime;
338
344
  if (options.stream === false) {
339
345
  body.stream = false;
340
346
  return jsonRequest(path, body, config);
@@ -350,8 +356,8 @@ function createAI(config) {
350
356
  body.collection_id = options.collectionId;
351
357
  if (options.tags)
352
358
  body.tags = options.tags;
353
- if (options.synthesize !== void 0)
354
- body.synthesize = options.synthesize;
359
+ if (options.includeGuidance !== void 0)
360
+ body.include_guidance = options.includeGuidance;
355
361
  if (options.context)
356
362
  body.context = options.context;
357
363
  if (options.stream === false) {
package/dist/index.d.ts CHANGED
@@ -260,6 +260,7 @@ interface AskOptions {
260
260
  stream?: boolean;
261
261
  conversationId?: string;
262
262
  collectionId?: string;
263
+ tags?: string[];
263
264
  }
264
265
  /**
265
266
  * Conversation message for AI context
@@ -277,6 +278,7 @@ interface SearchOptions {
277
278
  limit?: number;
278
279
  collectionId?: string;
279
280
  videoId?: string;
281
+ tags?: string[];
280
282
  context?: AIContextMessage[];
281
283
  }
282
284
  /**
@@ -290,6 +292,7 @@ interface ChatOptions {
290
292
  prompt: string;
291
293
  stream?: boolean;
292
294
  conversationId?: string;
295
+ currentTime?: number;
293
296
  }
294
297
  /**
295
298
  * A recommended video with relevance score
@@ -299,7 +302,7 @@ interface RecommendationVideo {
299
302
  title: string;
300
303
  playback_id: string;
301
304
  relevance: number;
302
- why: string;
305
+ reason: string;
303
306
  }
304
307
  /**
305
308
  * A topic recommendation with its videos
@@ -325,7 +328,7 @@ interface RecommendOptions {
325
328
  limit?: number;
326
329
  collectionId?: string;
327
330
  tags?: string[];
328
- synthesize?: boolean;
331
+ includeGuidance?: boolean;
329
332
  context?: string;
330
333
  }
331
334
  /**
package/dist/index.js CHANGED
@@ -268,6 +268,8 @@ function createAI(config) {
268
268
  const body = { prompt: options.prompt };
269
269
  if (options.collectionId)
270
270
  body.collection_id = options.collectionId;
271
+ if (options.tags)
272
+ body.tags = options.tags;
271
273
  if (options.stream === false) {
272
274
  body.stream = false;
273
275
  return jsonRequest(path, body, config);
@@ -286,6 +288,8 @@ function createAI(config) {
286
288
  body.collection_id = options.collectionId;
287
289
  if (options.videoId)
288
290
  body.video_id = options.videoId;
291
+ if (options.tags)
292
+ body.tags = options.tags;
289
293
  if (options.context)
290
294
  body.context = options.context;
291
295
  if (options.stream === false) {
@@ -297,6 +301,8 @@ function createAI(config) {
297
301
  async function chat(videoId, options) {
298
302
  const path = options.conversationId ? `ai/videos/${videoId}/chat/${options.conversationId}` : `ai/videos/${videoId}/chat`;
299
303
  const body = { prompt: options.prompt };
304
+ if (options.currentTime !== void 0)
305
+ body.current_time = options.currentTime;
300
306
  if (options.stream === false) {
301
307
  body.stream = false;
302
308
  return jsonRequest(path, body, config);
@@ -312,8 +318,8 @@ function createAI(config) {
312
318
  body.collection_id = options.collectionId;
313
319
  if (options.tags)
314
320
  body.tags = options.tags;
315
- if (options.synthesize !== void 0)
316
- body.synthesize = options.synthesize;
321
+ if (options.includeGuidance !== void 0)
322
+ body.include_guidance = options.includeGuidance;
317
323
  if (options.context)
318
324
  body.context = options.context;
319
325
  if (options.stream === false) {
package/llms.txt CHANGED
@@ -65,7 +65,7 @@ All AI methods return `AsyncIterable<AIEvent>` (streaming) or `Promise<AIRespons
65
65
  limit?: number; // Max videos per topic (default: 5, max: 20)
66
66
  collectionId?: string; // Filter to collection
67
67
  tags?: string[]; // Filter by tags
68
- synthesize?: boolean; // Include AI guidance (default: true)
68
+ includeGuidance?: boolean; // Include AI learning path narrative (default: true)
69
69
  context?: string; // User context for personalization
70
70
  }
71
71
  ```
@@ -78,6 +78,7 @@ All AI methods return `AsyncIterable<AIEvent>` (streaming) or `Promise<AIRespons
78
78
  stream?: boolean; // Default: true
79
79
  conversationId?: string; // Continue existing conversation
80
80
  collectionId?: string; // Filter to collection
81
+ tags?: string[]; // Filter by tags
81
82
  }
82
83
  ```
83
84
 
@@ -90,6 +91,7 @@ All AI methods return `AsyncIterable<AIEvent>` (streaming) or `Promise<AIRespons
90
91
  limit?: number; // Max results
91
92
  collectionId?: string; // Filter to collection
92
93
  videoId?: string; // Search within specific video
94
+ tags?: string[]; // Filter by tags
93
95
  context?: AIContextMessage[]; // Conversation context
94
96
  }
95
97
  ```
@@ -101,6 +103,7 @@ All AI methods return `AsyncIterable<AIEvent>` (streaming) or `Promise<AIRespons
101
103
  prompt: string; // Question about the video (required)
102
104
  stream?: boolean; // Default: true
103
105
  conversationId?: string; // Continue existing conversation
106
+ currentTime?: number; // Current playback position in seconds
104
107
  }
105
108
  ```
106
109
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",