@boldvideo/bold-js 1.3.0 → 1.4.0

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,30 @@
1
1
  # @boldvideo/bold-js
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3b65bbf: Add conversation context support to AI Search
8
+
9
+ - Added `context` parameter to `SearchOptions` for passing conversation history
10
+ - Added `context` field to `AIResponse` for receiving updated conversation context
11
+ - Added `AIContextMessage` type for type-safe context messages
12
+ - Updated README with multi-turn conversation example
13
+
14
+ Usage:
15
+
16
+ ```typescript
17
+ const first = await bold.ai.search({
18
+ prompt: "How do designers find clients?",
19
+ stream: false,
20
+ });
21
+ const followUp = await bold.ai.search({
22
+ prompt: "What about cold outreach?",
23
+ context: first.context,
24
+ stream: false,
25
+ });
26
+ ```
27
+
3
28
  ## 1.3.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -54,6 +54,27 @@ const playlists = await bold.playlists.list();
54
54
 
55
55
  ```
56
56
 
57
+ ### AI Search with Conversation Context
58
+
59
+ Use the `context` parameter to enable multi-turn conversations:
60
+
61
+ ```js
62
+ // First question
63
+ const first = await bold.ai.search({
64
+ prompt: "How do indie designers find clients?",
65
+ stream: false
66
+ });
67
+ console.log(first.content);
68
+
69
+ // Follow-up with context from previous response
70
+ const followUp = await bold.ai.search({
71
+ prompt: "What about cold outreach specifically?",
72
+ context: first.context,
73
+ stream: false
74
+ });
75
+ console.log(followUp.content);
76
+ ```
77
+
57
78
  ## Related Links
58
79
 
59
80
  - **[Bold API Documentation](https://docs.boldvideo.io/docs/api)**
package/dist/index.cjs CHANGED
@@ -319,6 +319,8 @@ function createAI(config) {
319
319
  body.collection_id = options.collectionId;
320
320
  if (options.videoId)
321
321
  body.video_id = options.videoId;
322
+ if (options.context)
323
+ body.context = options.context;
322
324
  if (options.stream === false) {
323
325
  body.stream = false;
324
326
  return jsonRequest(path, body, config);
package/dist/index.d.ts CHANGED
@@ -235,6 +235,7 @@ interface AIResponse {
235
235
  sources: Source[];
236
236
  usage: AIUsage;
237
237
  model?: string;
238
+ context?: AIContextMessage[];
238
239
  }
239
240
  /**
240
241
  * Options for bold.ai.ask() and bold.ai.coach()
@@ -245,6 +246,13 @@ interface AskOptions {
245
246
  conversationId?: string;
246
247
  collectionId?: string;
247
248
  }
249
+ /**
250
+ * Conversation message for AI context
251
+ */
252
+ interface AIContextMessage {
253
+ role: 'user' | 'assistant';
254
+ content: string;
255
+ }
248
256
  /**
249
257
  * Options for bold.ai.search()
250
258
  */
@@ -254,6 +262,7 @@ interface SearchOptions {
254
262
  limit?: number;
255
263
  collectionId?: string;
256
264
  videoId?: string;
265
+ context?: AIContextMessage[];
257
266
  }
258
267
  /**
259
268
  * Options for bold.ai.chat()
@@ -380,4 +389,4 @@ declare const DEFAULT_API_BASE_URL = "https://app.boldvideo.io/api/v1/";
380
389
  */
381
390
  declare const DEFAULT_INTERNAL_API_BASE_URL = "https://app.boldvideo.io/i/v1/";
382
391
 
383
- export { AIEvent, AIResponse, AIUsage, Account, AccountAI, AskOptions, AssistantConfig, ChatOptions, ClientOptions, DEFAULT_API_BASE_URL, DEFAULT_INTERNAL_API_BASE_URL, MenuItem, Playlist, Portal, PortalDisplay, PortalLayout, PortalNavigation, PortalTheme, SearchOptions, Settings, Source, ThemeColors, ThemeConfig, Video, VideoAttachment, VideoDownloadUrls, VideoMetadata, VideoSubtitles, VideoTranscript, createClient };
392
+ export { AIContextMessage, AIEvent, AIResponse, AIUsage, Account, AccountAI, AskOptions, AssistantConfig, ChatOptions, ClientOptions, DEFAULT_API_BASE_URL, DEFAULT_INTERNAL_API_BASE_URL, MenuItem, Playlist, Portal, PortalDisplay, PortalLayout, PortalNavigation, PortalTheme, SearchOptions, Settings, Source, ThemeColors, ThemeConfig, Video, VideoAttachment, VideoDownloadUrls, VideoMetadata, VideoSubtitles, VideoTranscript, createClient };
package/dist/index.js CHANGED
@@ -281,6 +281,8 @@ function createAI(config) {
281
281
  body.collection_id = options.collectionId;
282
282
  if (options.videoId)
283
283
  body.video_id = options.videoId;
284
+ if (options.context)
285
+ body.context = options.context;
284
286
  if (options.stream === false) {
285
287
  body.stream = false;
286
288
  return jsonRequest(path, body, config);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",