duckdevatgit-layer
v6.0.54
Published
A react component library
Downloads
25
Readme
Duckdevatgit-layer
The duckdevatgit-layer is a library that provides an AI Assistant widget.
Installation
npm install duckdevatgit-layer
Usage
The library needs to be configured with your account's secret key, which is available on the website. We recommend setting it as an environment variable. Here's an example of initializing the library with the API key as an environment variable.
REACT_APP_OPEN_AI_API_KEY=your-api-key
You can call an AiAssistant
component by passing title
, placeholder
, itemList
, color
, image
, receiveInsights
, showButton
and showPopUp
props. for example:
const fakeData = [
{
title: "Buy",
subtitle: "Product 1",
payload: "This data is sent directly to open ai api",
},
{
title: "Buy",
subtitle: "Product 2",
payload: "This is the data sent directly to open ai api",
},
];
return (
<div className="main-background">
<AiAssistant
title="Bops Insights"
placeholder="getting insight..."
itemList={fakeData}
color="#7b6cf3"
image={DemoImage}
showButton={true}
showPopUp={false}
receiveInsights={(insights) => console.log(insights)}
/>
</div>
);