@builder.io/ai-utils 0.0.71 → 0.0.73
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/package.json +1 -1
- package/src/completion.d.ts +0 -9
- package/src/events.d.ts +0 -2
- package/src/messages.d.ts +8 -1
- package/src/settings.d.ts +0 -9
- package/src/settings.js +2 -4
package/package.json
CHANGED
package/src/completion.d.ts
CHANGED
|
@@ -68,7 +68,6 @@ export interface CompletionOptions {
|
|
|
68
68
|
* text sent to the LLM. Must be a pre-defined system prompt id!
|
|
69
69
|
*/
|
|
70
70
|
systemPromptIds?: {
|
|
71
|
-
"semantic-tags"?: string;
|
|
72
71
|
"content-edit"?: string;
|
|
73
72
|
};
|
|
74
73
|
/**
|
|
@@ -153,11 +152,3 @@ export interface BuilderEditorState {
|
|
|
153
152
|
*/
|
|
154
153
|
allTargetingAttributes?: Record<string, any>;
|
|
155
154
|
}
|
|
156
|
-
/**
|
|
157
|
-
* @deprecated Uggh, spelling is hard. Use `BuilderEditorState` instead.
|
|
158
|
-
*/
|
|
159
|
-
export type BuiderEditorState = BuilderEditorState;
|
|
160
|
-
export type OnPromptSubmit = (opts: {
|
|
161
|
-
prompt?: string;
|
|
162
|
-
attachments: Attachment[];
|
|
163
|
-
}) => void;
|
package/src/events.d.ts
CHANGED
|
@@ -373,8 +373,6 @@ export interface ThreadMessageCompleted extends AssistantMessage {
|
|
|
373
373
|
platformId: string;
|
|
374
374
|
threadId: string;
|
|
375
375
|
commitId?: string;
|
|
376
|
-
/** @deprecated Remove after ai-assistant is updated */
|
|
377
|
-
message?: AssistantMessage;
|
|
378
376
|
}
|
|
379
377
|
export interface ThreadRunRequiresActionEvent {
|
|
380
378
|
type: "assistant.thread.run.requires_action";
|
package/src/messages.d.ts
CHANGED
|
@@ -115,7 +115,14 @@ export interface AssistantActionMessage {
|
|
|
115
115
|
export type Message = SystemMessage | UserMessage | AssistantMessage;
|
|
116
116
|
export type GeneratingMessage = null | Partial<AssistantActionMessage | AssistantMessage>;
|
|
117
117
|
export declare function getContentText(message: string | ContentMessage): string;
|
|
118
|
-
export type Attachment = Template;
|
|
118
|
+
export type Attachment = FileUpload | Template;
|
|
119
|
+
export interface FileUpload {
|
|
120
|
+
type: string;
|
|
121
|
+
name: string;
|
|
122
|
+
dataUrl: string;
|
|
123
|
+
size: number;
|
|
124
|
+
id: number;
|
|
125
|
+
}
|
|
119
126
|
export interface Template {
|
|
120
127
|
type: "template";
|
|
121
128
|
name: string;
|
package/src/settings.d.ts
CHANGED
|
@@ -2,19 +2,10 @@ export interface AssistantSettings {
|
|
|
2
2
|
assistantType?: string;
|
|
3
3
|
viewId?: string;
|
|
4
4
|
cssOverrides?: string;
|
|
5
|
-
headingText: string;
|
|
6
|
-
headingTitle?: string;
|
|
7
|
-
suggestedPrompts?: SuggestedPrompt[];
|
|
8
5
|
messagePlaceholder: string;
|
|
9
|
-
requestAuth?: boolean;
|
|
10
|
-
requestState?: boolean;
|
|
11
6
|
showPrompt?: boolean;
|
|
12
7
|
theme?: "dark" | "light";
|
|
13
8
|
}
|
|
14
|
-
export interface SuggestedPrompt {
|
|
15
|
-
text: string;
|
|
16
|
-
type: "modify" | "interactivity" | "data";
|
|
17
|
-
}
|
|
18
9
|
interface IframeSettings extends Partial<AssistantSettings> {
|
|
19
10
|
local?: boolean;
|
|
20
11
|
/**
|
package/src/settings.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
const urlParamSettings = [
|
|
2
2
|
"assistantType",
|
|
3
3
|
"showPrompt",
|
|
4
|
-
"requestAuth",
|
|
5
|
-
"requestState",
|
|
6
4
|
"theme",
|
|
7
5
|
"viewId",
|
|
8
6
|
];
|
|
9
7
|
export function getAssistantUrl(opts = {}) {
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
const url = new URL((_a = opts.baseUrl) !== null && _a !== void 0 ? _a : (opts.local ? "http://localhost:7242" : "https://assistant.builder.io"));
|
|
12
10
|
urlParamSettings.forEach((key) => {
|
|
13
11
|
const value = opts[key];
|
|
14
12
|
if (typeof value === "string" || typeof value === "boolean") {
|