Giter Site home page Giter Site logo

pizza-orderbot's Introduction

Pizza-OrderBot

OrderBot is an interactive chatbot designed to assist customers in placing orders for a pizza restaurant. It guides users through the process of selecting items from the menu, customizing their orders, and providing a conversational and user-friendly experience. OrderBot utilizes a Large Language Model (LLM), specifically GPT-4, for generating natural language responses.

Requirements

  1. Make sure you have Python installed on your system (Python >= 3.6).

  2. Install the required Python packages using pip:

    pip install openai python-dotenv panel
  3. Create a .env file in the project directory.

  4. Add your OpenAI API key to the .env file as follows:

    OPENAI_API_KEY="your_openai_api_key_here"
    

    Replace "your_openai_api_key_here" with your actual OpenAI API key.

  5. Save the .env file.

  6. In your Python script, import the necessary libraries and configure the OpenAI API client using the dotenv package:

    import openai
    import os
    from dotenv import load_dotenv, find_dotenv
    
    # Load environment variables from .env file
    load_dotenv(find_dotenv())
    
    # Configure the OpenAI API client with your API key
    openai.api_key = os.getenv("OPENAI_API_KEY")

Example Chat

Example chat output

Credit

The code is inspired by Youtube tutorial by Isa Fulford and Andrew Ng.

I made modifications:

  • Updated the get_completion_from_messages function to use openai.chat.completions.create
  • The conversation history now displays above the chat box, in the style of ChatGPT web interface.

pizza-orderbot's People

Contributors

frogstar-world-b avatar

Watchers

 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.