360macky / langchain-1

Stream OpenAI Chat responses with Langchain and Nextjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAI Chat Stream with Langchain and Nextjs

Example code for an app that makes use of Langchains OpenAIChat. The stream is managed by a CallbackManager. And the prompt is a basic HumanChatMessage.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

Check out our Next.js deployment documentation for more details.

About

Stream OpenAI Chat responses with Langchain and Nextjs


Languages

Language:TypeScript 83.4%Language:JavaScript 13.5%Language:CSS 3.0%