npm.io
6.0.1 • Published 1 month ago

@lg-chat/leafygreen-chat-provider

Licence
Apache-2.0
Version
6.0.1
Deps
0
Size
26 kB
Vulns
0
Weekly
0
Stars
274

LeafyGreen Chat Provider

Installation

PNPM

pnpm add @lg-chat/leafygreen-chat-provider
Yarn
yarn add @lg-chat/leafygreen-chat-provider
NPM
npm install @lg-chat/leafygreen-chat-provider

Overview

LeafyGreenChatProvider provides context to LG Chat components, including the assistant name that will be displayed in messages.

Examples

LeafyGreenChatProvider
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';

function App() {
  return (
    <LeafyGreenChatProvider assistantName="MongoDB Assistant">
      {/* chat components */}
    </LeafyGreenChatProvider>
  );
}
With Custom Assistant Name
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';

function App() {
  return (
    <LeafyGreenChatProvider assistantName="MongoDB Assistant">
      {/* chat components */}
    </LeafyGreenChatProvider>
  );
}

Properties

Prop Type Description Default
assistantName (optional) string The name of the AI assistant that will be displayed when AI sends messages to users 'MongoDB Assistant'
children ReactNode The chat components to be wrapped by the provider