Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@magicul/react-chat-stream

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magicul/react-chat-stream - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

4

dist/hooks/useChatStream.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc