@botonic/plugin-ai-agents 0.46.1 → 2.23.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.
Files changed (182) hide show
  1. package/CHANGELOG.md +209 -0
  2. package/package.json +23 -41
  3. package/src/index.d.ts +2 -0
  4. package/src/index.js +3 -0
  5. package/src/index.js.map +1 -0
  6. package/{lib/cjs → src/lib}/agent-builder.d.ts +5 -13
  7. package/{lib/cjs → src/lib}/agent-builder.js +31 -26
  8. package/src/lib/agent-builder.js.map +1 -0
  9. package/{lib/cjs → src/lib}/constants.d.ts +1 -3
  10. package/src/lib/constants.js +13 -0
  11. package/src/lib/constants.js.map +1 -0
  12. package/{lib/esm → src/lib}/debug-logger.d.ts +3 -5
  13. package/{lib/esm → src/lib}/debug-logger.js +44 -29
  14. package/src/lib/debug-logger.js.map +1 -0
  15. package/src/lib/guardrails/index.js +2 -0
  16. package/src/lib/guardrails/index.js.map +1 -0
  17. package/src/lib/guardrails/input.d.ts +3 -0
  18. package/src/lib/guardrails/input.js +29 -0
  19. package/src/lib/guardrails/input.js.map +1 -0
  20. package/{lib/cjs/services → src/lib}/hubtype-api-client.d.ts +13 -5
  21. package/src/lib/hubtype-api-client.js +206 -0
  22. package/src/lib/hubtype-api-client.js.map +1 -0
  23. package/{lib/esm → src/lib}/index.d.ts +2 -7
  24. package/src/lib/index.js +111 -0
  25. package/src/lib/index.js.map +1 -0
  26. package/src/lib/openai.d.ts +1 -0
  27. package/src/lib/openai.js +21 -0
  28. package/src/lib/openai.js.map +1 -0
  29. package/src/lib/runner.d.ts +12 -0
  30. package/src/lib/runner.js +96 -0
  31. package/src/lib/runner.js.map +1 -0
  32. package/{lib/esm → src/lib}/structured-output/carousel.d.ts +1 -1
  33. package/src/lib/structured-output/carousel.js +19 -0
  34. package/src/lib/structured-output/carousel.js.map +1 -0
  35. package/{lib/cjs → src/lib}/structured-output/exit.d.ts +1 -1
  36. package/src/lib/structured-output/exit.js +7 -0
  37. package/src/lib/structured-output/exit.js.map +1 -0
  38. package/src/lib/structured-output/index.d.ts +228 -0
  39. package/src/lib/structured-output/index.js +11 -0
  40. package/src/lib/structured-output/index.js.map +1 -0
  41. package/{lib/esm/structured-output/bot-executor.d.ts → src/lib/structured-output/text-with-buttons.d.ts} +13 -13
  42. package/src/lib/structured-output/text-with-buttons.js +14 -0
  43. package/src/lib/structured-output/text-with-buttons.js.map +1 -0
  44. package/{lib/esm → src/lib}/structured-output/text.d.ts +1 -1
  45. package/src/lib/structured-output/text.js +10 -0
  46. package/src/lib/structured-output/text.js.map +1 -0
  47. package/{lib/esm → src/lib}/tools/index.d.ts +1 -1
  48. package/src/lib/tools/index.js +3 -0
  49. package/src/lib/tools/index.js.map +1 -0
  50. package/{lib/cjs → src/lib}/tools/retrieve-knowledge.d.ts +2 -2
  51. package/src/lib/tools/retrieve-knowledge.js +30 -0
  52. package/src/lib/tools/retrieve-knowledge.js.map +1 -0
  53. package/{lib/esm → src/lib}/types.d.ts +11 -21
  54. package/src/lib/types.js +2 -0
  55. package/src/lib/types.js.map +1 -0
  56. package/README.md +0 -156
  57. package/lib/cjs/agent-builder.js.map +0 -1
  58. package/lib/cjs/bot-config-tools.d.ts +0 -7
  59. package/lib/cjs/bot-config-tools.js +0 -19
  60. package/lib/cjs/bot-config-tools.js.map +0 -1
  61. package/lib/cjs/constants.js +0 -17
  62. package/lib/cjs/constants.js.map +0 -1
  63. package/lib/cjs/debug-logger.d.ts +0 -33
  64. package/lib/cjs/debug-logger.js +0 -97
  65. package/lib/cjs/debug-logger.js.map +0 -1
  66. package/lib/cjs/guardrails/index.js +0 -5
  67. package/lib/cjs/guardrails/index.js.map +0 -1
  68. package/lib/cjs/guardrails/input.d.ts +0 -10
  69. package/lib/cjs/guardrails/input.js +0 -77
  70. package/lib/cjs/guardrails/input.js.map +0 -1
  71. package/lib/cjs/index.d.ts +0 -18
  72. package/lib/cjs/index.js +0 -134
  73. package/lib/cjs/index.js.map +0 -1
  74. package/lib/cjs/llm-config.d.ts +0 -15
  75. package/lib/cjs/llm-config.js +0 -66
  76. package/lib/cjs/llm-config.js.map +0 -1
  77. package/lib/cjs/runner.d.ts +0 -18
  78. package/lib/cjs/runner.js +0 -181
  79. package/lib/cjs/runner.js.map +0 -1
  80. package/lib/cjs/services/hubtype-api-client.js +0 -206
  81. package/lib/cjs/services/hubtype-api-client.js.map +0 -1
  82. package/lib/cjs/services/types.d.ts +0 -85
  83. package/lib/cjs/services/types.js +0 -13
  84. package/lib/cjs/services/types.js.map +0 -1
  85. package/lib/cjs/structured-output/bot-executor.d.ts +0 -49
  86. package/lib/cjs/structured-output/bot-executor.js +0 -18
  87. package/lib/cjs/structured-output/bot-executor.js.map +0 -1
  88. package/lib/cjs/structured-output/carousel.d.ts +0 -90
  89. package/lib/cjs/structured-output/carousel.js +0 -22
  90. package/lib/cjs/structured-output/carousel.js.map +0 -1
  91. package/lib/cjs/structured-output/exit.js +0 -11
  92. package/lib/cjs/structured-output/exit.js.map +0 -1
  93. package/lib/cjs/structured-output/index.d.ts +0 -603
  94. package/lib/cjs/structured-output/index.js +0 -28
  95. package/lib/cjs/structured-output/index.js.map +0 -1
  96. package/lib/cjs/structured-output/text-with-buttons.d.ts +0 -56
  97. package/lib/cjs/structured-output/text-with-buttons.js +0 -24
  98. package/lib/cjs/structured-output/text-with-buttons.js.map +0 -1
  99. package/lib/cjs/structured-output/text.d.ts +0 -23
  100. package/lib/cjs/structured-output/text.js +0 -13
  101. package/lib/cjs/structured-output/text.js.map +0 -1
  102. package/lib/cjs/tools/index.d.ts +0 -3
  103. package/lib/cjs/tools/index.js +0 -7
  104. package/lib/cjs/tools/index.js.map +0 -1
  105. package/lib/cjs/tools/retrieve-knowledge.js +0 -32
  106. package/lib/cjs/tools/retrieve-knowledge.js.map +0 -1
  107. package/lib/cjs/types.d.ts +0 -56
  108. package/lib/cjs/types.js +0 -3
  109. package/lib/cjs/types.js.map +0 -1
  110. package/lib/esm/agent-builder.d.ts +0 -37
  111. package/lib/esm/agent-builder.js +0 -106
  112. package/lib/esm/agent-builder.js.map +0 -1
  113. package/lib/esm/bot-config-tools.d.ts +0 -7
  114. package/lib/esm/bot-config-tools.js +0 -19
  115. package/lib/esm/bot-config-tools.js.map +0 -1
  116. package/lib/esm/constants.d.ts +0 -11
  117. package/lib/esm/constants.js +0 -17
  118. package/lib/esm/constants.js.map +0 -1
  119. package/lib/esm/debug-logger.js.map +0 -1
  120. package/lib/esm/guardrails/index.d.ts +0 -1
  121. package/lib/esm/guardrails/index.js +0 -5
  122. package/lib/esm/guardrails/index.js.map +0 -1
  123. package/lib/esm/guardrails/input.d.ts +0 -10
  124. package/lib/esm/guardrails/input.js +0 -77
  125. package/lib/esm/guardrails/input.js.map +0 -1
  126. package/lib/esm/index.js +0 -134
  127. package/lib/esm/index.js.map +0 -1
  128. package/lib/esm/llm-config.d.ts +0 -15
  129. package/lib/esm/llm-config.js +0 -66
  130. package/lib/esm/llm-config.js.map +0 -1
  131. package/lib/esm/runner.d.ts +0 -18
  132. package/lib/esm/runner.js +0 -181
  133. package/lib/esm/runner.js.map +0 -1
  134. package/lib/esm/services/hubtype-api-client.d.ts +0 -14
  135. package/lib/esm/services/hubtype-api-client.js +0 -206
  136. package/lib/esm/services/hubtype-api-client.js.map +0 -1
  137. package/lib/esm/services/types.d.ts +0 -85
  138. package/lib/esm/services/types.js +0 -13
  139. package/lib/esm/services/types.js.map +0 -1
  140. package/lib/esm/structured-output/bot-executor.js +0 -18
  141. package/lib/esm/structured-output/bot-executor.js.map +0 -1
  142. package/lib/esm/structured-output/carousel.js +0 -22
  143. package/lib/esm/structured-output/carousel.js.map +0 -1
  144. package/lib/esm/structured-output/exit.d.ts +0 -10
  145. package/lib/esm/structured-output/exit.js +0 -11
  146. package/lib/esm/structured-output/exit.js.map +0 -1
  147. package/lib/esm/structured-output/index.d.ts +0 -603
  148. package/lib/esm/structured-output/index.js +0 -28
  149. package/lib/esm/structured-output/index.js.map +0 -1
  150. package/lib/esm/structured-output/text-with-buttons.d.ts +0 -56
  151. package/lib/esm/structured-output/text-with-buttons.js +0 -24
  152. package/lib/esm/structured-output/text-with-buttons.js.map +0 -1
  153. package/lib/esm/structured-output/text.js +0 -13
  154. package/lib/esm/structured-output/text.js.map +0 -1
  155. package/lib/esm/tools/index.js +0 -7
  156. package/lib/esm/tools/index.js.map +0 -1
  157. package/lib/esm/tools/retrieve-knowledge.d.ts +0 -9
  158. package/lib/esm/tools/retrieve-knowledge.js +0 -32
  159. package/lib/esm/tools/retrieve-knowledge.js.map +0 -1
  160. package/lib/esm/types.js +0 -3
  161. package/lib/esm/types.js.map +0 -1
  162. package/src/agent-builder.ts +0 -183
  163. package/src/bot-config-tools.ts +0 -21
  164. package/src/constants.ts +0 -21
  165. package/src/debug-logger.ts +0 -166
  166. package/src/guardrails/index.ts +0 -1
  167. package/src/guardrails/input.ts +0 -122
  168. package/src/index.ts +0 -210
  169. package/src/llm-config.ts +0 -96
  170. package/src/runner.ts +0 -287
  171. package/src/services/hubtype-api-client.ts +0 -240
  172. package/src/services/types.ts +0 -106
  173. package/src/structured-output/bot-executor.ts +0 -21
  174. package/src/structured-output/carousel.ts +0 -24
  175. package/src/structured-output/exit.ts +0 -12
  176. package/src/structured-output/index.ts +0 -34
  177. package/src/structured-output/text-with-buttons.ts +0 -29
  178. package/src/structured-output/text.ts +0 -13
  179. package/src/tools/index.ts +0 -5
  180. package/src/tools/retrieve-knowledge.ts +0 -37
  181. package/src/types.ts +0 -110
  182. /package/{lib/cjs → src/lib}/guardrails/index.d.ts +0 -0
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CarouselSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.CarouselSchema = zod_1.z
6
- .object({
7
- type: zod_1.z.enum(['carousel']),
8
- content: zod_1.z.object({
9
- text: zod_1.z.string().nullable().optional(),
10
- elements: zod_1.z.array(zod_1.z.object({
11
- title: zod_1.z.string(),
12
- subtitle: zod_1.z.string(),
13
- image: zod_1.z.string(),
14
- button: zod_1.z.object({
15
- text: zod_1.z.string(),
16
- url: zod_1.z.string().nullable().optional(),
17
- }),
18
- })),
19
- }),
20
- })
21
- .describe('A carousel message containing a list of elements');
22
- //# sourceMappingURL=carousel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/structured-output/carousel.ts"],"names":[],"mappings":";;;AACA,6BAAuB;AAIV,QAAA,cAAc,GAAG,OAAC;KAC5B,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QACtC,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,MAAM,CAAC;YACP,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;YACjB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;YACjB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;gBAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;aACtC,CAAC;SACH,CAAC,CACH;KACF,CAAC;CACH,CAAC;KACD,QAAQ,CAAC,kDAAkD,CAAC,CAAA"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExitSchema = void 0;
4
- const tslib_1 = require("tslib");
5
- const zod_1 = tslib_1.__importDefault(require("zod"));
6
- exports.ExitSchema = zod_1.default
7
- .object({
8
- type: zod_1.default.enum(['exit']),
9
- })
10
- .describe('An exit message. This message should only be used to exit the agent due to out of context or the user asking to exit the conversation');
11
- //# sourceMappingURL=exit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exit.js","sourceRoot":"","sources":["../../../src/structured-output/exit.ts"],"names":[],"mappings":";;;;AACA,sDAAmB;AAIN,QAAA,UAAU,GAAG,aAAC;KACxB,MAAM,CAAC;IACN,IAAI,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC;KACD,QAAQ,CACP,uIAAuI,CACxI,CAAA"}
@@ -1,603 +0,0 @@
1
- import type { OutputMessage } from '@botonic/core';
2
- import { z } from 'zod';
3
- export interface Output {
4
- messages: OutputMessage[];
5
- }
6
- export declare const OutputSchema: z.ZodObject<{
7
- messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
8
- type: z.ZodEnum<["text"]>;
9
- content: z.ZodObject<{
10
- text: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- text: string;
13
- }, {
14
- text: string;
15
- }>;
16
- }, "strip", z.ZodTypeAny, {
17
- type: "text";
18
- content: {
19
- text: string;
20
- };
21
- }, {
22
- type: "text";
23
- content: {
24
- text: string;
25
- };
26
- }>, z.ZodObject<{
27
- type: z.ZodEnum<["textWithButtons"]>;
28
- content: z.ZodObject<{
29
- text: z.ZodString;
30
- buttons: z.ZodArray<z.ZodObject<{
31
- text: z.ZodString;
32
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- target: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodEnum<["_blank", "_self"]>>>>;
34
- }, "strip", z.ZodTypeAny, {
35
- text: string;
36
- url?: string | null | undefined;
37
- target?: "_blank" | "_self" | null | undefined;
38
- }, {
39
- text: string;
40
- url?: string | null | undefined;
41
- target?: "_blank" | "_self" | null | undefined;
42
- }>, "many">;
43
- }, "strip", z.ZodTypeAny, {
44
- text: string;
45
- buttons: {
46
- text: string;
47
- url?: string | null | undefined;
48
- target?: "_blank" | "_self" | null | undefined;
49
- }[];
50
- }, {
51
- text: string;
52
- buttons: {
53
- text: string;
54
- url?: string | null | undefined;
55
- target?: "_blank" | "_self" | null | undefined;
56
- }[];
57
- }>;
58
- }, "strip", z.ZodTypeAny, {
59
- type: "textWithButtons";
60
- content: {
61
- text: string;
62
- buttons: {
63
- text: string;
64
- url?: string | null | undefined;
65
- target?: "_blank" | "_self" | null | undefined;
66
- }[];
67
- };
68
- }, {
69
- type: "textWithButtons";
70
- content: {
71
- text: string;
72
- buttons: {
73
- text: string;
74
- url?: string | null | undefined;
75
- target?: "_blank" | "_self" | null | undefined;
76
- }[];
77
- };
78
- }>, z.ZodObject<{
79
- type: z.ZodEnum<["carousel"]>;
80
- content: z.ZodObject<{
81
- text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
- elements: z.ZodArray<z.ZodObject<{
83
- title: z.ZodString;
84
- subtitle: z.ZodString;
85
- image: z.ZodString;
86
- button: z.ZodObject<{
87
- text: z.ZodString;
88
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
- }, "strip", z.ZodTypeAny, {
90
- text: string;
91
- url?: string | null | undefined;
92
- }, {
93
- text: string;
94
- url?: string | null | undefined;
95
- }>;
96
- }, "strip", z.ZodTypeAny, {
97
- title: string;
98
- subtitle: string;
99
- image: string;
100
- button: {
101
- text: string;
102
- url?: string | null | undefined;
103
- };
104
- }, {
105
- title: string;
106
- subtitle: string;
107
- image: string;
108
- button: {
109
- text: string;
110
- url?: string | null | undefined;
111
- };
112
- }>, "many">;
113
- }, "strip", z.ZodTypeAny, {
114
- elements: {
115
- title: string;
116
- subtitle: string;
117
- image: string;
118
- button: {
119
- text: string;
120
- url?: string | null | undefined;
121
- };
122
- }[];
123
- text?: string | null | undefined;
124
- }, {
125
- elements: {
126
- title: string;
127
- subtitle: string;
128
- image: string;
129
- button: {
130
- text: string;
131
- url?: string | null | undefined;
132
- };
133
- }[];
134
- text?: string | null | undefined;
135
- }>;
136
- }, "strip", z.ZodTypeAny, {
137
- type: "carousel";
138
- content: {
139
- elements: {
140
- title: string;
141
- subtitle: string;
142
- image: string;
143
- button: {
144
- text: string;
145
- url?: string | null | undefined;
146
- };
147
- }[];
148
- text?: string | null | undefined;
149
- };
150
- }, {
151
- type: "carousel";
152
- content: {
153
- elements: {
154
- title: string;
155
- subtitle: string;
156
- image: string;
157
- button: {
158
- text: string;
159
- url?: string | null | undefined;
160
- };
161
- }[];
162
- text?: string | null | undefined;
163
- };
164
- }>, z.ZodObject<{
165
- type: z.ZodEnum<["exit"]>;
166
- }, "strip", z.ZodTypeAny, {
167
- type: "exit";
168
- }, {
169
- type: "exit";
170
- }>, z.ZodObject<{
171
- type: z.ZodEnum<["botExecutor"]>;
172
- content: z.ZodObject<{
173
- text: z.ZodString;
174
- buttons: z.ZodArray<z.ZodObject<{
175
- text: z.ZodString;
176
- payload: z.ZodString;
177
- }, "strip", z.ZodTypeAny, {
178
- text: string;
179
- payload: string;
180
- }, {
181
- text: string;
182
- payload: string;
183
- }>, "many">;
184
- }, "strip", z.ZodTypeAny, {
185
- text: string;
186
- buttons: {
187
- text: string;
188
- payload: string;
189
- }[];
190
- }, {
191
- text: string;
192
- buttons: {
193
- text: string;
194
- payload: string;
195
- }[];
196
- }>;
197
- }, "strip", z.ZodTypeAny, {
198
- type: "botExecutor";
199
- content: {
200
- text: string;
201
- buttons: {
202
- text: string;
203
- payload: string;
204
- }[];
205
- };
206
- }, {
207
- type: "botExecutor";
208
- content: {
209
- text: string;
210
- buttons: {
211
- text: string;
212
- payload: string;
213
- }[];
214
- };
215
- }>]>, "many">;
216
- }, "strip", z.ZodTypeAny, {
217
- messages: ({
218
- type: "botExecutor";
219
- content: {
220
- text: string;
221
- buttons: {
222
- text: string;
223
- payload: string;
224
- }[];
225
- };
226
- } | {
227
- type: "carousel";
228
- content: {
229
- elements: {
230
- title: string;
231
- subtitle: string;
232
- image: string;
233
- button: {
234
- text: string;
235
- url?: string | null | undefined;
236
- };
237
- }[];
238
- text?: string | null | undefined;
239
- };
240
- } | {
241
- type: "exit";
242
- } | {
243
- type: "text";
244
- content: {
245
- text: string;
246
- };
247
- } | {
248
- type: "textWithButtons";
249
- content: {
250
- text: string;
251
- buttons: {
252
- text: string;
253
- url?: string | null | undefined;
254
- target?: "_blank" | "_self" | null | undefined;
255
- }[];
256
- };
257
- })[];
258
- }, {
259
- messages: ({
260
- type: "botExecutor";
261
- content: {
262
- text: string;
263
- buttons: {
264
- text: string;
265
- payload: string;
266
- }[];
267
- };
268
- } | {
269
- type: "carousel";
270
- content: {
271
- elements: {
272
- title: string;
273
- subtitle: string;
274
- image: string;
275
- button: {
276
- text: string;
277
- url?: string | null | undefined;
278
- };
279
- }[];
280
- text?: string | null | undefined;
281
- };
282
- } | {
283
- type: "exit";
284
- } | {
285
- type: "text";
286
- content: {
287
- text: string;
288
- };
289
- } | {
290
- type: "textWithButtons";
291
- content: {
292
- text: string;
293
- buttons: {
294
- text: string;
295
- url?: string | null | undefined;
296
- target?: "_blank" | "_self" | null | undefined;
297
- }[];
298
- };
299
- })[];
300
- }>;
301
- export declare function getOutputSchema(externalOutputMessagesSchemas: z.ZodObject<any>[]): z.ZodObject<{
302
- messages: z.ZodArray<z.ZodUnion<[z.ZodObject<{
303
- type: z.ZodEnum<["text"]>;
304
- content: z.ZodObject<{
305
- text: z.ZodString;
306
- }, "strip", z.ZodTypeAny, {
307
- text: string;
308
- }, {
309
- text: string;
310
- }>;
311
- }, "strip", z.ZodTypeAny, {
312
- type: "text";
313
- content: {
314
- text: string;
315
- };
316
- }, {
317
- type: "text";
318
- content: {
319
- text: string;
320
- };
321
- }>, z.ZodObject<{
322
- type: z.ZodEnum<["textWithButtons"]>;
323
- content: z.ZodObject<{
324
- text: z.ZodString;
325
- buttons: z.ZodArray<z.ZodObject<{
326
- text: z.ZodString;
327
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
- target: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodEnum<["_blank", "_self"]>>>>;
329
- }, "strip", z.ZodTypeAny, {
330
- text: string;
331
- url?: string | null | undefined;
332
- target?: "_blank" | "_self" | null | undefined;
333
- }, {
334
- text: string;
335
- url?: string | null | undefined;
336
- target?: "_blank" | "_self" | null | undefined;
337
- }>, "many">;
338
- }, "strip", z.ZodTypeAny, {
339
- text: string;
340
- buttons: {
341
- text: string;
342
- url?: string | null | undefined;
343
- target?: "_blank" | "_self" | null | undefined;
344
- }[];
345
- }, {
346
- text: string;
347
- buttons: {
348
- text: string;
349
- url?: string | null | undefined;
350
- target?: "_blank" | "_self" | null | undefined;
351
- }[];
352
- }>;
353
- }, "strip", z.ZodTypeAny, {
354
- type: "textWithButtons";
355
- content: {
356
- text: string;
357
- buttons: {
358
- text: string;
359
- url?: string | null | undefined;
360
- target?: "_blank" | "_self" | null | undefined;
361
- }[];
362
- };
363
- }, {
364
- type: "textWithButtons";
365
- content: {
366
- text: string;
367
- buttons: {
368
- text: string;
369
- url?: string | null | undefined;
370
- target?: "_blank" | "_self" | null | undefined;
371
- }[];
372
- };
373
- }>, z.ZodObject<{
374
- type: z.ZodEnum<["carousel"]>;
375
- content: z.ZodObject<{
376
- text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
377
- elements: z.ZodArray<z.ZodObject<{
378
- title: z.ZodString;
379
- subtitle: z.ZodString;
380
- image: z.ZodString;
381
- button: z.ZodObject<{
382
- text: z.ZodString;
383
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
- }, "strip", z.ZodTypeAny, {
385
- text: string;
386
- url?: string | null | undefined;
387
- }, {
388
- text: string;
389
- url?: string | null | undefined;
390
- }>;
391
- }, "strip", z.ZodTypeAny, {
392
- title: string;
393
- subtitle: string;
394
- image: string;
395
- button: {
396
- text: string;
397
- url?: string | null | undefined;
398
- };
399
- }, {
400
- title: string;
401
- subtitle: string;
402
- image: string;
403
- button: {
404
- text: string;
405
- url?: string | null | undefined;
406
- };
407
- }>, "many">;
408
- }, "strip", z.ZodTypeAny, {
409
- elements: {
410
- title: string;
411
- subtitle: string;
412
- image: string;
413
- button: {
414
- text: string;
415
- url?: string | null | undefined;
416
- };
417
- }[];
418
- text?: string | null | undefined;
419
- }, {
420
- elements: {
421
- title: string;
422
- subtitle: string;
423
- image: string;
424
- button: {
425
- text: string;
426
- url?: string | null | undefined;
427
- };
428
- }[];
429
- text?: string | null | undefined;
430
- }>;
431
- }, "strip", z.ZodTypeAny, {
432
- type: "carousel";
433
- content: {
434
- elements: {
435
- title: string;
436
- subtitle: string;
437
- image: string;
438
- button: {
439
- text: string;
440
- url?: string | null | undefined;
441
- };
442
- }[];
443
- text?: string | null | undefined;
444
- };
445
- }, {
446
- type: "carousel";
447
- content: {
448
- elements: {
449
- title: string;
450
- subtitle: string;
451
- image: string;
452
- button: {
453
- text: string;
454
- url?: string | null | undefined;
455
- };
456
- }[];
457
- text?: string | null | undefined;
458
- };
459
- }>, z.ZodObject<{
460
- type: z.ZodEnum<["exit"]>;
461
- }, "strip", z.ZodTypeAny, {
462
- type: "exit";
463
- }, {
464
- type: "exit";
465
- }>, z.ZodObject<{
466
- type: z.ZodEnum<["botExecutor"]>;
467
- content: z.ZodObject<{
468
- text: z.ZodString;
469
- buttons: z.ZodArray<z.ZodObject<{
470
- text: z.ZodString;
471
- payload: z.ZodString;
472
- }, "strip", z.ZodTypeAny, {
473
- text: string;
474
- payload: string;
475
- }, {
476
- text: string;
477
- payload: string;
478
- }>, "many">;
479
- }, "strip", z.ZodTypeAny, {
480
- text: string;
481
- buttons: {
482
- text: string;
483
- payload: string;
484
- }[];
485
- }, {
486
- text: string;
487
- buttons: {
488
- text: string;
489
- payload: string;
490
- }[];
491
- }>;
492
- }, "strip", z.ZodTypeAny, {
493
- type: "botExecutor";
494
- content: {
495
- text: string;
496
- buttons: {
497
- text: string;
498
- payload: string;
499
- }[];
500
- };
501
- }, {
502
- type: "botExecutor";
503
- content: {
504
- text: string;
505
- buttons: {
506
- text: string;
507
- payload: string;
508
- }[];
509
- };
510
- }>, ...z.ZodObject<any, z.UnknownKeysParam, z.ZodTypeAny, {
511
- [x: string]: any;
512
- }, {
513
- [x: string]: any;
514
- }>[]]>, "many">;
515
- }, "strip", z.ZodTypeAny, {
516
- messages: ({
517
- type: "botExecutor";
518
- content: {
519
- text: string;
520
- buttons: {
521
- text: string;
522
- payload: string;
523
- }[];
524
- };
525
- } | {
526
- type: "carousel";
527
- content: {
528
- elements: {
529
- title: string;
530
- subtitle: string;
531
- image: string;
532
- button: {
533
- text: string;
534
- url?: string | null | undefined;
535
- };
536
- }[];
537
- text?: string | null | undefined;
538
- };
539
- } | {
540
- type: "exit";
541
- } | {
542
- type: "text";
543
- content: {
544
- text: string;
545
- };
546
- } | {
547
- type: "textWithButtons";
548
- content: {
549
- text: string;
550
- buttons: {
551
- text: string;
552
- url?: string | null | undefined;
553
- target?: "_blank" | "_self" | null | undefined;
554
- }[];
555
- };
556
- } | {
557
- [x: string]: any;
558
- })[];
559
- }, {
560
- messages: ({
561
- type: "botExecutor";
562
- content: {
563
- text: string;
564
- buttons: {
565
- text: string;
566
- payload: string;
567
- }[];
568
- };
569
- } | {
570
- type: "carousel";
571
- content: {
572
- elements: {
573
- title: string;
574
- subtitle: string;
575
- image: string;
576
- button: {
577
- text: string;
578
- url?: string | null | undefined;
579
- };
580
- }[];
581
- text?: string | null | undefined;
582
- };
583
- } | {
584
- type: "exit";
585
- } | {
586
- type: "text";
587
- content: {
588
- text: string;
589
- };
590
- } | {
591
- type: "textWithButtons";
592
- content: {
593
- text: string;
594
- buttons: {
595
- text: string;
596
- url?: string | null | undefined;
597
- target?: "_blank" | "_self" | null | undefined;
598
- }[];
599
- };
600
- } | {
601
- [x: string]: any;
602
- })[];
603
- }>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OutputSchema = void 0;
4
- exports.getOutputSchema = getOutputSchema;
5
- const zod_1 = require("zod");
6
- const bot_executor_1 = require("./bot-executor");
7
- const carousel_1 = require("./carousel");
8
- const exit_1 = require("./exit");
9
- const text_1 = require("./text");
10
- const text_with_buttons_1 = require("./text-with-buttons");
11
- const baseMessageSchemas = [
12
- text_1.TextSchema,
13
- text_with_buttons_1.TextWithButtonsSchema,
14
- carousel_1.CarouselSchema,
15
- exit_1.ExitSchema,
16
- bot_executor_1.BotExecutorSchema,
17
- ];
18
- exports.OutputSchema = zod_1.z
19
- .object({
20
- messages: zod_1.z.array(zod_1.z.union(baseMessageSchemas)),
21
- })
22
- .describe('The messages to be sent to the user');
23
- function getOutputSchema(externalOutputMessagesSchemas) {
24
- return zod_1.z.object({
25
- messages: zod_1.z.array(zod_1.z.union([...baseMessageSchemas, ...externalOutputMessagesSchemas])),
26
- });
27
- }
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structured-output/index.ts"],"names":[],"mappings":";;;AAyBA,0CAQC;AAhCD,6BAAuB;AACvB,iDAAkD;AAClD,yCAA2C;AAC3C,iCAAmC;AACnC,iCAAmC;AACnC,2DAA2D;AAM3D,MAAM,kBAAkB,GAAG;IACzB,iBAAU;IACV,yCAAqB;IACrB,yBAAc;IACd,iBAAU;IACV,gCAAiB;CACT,CAAA;AACG,QAAA,YAAY,GAAG,OAAC;KAC1B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAC/C,CAAC;KACD,QAAQ,CAAC,qCAAqC,CAAC,CAAA;AAElD,SAAgB,eAAe,CAC7B,6BAAiD;IAEjD,OAAO,OAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,KAAK,CAAC,CAAC,GAAG,kBAAkB,EAAE,GAAG,6BAA6B,CAAC,CAAC,CACnE;KACF,CAAC,CAAA;AACJ,CAAC"}