Skip to content

Commit

Permalink
fix: submit manually added messages to endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
niels-bosman committed Mar 16, 2024
1 parent 68555c3 commit a72d57b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@magicul/react-chat-stream",
"description": "A React hook that lets you easily integrate your custom ChatGPT-like chat in React.",
"version": "0.3.0",
"version": "0.3.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"homepage": "https://github.com/XD2Sketch/react-chat-stream#readme",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useChatStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const useChatStream = (input: UseChatStreamInput) => {
setFormInput('');

try {
const addedMessage = await fetchAndUpdateAIResponse(formInput);
const addedMessage = await fetchAndUpdateAIResponse(message ?? formInput);
await input.handlers.onMessageAdded?.(addedMessage);
} catch {
const addedMessage = addMessage({ content: BOT_ERROR_MESSAGE, role: 'bot' });
Expand Down

0 comments on commit a72d57b

Please sign in to comment.