@luxonis/component-lib 1.0.10 → 1.0.11

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
@@ -1324,21 +1324,20 @@ function ChatButton(props) {
1324
1324
  const fetchData = (0, import_react12.useCallback)(
1325
1325
  async (message) => {
1326
1326
  try {
1327
- const response = await fetch(
1328
- slackThreadTs ? `https://chat.luxonis.com/api/chat?slack_thread_ts=${slackThreadTs}` : "https://chat.luxonis.com/api/chat",
1329
- {
1330
- method: "POST",
1331
- headers: {
1332
- "Content-Type": "application/json"
1333
- },
1334
- body: JSON.stringify({
1335
- query: [...messages.slice(1, messages.length), { user: "user", message }].map((m) => {
1336
- return { role: m.user, content: m.message };
1337
- }),
1338
- model: "gpt-4.1"
1339
- })
1340
- }
1341
- );
1327
+ const response = await fetch("https://chat.luxonis.com/api/chat", {
1328
+ method: "POST",
1329
+ headers: {
1330
+ "Content-Type": "application/json"
1331
+ },
1332
+ body: JSON.stringify({
1333
+ query: [...messages.slice(1, messages.length), { user: "user", message }].map((m) => {
1334
+ return { role: m.user, content: m.message };
1335
+ }),
1336
+ model: "gpt-4.1",
1337
+ rerank: true,
1338
+ slack_thread_ts: slackThreadTs
1339
+ })
1340
+ });
1342
1341
  if (!response.ok) {
1343
1342
  throw new Error(`Request failed with status ${response.status}`);
1344
1343
  }
@@ -1471,14 +1470,17 @@ function ChatButton(props) {
1471
1470
  "button",
1472
1471
  {
1473
1472
  className: "flex !size-12 !p-2",
1474
- onClick: () => setMessages([
1475
- {
1476
- id: -1,
1477
- user: "bot",
1478
- message: "Welcome! I'm here to assist you by searching Luxonis documentation and past forum discussions for answers. How can I help you today?",
1479
- loading: false
1480
- }
1481
- ]),
1473
+ onClick: () => {
1474
+ setMessages([
1475
+ {
1476
+ id: -1,
1477
+ user: "bot",
1478
+ message: "Welcome! I'm here to assist you by searching Luxonis documentation and past forum discussions for answers. How can I help you today?",
1479
+ loading: false
1480
+ }
1481
+ ]);
1482
+ setSlackThreadTs(null);
1483
+ },
1482
1484
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react13.Icon, { icon: "fluent:chat-add-16-regular", className: "text-primary", width: 32, height: 32 })
1483
1485
  }
1484
1486
  ) })
package/dist/index.mjs CHANGED
@@ -1230,21 +1230,20 @@ function ChatButton(props) {
1230
1230
  const fetchData = useCallback(
1231
1231
  async (message) => {
1232
1232
  try {
1233
- const response = await fetch(
1234
- slackThreadTs ? `https://chat.luxonis.com/api/chat?slack_thread_ts=${slackThreadTs}` : "https://chat.luxonis.com/api/chat",
1235
- {
1236
- method: "POST",
1237
- headers: {
1238
- "Content-Type": "application/json"
1239
- },
1240
- body: JSON.stringify({
1241
- query: [...messages.slice(1, messages.length), { user: "user", message }].map((m) => {
1242
- return { role: m.user, content: m.message };
1243
- }),
1244
- model: "gpt-4.1"
1245
- })
1246
- }
1247
- );
1233
+ const response = await fetch("https://chat.luxonis.com/api/chat", {
1234
+ method: "POST",
1235
+ headers: {
1236
+ "Content-Type": "application/json"
1237
+ },
1238
+ body: JSON.stringify({
1239
+ query: [...messages.slice(1, messages.length), { user: "user", message }].map((m) => {
1240
+ return { role: m.user, content: m.message };
1241
+ }),
1242
+ model: "gpt-4.1",
1243
+ rerank: true,
1244
+ slack_thread_ts: slackThreadTs
1245
+ })
1246
+ });
1248
1247
  if (!response.ok) {
1249
1248
  throw new Error(`Request failed with status ${response.status}`);
1250
1249
  }
@@ -1377,14 +1376,17 @@ function ChatButton(props) {
1377
1376
  "button",
1378
1377
  {
1379
1378
  className: "flex !size-12 !p-2",
1380
- onClick: () => setMessages([
1381
- {
1382
- id: -1,
1383
- user: "bot",
1384
- message: "Welcome! I'm here to assist you by searching Luxonis documentation and past forum discussions for answers. How can I help you today?",
1385
- loading: false
1386
- }
1387
- ]),
1379
+ onClick: () => {
1380
+ setMessages([
1381
+ {
1382
+ id: -1,
1383
+ user: "bot",
1384
+ message: "Welcome! I'm here to assist you by searching Luxonis documentation and past forum discussions for answers. How can I help you today?",
1385
+ loading: false
1386
+ }
1387
+ ]);
1388
+ setSlackThreadTs(null);
1389
+ },
1388
1390
  children: /* @__PURE__ */ jsx24(Icon7, { icon: "fluent:chat-add-16-regular", className: "text-primary", width: 32, height: 32 })
1389
1391
  }
1390
1392
  ) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxonis/component-lib",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Luxonis website-component-lib",
5
5
  "publishConfig": {
6
6
  "access": "public"