Skip to content

atp798/chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •