llmasaservice-ui 0.7.14 → 0.7.16

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.js CHANGED
@@ -1151,7 +1151,7 @@ var AgentPanel = ({
1151
1151
  const fetchAgentData = () => __async(void 0, null, function* () {
1152
1152
  try {
1153
1153
  const response = yield fetch(
1154
- `https://api.llmasaservice.io/agents/${agent}`,
1154
+ url.endsWith("dev") ? `https://duzyq4e8ql.execute-api.us-east-1.amazonaws.com/dev/agents/${agent}` : `https://api.llmasaservice.io/agents/${agent}`,
1155
1155
  {
1156
1156
  method: "GET",
1157
1157
  headers: {
@@ -1228,7 +1228,8 @@ var AgentPanel = ({
1228
1228
  ragQueryLimit: (_t = agentData == null ? void 0 : agentData.ragQueryLimit) != null ? _t : 10,
1229
1229
  ragRankLimit: (_u = agentData == null ? void 0 : agentData.ragRankLimit) != null ? _u : 5,
1230
1230
  showPoweredBy,
1231
- messages
1231
+ messages,
1232
+ conversation
1232
1233
  }
1233
1234
  ));
1234
1235
  };
package/dist/index.mjs CHANGED
@@ -1117,7 +1117,7 @@ var AgentPanel = ({
1117
1117
  const fetchAgentData = () => __async(void 0, null, function* () {
1118
1118
  try {
1119
1119
  const response = yield fetch(
1120
- `https://api.llmasaservice.io/agents/${agent}`,
1120
+ url.endsWith("dev") ? `https://duzyq4e8ql.execute-api.us-east-1.amazonaws.com/dev/agents/${agent}` : `https://api.llmasaservice.io/agents/${agent}`,
1121
1121
  {
1122
1122
  method: "GET",
1123
1123
  headers: {
@@ -1194,7 +1194,8 @@ var AgentPanel = ({
1194
1194
  ragQueryLimit: (_t = agentData == null ? void 0 : agentData.ragQueryLimit) != null ? _t : 10,
1195
1195
  ragRankLimit: (_u = agentData == null ? void 0 : agentData.ragRankLimit) != null ? _u : 5,
1196
1196
  showPoweredBy,
1197
- messages
1197
+ messages,
1198
+ conversation
1198
1199
  }
1199
1200
  ));
1200
1201
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.7.14",
3
+ "version": "0.7.16",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -28,7 +28,11 @@ export interface AgentPanelProps {
28
28
  historyChangedCallback?: (history: {
29
29
  [key: string]: { content: string; callId: string };
30
30
  }) => void;
31
- responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
31
+ responseCompleteCallback?: (
32
+ callId: string,
33
+ prompt: string,
34
+ response: string
35
+ ) => void;
32
36
  //promptTemplate?: string;
33
37
  actions?: {
34
38
  pattern: string;
@@ -110,7 +114,9 @@ const AgentPanel: React.FC<AgentPanelProps & ExtraProps> = ({
110
114
  const fetchAgentData = async () => {
111
115
  try {
112
116
  const response = await fetch(
113
- `https://api.llmasaservice.io/agents/${agent}`,
117
+ url.endsWith("dev")
118
+ ? `https://duzyq4e8ql.execute-api.us-east-1.amazonaws.com/dev/agents/${agent}`
119
+ : `https://api.llmasaservice.io/agents/${agent}`,
114
120
  {
115
121
  method: "GET",
116
122
  headers: {
@@ -160,7 +166,13 @@ const AgentPanel: React.FC<AgentPanelProps & ExtraProps> = ({
160
166
  service={agentData?.groupId || null}
161
167
  url={url}
162
168
  title={agentData?.displayTitle ?? ""}
163
- theme={theme ? theme : agentData?.displayTheme === "light" ? "light" : "dark"}
169
+ theme={
170
+ theme
171
+ ? theme
172
+ : agentData?.displayTheme === "light"
173
+ ? "light"
174
+ : "dark"
175
+ }
164
176
  cssUrl={agentData?.cssUrl ?? ""}
165
177
  height={height ? height : agentData?.displayHeight ?? "100vh"}
166
178
  width={width ? width : agentData?.displayWidth ?? "100%"}
@@ -223,6 +235,7 @@ const AgentPanel: React.FC<AgentPanelProps & ExtraProps> = ({
223
235
  ragRankLimit={agentData?.ragRankLimit ?? 5}
224
236
  showPoweredBy={showPoweredBy}
225
237
  messages={messages}
238
+ conversation={conversation}
226
239
  />
227
240
  )}
228
241
  </>
package/src/ChatPanel.tsx CHANGED
@@ -197,7 +197,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
197
197
  const matchIndex = groups[groups.length - 2]; // The second-to-last argument is the match index
198
198
  const buttonId = `button-${messages.length}-${index}-${matchIndex}`; // a unique button for the conversation level, action index, match index
199
199
 
200
- let html = match;
200
+ let html = match;
201
201
  if (action.type === "button" || action.type === "callback") {
202
202
  html = ` <button id="${buttonId}" ${
203
203
  action.style ? 'class=" ' + action.style + '"' : ""