Giter Site home page Giter Site logo

chatbot-starter's Introduction

Next.js 13 and app template Router-ready AI chatbot.

An open-source AI chatbot app template built with Next.js, the Vercel AI SDK, OpenAI, and Humanloop.

Features · Model Providers · Deploy Your Own · Running locally · Authors


Features

Running locally

You will need to populate the two evironment variables shown in .env.example. Copy this file to a file called .env. You can retrieve you OpenAI API key here and your Humanloop API key here.

To run the application locally, simply run:

npm install
npm run dev

Your app template should now be running on localhost:3000.

Preview

The chat interface powered by Next.js looks something like this:

Screenshot of the chat interface

Meanwhile, in your Humanloop project, you can explore the generated logs from the app, iterate on the prompt, evaluate it and redeploy.

The Humanloop project linked to the chatbot app

Humanloop

In app/api/chat/route.ts, LLM chat calls are made via Humanloop's TypeScript SDK. Note that this file is an example of a Next.js Route Handler. This means it will run server-side, and therefore does not expose your OpenAI and Humanloop API keys to the client. This backend Route Handler is called from components/chat.tsx with the Vercel SDK's useChat hook.

After sending and receiving some chat messages in your app, visit the Humanloop app, and you will see a project called sdk-example. Visit the Logs tab and you will find all the chat histories from your running application.

Deploy Your Own

You can deploy your own version of the Next.js AI Chatbot to Vercel with one click:

Deploy with Vercel

Authors

Credit for the foundational design, app, and implementation is due to Vercel and their AI Chatbot Template with contributions from:

We've mostly just ripped out the good (but more complicated) auth and KV store, and powered the AI chatbot with Humanloop to make it easier to customise, evaluate and improve the underlying AI.

chatbot-starter's People

Contributors

jordn avatar seabo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.