@builder.io/ai-utils 0.0.39 → 0.0.41
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 +5 -3
- package/dist/events.d.ts +8 -4
- package/dist/messages.d.ts +3 -25
- package/dist/settings.d.ts +0 -9
- package/package.json +2 -2
package/dist/completion.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
|
|
2
|
-
import type { Message, MessageParam
|
|
2
|
+
import type { Message, MessageParam } from "./messages";
|
|
3
3
|
import type { BuilderModel } from "./events";
|
|
4
4
|
export type BuilderContentData = BuilderContent["data"];
|
|
5
5
|
export type { BuilderContent, BuilderElement, Component };
|
|
@@ -113,6 +113,10 @@ export interface BuilderEditorState {
|
|
|
113
113
|
* Custom instructions that could be add into the prompt.
|
|
114
114
|
*/
|
|
115
115
|
customInstructions?: Record<string, string>;
|
|
116
|
+
/**
|
|
117
|
+
* All targeting attributes of the content.
|
|
118
|
+
*/
|
|
119
|
+
allTargetingAttributes?: Record<string, any>;
|
|
116
120
|
}
|
|
117
121
|
/**
|
|
118
122
|
* @deprecated Uggh, spelling is hard. Use `BuilderEditorState` instead.
|
|
@@ -120,6 +124,4 @@ export interface BuilderEditorState {
|
|
|
120
124
|
export type BuiderEditorState = BuilderEditorState;
|
|
121
125
|
export type OnPromptSubmit = (opts: {
|
|
122
126
|
prompt?: string;
|
|
123
|
-
snippetId?: string;
|
|
124
|
-
snippetParams?: SnippetParams;
|
|
125
127
|
}) => void;
|
package/dist/events.d.ts
CHANGED
|
@@ -26,9 +26,11 @@ export interface AppMessagesGenerationEvent {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* idle
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* idle: no messages are being generated or queued to be generated
|
|
30
|
+
*
|
|
31
|
+
* queued: messages have been sent to the LLM, but no response has been received yet
|
|
32
|
+
*
|
|
33
|
+
* generating: messages are actively being generated and streaming back to the UI
|
|
32
34
|
*/
|
|
33
35
|
export type GenerationState = "idle" | "queued" | "generating";
|
|
34
36
|
export interface AppPromptAbortEvent {
|
|
@@ -105,8 +107,9 @@ export interface NodeData {
|
|
|
105
107
|
*/
|
|
106
108
|
columnIndex?: number;
|
|
107
109
|
}
|
|
108
|
-
|
|
110
|
+
interface ContentPatchBase {
|
|
109
111
|
id: string;
|
|
112
|
+
description?: string;
|
|
110
113
|
index: number;
|
|
111
114
|
value: string;
|
|
112
115
|
ts: number;
|
|
@@ -324,3 +327,4 @@ export interface ThreadRunStepCreatedEvent {
|
|
|
324
327
|
export type DeepPartial<T> = T extends object ? {
|
|
325
328
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
326
329
|
} : T;
|
|
330
|
+
export {};
|
package/dist/messages.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContentUpdatePatch } from "./events";
|
|
2
2
|
/**
|
|
3
3
|
* Message param does not know the id of the message.
|
|
4
4
|
* This is an input message.
|
|
@@ -25,21 +25,7 @@ export interface UserMessageParam {
|
|
|
25
25
|
*/
|
|
26
26
|
role: "user";
|
|
27
27
|
id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Predefined snippets that the user can select from.
|
|
30
|
-
* We still need the content to be set so the message they read
|
|
31
|
-
* is added to the conversation, however, the assistant will
|
|
32
|
-
* ignore the content and use the snippet to know what to do instead.
|
|
33
|
-
*/
|
|
34
|
-
snippetId?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Extra parameters to pass to the assistant when the snippet is used.
|
|
37
|
-
* For example, a predefined snippet to translate content needs to know
|
|
38
|
-
* what language to translate to.
|
|
39
|
-
*/
|
|
40
|
-
snippetParams?: SnippetParams;
|
|
41
28
|
}
|
|
42
|
-
export type SnippetParams = Record<string, any>;
|
|
43
29
|
export interface AssistantMessageParam {
|
|
44
30
|
/**
|
|
45
31
|
* The contents of the assistant message.
|
|
@@ -65,13 +51,7 @@ export interface AssistantMessageParam {
|
|
|
65
51
|
* A summary of the patches which the assistant has made.
|
|
66
52
|
* Useful for genai.
|
|
67
53
|
*/
|
|
68
|
-
patches?:
|
|
69
|
-
}
|
|
70
|
-
export interface AssistantPatch {
|
|
71
|
-
index: ContentPatchBase['index'];
|
|
72
|
-
value: ContentPatchBase['value'];
|
|
73
|
-
incomplete?: ContentPatchBase['incomplete'];
|
|
74
|
-
type: ContentUpdatePatch['type'];
|
|
54
|
+
patches?: ContentUpdatePatch[];
|
|
75
55
|
}
|
|
76
56
|
export interface SystemMessage extends SystemMessageParam {
|
|
77
57
|
id: string;
|
|
@@ -95,6 +75,4 @@ export interface AssistantActionMessage {
|
|
|
95
75
|
* and is the output message.
|
|
96
76
|
*/
|
|
97
77
|
export type Message = SystemMessage | UserMessage | AssistantMessage;
|
|
98
|
-
export type GeneratingMessage = null |
|
|
99
|
-
generating?: boolean;
|
|
100
|
-
});
|
|
78
|
+
export type GeneratingMessage = null | Partial<AssistantActionMessage | AssistantMessage>;
|
package/dist/settings.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SnippetParams } from "./messages";
|
|
2
1
|
export interface AssistantSettings {
|
|
3
2
|
assistantType?: string;
|
|
4
3
|
viewId?: string;
|
|
@@ -39,14 +38,6 @@ export interface Snippet {
|
|
|
39
38
|
* This prompt is also what's added to the chat conversation from the user.
|
|
40
39
|
*/
|
|
41
40
|
prompt?: string;
|
|
42
|
-
/**
|
|
43
|
-
* The ID of the snippet that will be sent to the assistant when the user clicks the chat snippet button.
|
|
44
|
-
*/
|
|
45
|
-
snippetId?: string;
|
|
46
|
-
/**
|
|
47
|
-
* The parameters that will be sent to the assistant when the user clicks the chat snippet button.
|
|
48
|
-
*/
|
|
49
|
-
snippetParams?: SnippetParams;
|
|
50
41
|
}
|
|
51
42
|
interface IframeSettings extends Partial<AssistantSettings> {
|
|
52
43
|
local?: boolean;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/ai-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"description": "Builder.io AI utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.
|
|
7
|
+
"types": "dist/index.d.tss",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|