@botonic/core 0.40.0-alpha.0 → 0.40.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.
@@ -1,6 +1,11 @@
1
1
  export interface BaseMessage {
2
2
  type: 'text' | 'textWithButtons' | 'carousel' | 'exit';
3
3
  }
4
+ export interface Button {
5
+ text: string;
6
+ payload?: string;
7
+ url?: string;
8
+ }
4
9
  export interface TextMessage extends BaseMessage {
5
10
  type: 'text';
6
11
  content: {
@@ -11,17 +16,14 @@ export interface TextWithButtonsMessage extends BaseMessage {
11
16
  type: 'textWithButtons';
12
17
  content: {
13
18
  text: string;
14
- buttons: string[];
19
+ buttons: Button[];
15
20
  };
16
21
  }
17
22
  interface CarouselElement {
18
23
  title: string;
19
24
  subtitle: string;
20
25
  image: string;
21
- button: {
22
- text: string;
23
- url: string;
24
- };
26
+ button: Button;
25
27
  }
26
28
  export interface CarouselMessage extends BaseMessage {
27
29
  type: 'carousel';
@@ -44,4 +46,17 @@ export interface RunResult {
44
46
  outputGuardrailsTriggered: string[];
45
47
  }
46
48
  export type InferenceResponse = RunResult;
49
+ export interface GuardrailRule {
50
+ name: string;
51
+ description: string;
52
+ }
53
+ export interface AiAgentArgs {
54
+ name: string;
55
+ instructions: string;
56
+ activeTools?: {
57
+ name: string;
58
+ }[];
59
+ inputGuardrailRules?: GuardrailRule[];
60
+ sourceIds?: string[];
61
+ }
47
62
  export {};
@@ -1,6 +1,11 @@
1
1
  export interface BaseMessage {
2
2
  type: 'text' | 'textWithButtons' | 'carousel' | 'exit';
3
3
  }
4
+ export interface Button {
5
+ text: string;
6
+ payload?: string;
7
+ url?: string;
8
+ }
4
9
  export interface TextMessage extends BaseMessage {
5
10
  type: 'text';
6
11
  content: {
@@ -11,17 +16,14 @@ export interface TextWithButtonsMessage extends BaseMessage {
11
16
  type: 'textWithButtons';
12
17
  content: {
13
18
  text: string;
14
- buttons: string[];
19
+ buttons: Button[];
15
20
  };
16
21
  }
17
22
  interface CarouselElement {
18
23
  title: string;
19
24
  subtitle: string;
20
25
  image: string;
21
- button: {
22
- text: string;
23
- url: string;
24
- };
26
+ button: Button;
25
27
  }
26
28
  export interface CarouselMessage extends BaseMessage {
27
29
  type: 'carousel';
@@ -44,4 +46,17 @@ export interface RunResult {
44
46
  outputGuardrailsTriggered: string[];
45
47
  }
46
48
  export type InferenceResponse = RunResult;
49
+ export interface GuardrailRule {
50
+ name: string;
51
+ description: string;
52
+ }
53
+ export interface AiAgentArgs {
54
+ name: string;
55
+ instructions: string;
56
+ activeTools?: {
57
+ name: string;
58
+ }[];
59
+ inputGuardrailRules?: GuardrailRule[];
60
+ sourceIds?: string[];
61
+ }
47
62
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/core",
3
- "version": "0.40.0-alpha.0",
3
+ "version": "0.40.0",
4
4
  "license": "MIT",
5
5
  "description": "Build Chatbots using React",
6
6
  "main": "./lib/cjs/index.js",
@@ -34,8 +34,7 @@
34
34
  "decode": "^0.3.0",
35
35
  "pako": "^2.1.0",
36
36
  "process": "^0.11.10",
37
- "pusher-js": "^5.1.1",
38
- "ulid": "^2.3.0"
37
+ "pusher-js": "^5.1.1"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@types/minipass": "^3.3.5",
@@ -2,6 +2,12 @@ export interface BaseMessage {
2
2
  type: 'text' | 'textWithButtons' | 'carousel' | 'exit'
3
3
  }
4
4
 
5
+ export interface Button {
6
+ text: string
7
+ payload?: string
8
+ url?: string
9
+ }
10
+
5
11
  export interface TextMessage extends BaseMessage {
6
12
  type: 'text'
7
13
  content: {
@@ -13,7 +19,7 @@ export interface TextWithButtonsMessage extends BaseMessage {
13
19
  type: 'textWithButtons'
14
20
  content: {
15
21
  text: string
16
- buttons: string[]
22
+ buttons: Button[]
17
23
  }
18
24
  }
19
25
 
@@ -21,7 +27,7 @@ interface CarouselElement {
21
27
  title: string
22
28
  subtitle: string
23
29
  image: string
24
- button: { text: string; url: string }
30
+ button: Button
25
31
  }
26
32
 
27
33
  export interface CarouselMessage extends BaseMessage {
@@ -54,3 +60,15 @@ export interface RunResult {
54
60
  }
55
61
 
56
62
  export type InferenceResponse = RunResult
63
+
64
+ export interface GuardrailRule {
65
+ name: string
66
+ description: string
67
+ }
68
+ export interface AiAgentArgs {
69
+ name: string
70
+ instructions: string
71
+ activeTools?: { name: string }[]
72
+ inputGuardrailRules?: GuardrailRule[]
73
+ sourceIds?: string[]
74
+ }