Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@langbase/components

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langbase/components

Ready to use components for building AI powered web apps

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
73
Maintainers
0
Weekly downloads
 
Created
Source

Langbase components

A component library for building AI powered web apps.

Install

npm install @langbase/components

# or

yarn add @langbase/components

# or

pnpm add @langbase/components

Components

  • Chatbot

Usage

Import the styles in the root layout of your app.

import '@langbase/components/styles'

Chatbot

'use client';

import { Chatbot } from '@langbase/components';

export default function App() {
  return (
    <Chatbot
      apiRoute="/api/chat"
      suggestions={[
        {
          title: `Explain how to get started in easy steps`,
          prompt: `Explain how to get started in easy steps?`,
        },
        {
          title: `How do I create an API key?`,
          prompt: `How do I create an API key?`,
        },
        {
          title: `What are the supported providers?`,
          prompt: `What are the supported providers?`,
        },
        {
          title: `How do I reset my password?`,
          prompt: `How do I reset my password?`,
        },
      ]}
    />
  );
}
Props
NameTypeRequiredDefaultDescription
apiRoutestringtrue-The API route where the Langbase AI Pipe is called.
suggestionsArrayfalse[]An array of suggestions to show to the user.
triggerReact.ReactNodefalse-A custom React component to open the chatbot.
openingMessagestringfalse-The opening message to show when the chatbot opens.
onConnectFunctionfalse-A function that is called before request
onResponseFunctionfalse-A function that is called everytime chatbot receives a stream chunk.
onErrorFunctionfalse-A function that is called when there is an error.
onFinishFunctionfalse-A function that is called after the AI text stream finishes.

Issues

If you've found an issue with any of the components, please reach out to us at support@langbase.com.

Keywords

FAQs

Package last updated on 20 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc