Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/talesmousinho/openai-assistant-file-search
A Next.js 14 Chatbot that uses OpenAI's Assistant Retrieval to chat with documents
https://github.com/talesmousinho/openai-assistant-file-search
chatbot nextjs nextjs14 openai openai-assistant-api
Last synced: 2 days ago
JSON representation
A Next.js 14 Chatbot that uses OpenAI's Assistant Retrieval to chat with documents
- Host: GitHub
- URL: https://github.com/talesmousinho/openai-assistant-file-search
- Owner: talesmousinho
- License: mit
- Created: 2024-03-28T15:56:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T02:32:35.000Z (4 months ago)
- Last Synced: 2024-11-08T14:47:21.715Z (about 2 months ago)
- Topics: chatbot, nextjs, nextjs14, openai, openai-assistant-api
- Language: TypeScript
- Homepage:
- Size: 432 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Next.js 14 OpenAI Assistants Chatbot with File Search
This is a **Next.js 14** project using features like _App Router_ and _Server Actions_. It showcases the use of the **OpenAI Assistants API** with the _File Search Tool_ enabled, allowing it to interact with any document supported by OpenAI.
**This application does not rely on any provisioned vector database or third-party libraries for Retrieval-augmented generation (RAG). Instead, it exclusively utilizes the OpenAI SDK to manage and interact with proprietary documents.**## Features
- [Next.js 14](https://nextjs.org) App Router and Server Actions
- [OpenAI Assistants API](https://platform.openai.com/docs/assistants/overview)
- With [File Search](https://platform.openai.com/docs/assistants/tools/file-search) tool to chat with any [document supported](https://platform.openai.com/docs/assistants/tools/file-search/supported-files) by OpenAI
- [Vercel AI SDK](https://sdk.vercel.ai/docs)
- Use [createStreamableValue](https://sdk.vercel.ai/docs/api-reference/generative-ui/create-streamable-value) and [readStreamableValue](https://github.com/vercel/ai/pull/1114) for streaming OpenAI's response
- [shadcn/ui](https://ui.shadcn.com)
- Styling with [Tailwind CSS](https://tailwindcss.com)
- [Radix UI](https://radix-ui.com) for headless component primitives
- Icons from [Lucide Icons](https://lucide.dev/)## Getting Started
To set up the project locally, follow these steps:
1. Clone the repository to your local machine.
2. Install the required dependencies with `npm install`.
3. Set up your environment variables in a `.env.local` file in the root directory of the project. Use the provided `.env.example` file as a template. You will need to provide your OpenAI API Key.
4. Run the development server with `npm run dev`.Open [http://localhost:3000](http://localhost:3000) with your browser to access the app.
## Learn More
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [OpenAI Documentation](https://platform.openai.com/docs/assistants/overview) - learn how to use the OpenAI Assistants API.## Not for production
This is a proof of concept and should not be used in production as it is. It does not have any rate limiting or security features enabled.