Giter VIP home page Giter VIP logo

kiwi-gpt's Introduction

Kiwibot Bots, Orders and Reports API

API developed by Angela Haydee Cobos as an exercise for Kiwibot.

Technologies used:

  • Python 3.11
  • Flask: API routes.
  • GTP-3 davinci model: Natural language recognition.
  • Unittest Python module: Unit tests.
  • Git: Version control.

How to run

API

  1. Clone the Git repository.
  2. Create a .env file on the root of the project. You can use the .env.example file to see what environment variables are needed.
  3. Run flask --app main run to run the API locally

Tests

  1. Run python test.py to run the tests locally.

API Docs

POST /heartbeat

Endpoint for bots to send status updates.

Body JSON:

{
    "bot_id": "string",
    "timestamp": "ISO 8601 Date",
    "location": {
        "lat": "float",
        "lon": "float"
    },
    "status": "available" | "busy" | "reserved",
    "battery_level": "float",
    "software_version": "string",
    "hardware_version": "string"
}

Respose codes:

  • 200: OK

GET /heartbeat

Retrieves the last status of each bot.

Respose codes:

  • 200: OK

GET /tickets/<ticket_id>

Retrieves the ticket with the given id.

Respose codes:

  • 200: OK
  • 404: Ticket not found

PATCH /tickets/<ticket_id>

Update the status of the ticket with the given id.

Body JSON:

{
    "status": "available" | "busy" | "reserved"
}

Respose codes:

  • 200: OK
  • 400: Invalid status
  • 404: Ticket not found

POST /reports/<bot_id>

Endpoints for employees to send reports about problems with bots. A ticket is created and returned in the response.

Body Plaintext

Respose codes:

  • 200: OK
  • 400: Failed to parse report

Response JSON:

{
    "ticket_id": "string",
    "problem_location": "string",
    "problem_type": "software" | "hardware" | "field",
    "summary": "string",
    "bot_id": "string",
    "status": "open" | "in progress" | "closed"
}

kiwi-gpt's People

Contributors

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