llmasaservice-ui 0.1.13 → 0.1.15
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +2 -2
- package/src/ChatPanel.tsx +4 -2
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -68,11 +68,13 @@ var ChatPanel = ({
|
|
|
68
68
|
theme = "light",
|
|
69
69
|
markdownClass = null,
|
|
70
70
|
width = "300px",
|
|
71
|
-
height = "100vh"
|
|
71
|
+
height = "100vh",
|
|
72
|
+
url = null
|
|
72
73
|
}) => {
|
|
73
74
|
const { send, response, idle, stop } = (0, import_llmasaservice_client.useLLM)({
|
|
74
75
|
project_id,
|
|
75
|
-
customer
|
|
76
|
+
customer,
|
|
77
|
+
url
|
|
76
78
|
});
|
|
77
79
|
const [nextPrompt, setNextPrompt] = (0, import_react.useState)("");
|
|
78
80
|
const [lastController, setLastController] = (0, import_react.useState)(new AbortController());
|
|
@@ -141,7 +143,7 @@ var ChatPanel = ({
|
|
|
141
143
|
className: "side-panel" + (theme === "light" ? "" : "-dark")
|
|
142
144
|
},
|
|
143
145
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "title" }, title),
|
|
144
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "responseArea" }, isLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "loading-text" }, "loading...") : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass }, response2), /* @__PURE__ */ import_react.default.createElement("div", { className: "button-container" }, /* @__PURE__ */ import_react.default.createElement(
|
|
146
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "responseArea" }, isLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "loading-text" }, "loading...") : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ import_react.default.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ import_react.default.createElement("div", { className: "response" }, /* @__PURE__ */ import_react.default.createElement(import_react_markdown.default, { className: markdownClass }, response2), /* @__PURE__ */ import_react.default.createElement("div", { ref: bottomRef }), /* @__PURE__ */ import_react.default.createElement("div", { className: "button-container" }, /* @__PURE__ */ import_react.default.createElement(
|
|
145
147
|
"button",
|
|
146
148
|
{
|
|
147
149
|
className: "copy-button",
|
|
@@ -188,7 +190,7 @@ var ChatPanel = ({
|
|
|
188
190
|
className: "icon-svg"
|
|
189
191
|
},
|
|
190
192
|
/* @__PURE__ */ import_react.default.createElement("path", { d: "M18.38 3.25H6.81C5.72 3.25 4.79 4.03 4.6 5.11L3.29 12.61C3.18 13.27 3.36 13.94 3.78 14.45C4.21 14.96 4.83 15.25 5.5 15.25H9.53V18C9.53 19.52 10.76 20.75 12.36 20.75C13.06 20.75 13.69 20.33 13.97 19.68L16.51 13.75H18.39C19.7 13.75 20.76 12.69 20.76 11.38V5.61C20.76 4.31 19.7 3.25 18.39 3.25H18.38ZM15.26 12.85L12.59 19.1C12.55 19.19 12.46 19.26 12.27 19.26C11.58 19.26 11.03 18.7 11.03 18.01V13.76H5.5C5.27 13.76 5.07 13.67 4.93 13.5C4.78 13.33 4.73 13.11 4.77 12.88L6.08 5.38C6.14 5.02 6.45001 4.76 6.82 4.76H15.26V12.85ZM19.25 11.38C19.25 11.86 18.86 12.25 18.38 12.25H16.77V4.75H18.38C18.86 4.75 19.25 5.14 19.25 5.61V11.38Z" })
|
|
191
|
-
)) : null))))
|
|
193
|
+
)) : null))))),
|
|
192
194
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "input-container" }, /* @__PURE__ */ import_react.default.createElement(
|
|
193
195
|
"textarea",
|
|
194
196
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -35,11 +35,13 @@ var ChatPanel = ({
|
|
|
35
35
|
theme = "light",
|
|
36
36
|
markdownClass = null,
|
|
37
37
|
width = "300px",
|
|
38
|
-
height = "100vh"
|
|
38
|
+
height = "100vh",
|
|
39
|
+
url = null
|
|
39
40
|
}) => {
|
|
40
41
|
const { send, response, idle, stop } = useLLM({
|
|
41
42
|
project_id,
|
|
42
|
-
customer
|
|
43
|
+
customer,
|
|
44
|
+
url
|
|
43
45
|
});
|
|
44
46
|
const [nextPrompt, setNextPrompt] = useState("");
|
|
45
47
|
const [lastController, setLastController] = useState(new AbortController());
|
|
@@ -108,7 +110,7 @@ var ChatPanel = ({
|
|
|
108
110
|
className: "side-panel" + (theme === "light" ? "" : "-dark")
|
|
109
111
|
},
|
|
110
112
|
/* @__PURE__ */ React.createElement("div", { className: "title" }, title),
|
|
111
|
-
/* @__PURE__ */ React.createElement("div", { className: "responseArea" }, isLoading ? /* @__PURE__ */ React.createElement("div", { className: "loading-text" }, "loading...") : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ React.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ React.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ React.createElement("div", { className: "response" }, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass }, response2), /* @__PURE__ */ React.createElement("div", { className: "button-container" }, /* @__PURE__ */ React.createElement(
|
|
113
|
+
/* @__PURE__ */ React.createElement("div", { className: "responseArea" }, isLoading ? /* @__PURE__ */ React.createElement("div", { className: "loading-text" }, "loading...") : null, Object.entries(history).map(([prompt, response2], index) => /* @__PURE__ */ React.createElement("div", { className: "history-entry", key: index }, hideInitialPrompt && index === 0 ? null : /* @__PURE__ */ React.createElement("div", { className: "prompt" }, prompt), /* @__PURE__ */ React.createElement("div", { className: "response" }, /* @__PURE__ */ React.createElement(ReactMarkdown, { className: markdownClass }, response2), /* @__PURE__ */ React.createElement("div", { ref: bottomRef }), /* @__PURE__ */ React.createElement("div", { className: "button-container" }, /* @__PURE__ */ React.createElement(
|
|
112
114
|
"button",
|
|
113
115
|
{
|
|
114
116
|
className: "copy-button",
|
|
@@ -155,7 +157,7 @@ var ChatPanel = ({
|
|
|
155
157
|
className: "icon-svg"
|
|
156
158
|
},
|
|
157
159
|
/* @__PURE__ */ React.createElement("path", { d: "M18.38 3.25H6.81C5.72 3.25 4.79 4.03 4.6 5.11L3.29 12.61C3.18 13.27 3.36 13.94 3.78 14.45C4.21 14.96 4.83 15.25 5.5 15.25H9.53V18C9.53 19.52 10.76 20.75 12.36 20.75C13.06 20.75 13.69 20.33 13.97 19.68L16.51 13.75H18.39C19.7 13.75 20.76 12.69 20.76 11.38V5.61C20.76 4.31 19.7 3.25 18.39 3.25H18.38ZM15.26 12.85L12.59 19.1C12.55 19.19 12.46 19.26 12.27 19.26C11.58 19.26 11.03 18.7 11.03 18.01V13.76H5.5C5.27 13.76 5.07 13.67 4.93 13.5C4.78 13.33 4.73 13.11 4.77 12.88L6.08 5.38C6.14 5.02 6.45001 4.76 6.82 4.76H15.26V12.85ZM19.25 11.38C19.25 11.86 18.86 12.25 18.38 12.25H16.77V4.75H18.38C18.86 4.75 19.25 5.14 19.25 5.61V11.38Z" })
|
|
158
|
-
)) : null))))
|
|
160
|
+
)) : null))))),
|
|
159
161
|
/* @__PURE__ */ React.createElement("div", { className: "input-container" }, /* @__PURE__ */ React.createElement(
|
|
160
162
|
"textarea",
|
|
161
163
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llmasaservice-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Prebuilt UI components for LLMAsAService.io",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"chat"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"llmasaservice-client": "^0.0
|
|
46
|
+
"llmasaservice-client": "^0.1.0",
|
|
47
47
|
"react-markdown": "^9.0.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
package/src/ChatPanel.tsx
CHANGED
|
@@ -17,6 +17,7 @@ export interface ChatPanelProps {
|
|
|
17
17
|
markdownClass?: string;
|
|
18
18
|
width?: string;
|
|
19
19
|
height?: string;
|
|
20
|
+
url?: string | null;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
@@ -33,10 +34,12 @@ const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
|
33
34
|
markdownClass = null,
|
|
34
35
|
width = "300px",
|
|
35
36
|
height = "100vh",
|
|
37
|
+
url = null
|
|
36
38
|
}) => {
|
|
37
39
|
const { send, response, idle, stop } = useLLM({
|
|
38
40
|
project_id: project_id,
|
|
39
41
|
customer: customer,
|
|
42
|
+
url: url
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
const [nextPrompt, setNextPrompt] = useState("");
|
|
@@ -136,6 +139,7 @@ const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
|
136
139
|
<ReactMarkdown className={markdownClass}>
|
|
137
140
|
{response}
|
|
138
141
|
</ReactMarkdown>
|
|
142
|
+
<div ref={bottomRef} />
|
|
139
143
|
<div className="button-container">
|
|
140
144
|
<button
|
|
141
145
|
className="copy-button"
|
|
@@ -190,8 +194,6 @@ const ChatPanel: React.FC<ChatPanelProps> = ({
|
|
|
190
194
|
</div>
|
|
191
195
|
</div>
|
|
192
196
|
))}
|
|
193
|
-
|
|
194
|
-
<div ref={bottomRef} />
|
|
195
197
|
</div>
|
|
196
198
|
|
|
197
199
|
<div className="input-container">
|