@boldvideo/bold-js 1.2.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,36 @@
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
+
28
+ ## 1.3.0
29
+
30
+ ### Minor Changes
31
+
32
+ - 57c4de2: Add missing fields to PortalTheme type: `logo_dark_url` for dark mode logos and `css_overrides` for custom CSS injection.
33
+
3
34
  ## 1.2.0
4
35
 
5
36
  ### 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
@@ -93,6 +93,7 @@ type PortalTheme = {
93
93
  font_body: string;
94
94
  font_header: string;
95
95
  logo_url: string;
96
+ logo_dark_url: string;
96
97
  logo_width: number;
97
98
  logo_height: number;
98
99
  header_size: string;
@@ -101,6 +102,7 @@ type PortalTheme = {
101
102
  color_scheme: "toggle" | "light" | "dark";
102
103
  light: ThemeColors;
103
104
  dark: ThemeColors;
105
+ css_overrides: string | null;
104
106
  };
105
107
  type Portal = {
106
108
  color_scheme?: 'toggle' | 'light' | 'dark';
@@ -233,6 +235,7 @@ interface AIResponse {
233
235
  sources: Source[];
234
236
  usage: AIUsage;
235
237
  model?: string;
238
+ context?: AIContextMessage[];
236
239
  }
237
240
  /**
238
241
  * Options for bold.ai.ask() and bold.ai.coach()
@@ -243,6 +246,13 @@ interface AskOptions {
243
246
  conversationId?: string;
244
247
  collectionId?: string;
245
248
  }
249
+ /**
250
+ * Conversation message for AI context
251
+ */
252
+ interface AIContextMessage {
253
+ role: 'user' | 'assistant';
254
+ content: string;
255
+ }
246
256
  /**
247
257
  * Options for bold.ai.search()
248
258
  */
@@ -252,6 +262,7 @@ interface SearchOptions {
252
262
  limit?: number;
253
263
  collectionId?: string;
254
264
  videoId?: string;
265
+ context?: AIContextMessage[];
255
266
  }
256
267
  /**
257
268
  * Options for bold.ai.chat()
@@ -378,4 +389,4 @@ declare const DEFAULT_API_BASE_URL = "https://app.boldvideo.io/api/v1/";
378
389
  */
379
390
  declare const DEFAULT_INTERNAL_API_BASE_URL = "https://app.boldvideo.io/i/v1/";
380
391
 
381
- 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.2.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",