@builder.io/ai-utils 0.0.15 → 0.0.17
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/dist/completion.d.ts +11 -1
- package/dist/events.d.ts +7 -2
- package/dist/settings.d.ts +2 -1
- package/dist/settings.js +1 -0
- package/package.json +1 -1
package/dist/completion.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
|
|
2
|
-
import type { MessageParam } from "./messages";
|
|
2
|
+
import type { MessageParam, SnippetParams } from "./messages";
|
|
3
3
|
import type { BuilderModel } from "./events";
|
|
4
4
|
export type BuilderContentData = BuilderContent["data"];
|
|
5
5
|
export type { BuilderContent, BuilderElement, Component };
|
|
@@ -69,4 +69,14 @@ export interface CompletionOptions {
|
|
|
69
69
|
* Additional console logs
|
|
70
70
|
*/
|
|
71
71
|
debug?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Date.now() timestamp of when the assistant was started.
|
|
74
|
+
* This is used to calculate the time taken between all
|
|
75
|
+
*/
|
|
76
|
+
start: number;
|
|
72
77
|
}
|
|
78
|
+
export type OnPromptSubmit = (opts: {
|
|
79
|
+
prompt?: string;
|
|
80
|
+
snippetId?: string;
|
|
81
|
+
snippetParams?: SnippetParams;
|
|
82
|
+
}) => void;
|
package/dist/events.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
|
|
2
2
|
import type { Thread } from "./thread";
|
|
3
3
|
import type { AssistantMessage } from "./messages";
|
|
4
|
+
import { AssistantSettings } from "./settings";
|
|
4
5
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
5
6
|
export type BuilderAssistantEvent = AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuiderEditorStateEvent | ContentCreateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ContentCompleteEvent | ModelCreateEvent | ModelUpdateEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageCompletedEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent;
|
|
6
7
|
export interface AppCloseEvent {
|
|
@@ -39,9 +40,9 @@ export interface AppReadyEvent {
|
|
|
39
40
|
export interface AppSettingsResetEvent {
|
|
40
41
|
type: "assistant.app.settings.reset";
|
|
41
42
|
}
|
|
42
|
-
export interface AppSettingsSetEvent
|
|
43
|
+
export interface AppSettingsSetEvent {
|
|
43
44
|
type: "assistant.app.settings.set";
|
|
44
|
-
data:
|
|
45
|
+
data: Partial<AssistantSettings>;
|
|
45
46
|
}
|
|
46
47
|
export interface AppThreadNewEvent {
|
|
47
48
|
type: "assistant.app.thread.new";
|
|
@@ -94,16 +95,19 @@ export interface ContentPropsUpdatePatch {
|
|
|
94
95
|
type: "props";
|
|
95
96
|
id: string;
|
|
96
97
|
value: Record<string, any>;
|
|
98
|
+
ts: number;
|
|
97
99
|
}
|
|
98
100
|
export interface ContentStyleUpdatePatch {
|
|
99
101
|
type: "style";
|
|
100
102
|
id: string;
|
|
101
103
|
value: Record<string, any>;
|
|
104
|
+
ts: number;
|
|
102
105
|
}
|
|
103
106
|
export interface ContentTextUpdatePatch {
|
|
104
107
|
type: "content";
|
|
105
108
|
id: string;
|
|
106
109
|
value: string;
|
|
110
|
+
ts: number;
|
|
107
111
|
}
|
|
108
112
|
export interface ContentCompleteEvent {
|
|
109
113
|
type: "assistant.content.complete";
|
|
@@ -112,6 +116,7 @@ export interface ContentCompleteEvent {
|
|
|
112
116
|
export interface ContentComplete {
|
|
113
117
|
threadId: string;
|
|
114
118
|
message: AssistantMessage;
|
|
119
|
+
ts: number;
|
|
115
120
|
}
|
|
116
121
|
export interface ModelCreateEvent {
|
|
117
122
|
type: "assistant.model.create";
|
package/dist/settings.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface AssistantSettings {
|
|
|
10
10
|
showAiCanMakeMistakes?: boolean;
|
|
11
11
|
showCloseButton?: boolean;
|
|
12
12
|
showHeaderButton?: boolean;
|
|
13
|
+
showPrompt?: boolean;
|
|
13
14
|
showSparklesInInputBar?: boolean;
|
|
14
15
|
suggestedItems: Snippet[];
|
|
15
16
|
theme?: "dark" | "light";
|
|
@@ -32,7 +33,7 @@ export interface Snippet {
|
|
|
32
33
|
* The prompt text that will be sent to the assistant when the user clicks the chat snippet button.
|
|
33
34
|
* This prompt is also what's added to the chat conversation from the user.
|
|
34
35
|
*/
|
|
35
|
-
prompt
|
|
36
|
+
prompt?: string;
|
|
36
37
|
/**
|
|
37
38
|
* The ID of the snippet that will be sent to the assistant when the user clicks the chat snippet button.
|
|
38
39
|
*/
|
package/dist/settings.js
CHANGED