Giter Site home page Giter Site logo

auditlimit's Introduction

AuditLimit

用于内容审核的限流器,本代码更多的是为了演示如果使用限流器,大家可以根据自己的需求进行修改。

如果不想部署,可以使用公共限流器: https://auditlimit.closeai.biz/audit_limit

部署方法

创建docker-compose.yml文件

version: '3'
services:
  auditlimit:
    image: xyhelper/auditlimit
    restart: always
    ports:
      - 9611:8080
    environment:
      LIMIT: 40  # 限制每个userToken允许的次数
      PER: "3h" # 限制周期 1s, 1m, 1h, 1d, 1w, 1y

    

然后执行

docker-compose up -d

限流器接口地址为: http://ip:9611/audit_limit

超速返回格式

状态码: 429

{
  "detail": {
    "clears_in": 252,
    "code": "model_cap_exceeded",
    "message": "You have sent too many messages to the model. Please try again later."
  }
}

通用提示

状态码: 400

{
  "detail": "别闹了"
}

正常返回

状态码: 200

auditlimit's People

Contributors

weikecloud avatar

Watchers

 avatar

Forkers

seven2202

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.