@magicul/react-chat-stream
Advanced tools
Comparing version 0.1.7 to 0.2.0
@@ -89,3 +89,3 @@ "use strict"; | ||
}; | ||
var fetchAndUpdateAIResponse = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var fetchAndUpdateAIResponse = function (message) { return __awaiter(void 0, void 0, void 0, function () { | ||
var stream, _a, _b, _c, message_1, e_1_1; | ||
@@ -150,3 +150,3 @@ var _d, e_1, _e, _f; | ||
_b.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, fetchAndUpdateAIResponse()]; | ||
return [4 /*yield*/, fetchAndUpdateAIResponse(newMessage !== null && newMessage !== void 0 ? newMessage : message)]; | ||
case 2: | ||
@@ -153,0 +153,0 @@ _b.sent(); |
{ | ||
"name": "@magicul/react-chat-stream", | ||
"description": "A React hook that lets you easily integrate your custom ChatGPT-like chat in React.", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
@@ -67,3 +67,3 @@ import { ChangeEvent, Dispatch, FormEvent, SetStateAction, useState } from 'react'; | ||
const fetchAndUpdateAIResponse = async () => { | ||
const fetchAndUpdateAIResponse = async (message: string) => { | ||
const stream = await getStream(message, input.options, input.method); | ||
@@ -86,3 +86,3 @@ if (!stream) throw new Error(); | ||
try { | ||
await fetchAndUpdateAIResponse(); | ||
await fetchAndUpdateAIResponse(newMessage ?? message); | ||
} catch { | ||
@@ -89,0 +89,0 @@ addMessageToChat(BOT_ERROR_MESSAGE, 'bot'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36547