@examplary/ui 1.52.0 → 1.53.1
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.
|
@@ -37,8 +37,8 @@ export var ChatView = function (_a) {
|
|
|
37
37
|
}, [botAvatar]);
|
|
38
38
|
return (_jsxs("div", __assign({ className: cn("flex flex-col gap-3 items-start", className) }, props, { children: [messages
|
|
39
39
|
.filter(function (_a) {
|
|
40
|
-
var role = _a.role;
|
|
41
|
-
return role !== "system";
|
|
40
|
+
var role = _a.role, hidden = _a.hidden;
|
|
41
|
+
return role !== "system" && !hidden;
|
|
42
42
|
})
|
|
43
43
|
.map(function (item, index) { return (_jsxs(Fragment, { children: [_jsxs("div", { className: "flex gap-3 w-full", children: [item.role === "assistant" && assistantIcon, _jsxs("div", { className: cn("text-sm flex gap-1 group", "max-w-[85%] border rounded-3xl px-4 py-3", "animate-in slide-in-from-top", item.role === "user" &&
|
|
44
44
|
"bg-white border-border ml-auto rounded-tr-sm", item.role !== "user" &&
|
|
@@ -5,12 +5,25 @@ type Answer = {
|
|
|
5
5
|
completed?: boolean;
|
|
6
6
|
context?: any;
|
|
7
7
|
};
|
|
8
|
+
type AIMessage = {
|
|
9
|
+
role: "user" | "assistant" | "system";
|
|
10
|
+
content: string;
|
|
11
|
+
} & Record<string, any>;
|
|
12
|
+
type AIGenerateInput = {
|
|
13
|
+
/** The messages to send to the AI model */
|
|
14
|
+
messages: AIMessage[];
|
|
15
|
+
/** An optional JSON schema to validate the AI response against */
|
|
16
|
+
schema?: any;
|
|
17
|
+
};
|
|
8
18
|
type OrgApiInstance = AxiosInstance & {
|
|
9
19
|
uploadFile: (accept?: string) => Promise<any>;
|
|
10
20
|
uploadPickedFile: (file: File) => Promise<any>;
|
|
11
21
|
};
|
|
12
22
|
type PublicApiInstance = AxiosInstance & {
|
|
13
23
|
uploadFile: (accept?: string) => Promise<any>;
|
|
24
|
+
ai: {
|
|
25
|
+
generate: (input: AIGenerateInput) => Promise<any>;
|
|
26
|
+
};
|
|
14
27
|
};
|
|
15
28
|
export type FrontendComponentEnvironment = "exam" | "practice-space";
|
|
16
29
|
export type FrontendBaseComponentProps = {
|