https://github.com/variablevic/medusa-ai-assistant
Medusa AI Assistant admin widget that turns human language into returns within seconds.
https://github.com/variablevic/medusa-ai-assistant
ai ecommerce gpt-3-5-turbo medusa medusa-admin medusa-ui medusajs openai vercel-ai-sdk
Last synced: 7 months ago
JSON representation
Medusa AI Assistant admin widget that turns human language into returns within seconds.
- Host: GitHub
- URL: https://github.com/variablevic/medusa-ai-assistant
- Owner: VariableVic
- Created: 2023-10-18T13:34:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T17:29:29.000Z (almost 2 years ago)
- Last Synced: 2025-02-27T23:47:32.399Z (8 months ago)
- Topics: ai, ecommerce, gpt-3-5-turbo, medusa, medusa-admin, medusa-ui, medusajs, openai, vercel-ai-sdk
- Language: TypeScript
- Homepage: https://twitter.com/VariableVic
- Size: 27.3 KB
- Stars: 53
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Medusa AI Order Returns AssistantAn AI Order Returns Assistant widget for the [Medusa](https://medusajs.com/) admin. You can use natural language to explain the situation, and it will extract all necessary data to create the return order. Built with [Medusa UI](https://docs.medusajs.com/ui), [OpenAI](https://platform.openai.com), and [Vercel AI SDK](https://sdk.vercel.ai).
Feel free to take this code and use it to create any Medusa AI assistant you need. By editing the system prompt in `src/api/routes/admin/completion/order-returns.ts` and the functions in `src/util/gpt-functions/returns.ts` and `src/admin/widgets/assistants/order-assistant.tsx`, you can change its behavior and give it access to different admin hooks.
**Disclaimer**: this code is the result of my experimentation, and is by no means optimized or actively maintained.
https://github.com/VariableVic/medusa-ai-assistant/assets/42065266/51ce4de4-c0e9-423c-baf2-d86eb3129097
## Prerequisites
1. This widget requires an OpenAI platform account and API key. Go to https://platform.openai.com/account/api-keys to set this up.
2. You need a valid Medusa database. The fastest way to set this up is by using [create-medusa-app](https://docs.medusajs.com/create-medusa-app).## Getting Started
1. Clone repo and install dependencies.
2. In your `.env` file, add an `OPENAI_API_KEY` environment variable containing your API key, and link your database:```
OPENAI_API_KEY=
DATABASE_URL=
```3. Start your dev server and log into the admin. Open any order details page and the widget will appear on the bottom of the page!