1.0.2 • Published 12 months ago
infer-bot-ui v1.0.2
InferBot UI Component
A React component that provides an interactive 3D sphere UI for voice interactions with customizable positioning and visual feedback.
Installation
npm install infer-bot-uiUsage
In order to use the InferBotComponent it requires an InferBot instance. Once an InferBot instance is created, it should be passed as one of the props to InferBotComponent
import { InferBotComponent } from 'infer-bot-ui';
function App() {
// Create an InferBot instance
const instance = new InferBot({
agentId:
"<AGENT_ID>",
})
const startCallBack = async () => {
await instance.startConversation()
};
const stopCallBack = async () => {
await instance.startConversation()
};
return (
<InferBotComponent
inferBotInstance={instance}
startCallBack={startCallBack}
stopCallBack={stopCallBack}
style={{ /* Optional custom styles */ }}
/>
);
}Default styling
If no styling prop is provided the component will use the default styling
const defaultStyle = {
position: 'fixed',
bottom: '10px',
right: '10px',
zIndex: 9999,
width: '120px',
height: '120px'
};