1.0.2 • Published 5 months ago

@product-partner/pp-chatbot v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Chat Component PP React

Development

comment out the App in App.tsx and import it as {App} in main.tsx and it would start working check your .env file for the VITE_SITE_URL the dev environment uses a proxy to go to stage.productpartner.ai

Usage

import { ChatBot } from "pp-chatbot";

const App = () => {
  return <ChatBot />;
};

📦 Props Table – ChatBot

PropTypeRequiredDescription
messages{ id: string; content: string; role?: string }[]NoArray of message objects, each with an id, content, and optional role.
suggestionsstring[]NoOptional array of suggestion strings.
loadingbooleanYesIndicates if a loading state is active.
onSubmit(val: string) => voidYesCallback triggered when a message is submitted.
onFileChange(val: File[]) => voidYesCallback triggered when files are added.
filesFile[]YesArray of currently selected files.
removeFile(val: File) => voidYesCallback to remove a selected file.