Giter Club home page Giter Club logo

medusa-ai-assistant's Introduction

Medusa logo

Medusa AI Order Returns Assistant

An AI Order Returns Assistant widget for the Medusa 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, OpenAI, and Vercel AI SDK.

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

Screen.Recording.2023-10-11.at.18.39.45.mov

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.

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=<YOUR OPENAI API KEY>
DATABASE_URL=<YOUR MEDUSA DB URL>
  1. 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!

medusa-ai-assistant's People

Contributors

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