@builder.io/ai-utils 0.0.10 → 0.0.11

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.
@@ -24,7 +24,21 @@ export interface UserMessageParam {
24
24
  */
25
25
  role: "user";
26
26
  id?: string;
27
+ /**
28
+ * Predefined snippets that the user can select from.
29
+ * We still need the content to be set so the message they read
30
+ * is added to the conversation, however, the assistant will
31
+ * ignore the content and use the snippet to know what to do instead.
32
+ */
33
+ snippetId?: string;
34
+ /**
35
+ * Extra parameters to pass to the assistant when the snippet is used.
36
+ * For example, a predefined snippet to translate content needs to know
37
+ * what language to translate to.
38
+ */
39
+ snippetParams?: SnippetParams;
27
40
  }
41
+ export type SnippetParams = Record<string, any>;
28
42
  export interface AssistantMessageParam {
29
43
  /**
30
44
  * The contents of the assistant message.
@@ -1,3 +1,4 @@
1
+ import type { SnippetParams } from "./messages";
1
2
  export interface AssistantSettings {
2
3
  assistantType?: string;
3
4
  requestState?: boolean;
@@ -13,6 +14,8 @@ export interface AssistantSettings {
13
14
  prompt: string;
14
15
  icon: any;
15
16
  iconColor?: string;
17
+ snippetId?: string;
18
+ snippetParams?: SnippetParams;
16
19
  }[];
17
20
  }
18
21
  export declare function getAssistantUrl(opts?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",