Giter Site home page Giter Site logo

chatbot's Introduction

chatbot

项目执行说明

1. 安装准备环境

  • python >= 3.8
  • pip
  • openai >= 0.27.0
  • requests
  • xmltodict
  • flask
  • gunicorn
  • gevent

2. 配置准备

复制config-template.jsonconfig.json, 并修改其中的open_ai_api_key|clear_memory_commands|clear_all_memory_commands

2.1 项目json配置说明

  • open_ai_api_key: string类型,open api key
  • model: string类型,选择的模型,当前仅支持:gpt-3.5-turbo,其他模型不一定完全不支持,可能需要稍作修改
  • debug_mode: bool类型,是否开启debug模式,默认false
  • ip_addr: string类型,服务监听ip地址,默认"127.0.0.1"
  • port: 数值类型,服务监听地址,默认9081
  • expires_in_seconds: 数值类型,会话上下文保存时间,如果超过这个时间,上下文会丢失,单位:秒,默认3600
  • rate_limit_chatgpt: 数值类型,每秒限制请求openai的速度,默认值60
  • clear_memory_commands: string类型,清除会话历史的命令,当请求query等于这个字符串时会清空[当前session]上下文
  • clear_all_memory_commands: string类型,当请求query等于该字符串时会清空[所有session]的上下文,请勿泄漏此命令
  • conversation_max_tokens: 数值类型,对话保存的最大token数,可以简单理解为字数,涉及到费用计算和上下文的长度限制,默认1024
  • character_desc: string类型,open ai的人格提示,会作为一个前置提示去指导open ai对话风格。

2.2 nginx代理配置说明

nginx配置地址:/etc/nginx/conf.d/chatbot.conf

3. 项目执行

确保当前在python_flask目录下 执行: sh script/start.sh

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.