An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          






Medusa logo




Medusa AI Order Returns Assistant

An 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.



Follow @VariableVic

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!