Code Monkey home page Code Monkey logo

easychatgpt-api's Introduction

EasyChatGPT-API

note: 该项目所有代码(包括这个README)皆由ChatGPT实现

项目在线体验地址:http://wangyunjeff.pythonanywhere.com/

用python和flask简单实现调用chatGPT的API,支持上下文回复、latex公式渲染、和代码高亮。

EasyChatGPT-API 是一个使用 OpenAI GPT-3.5 API(也就是ChatGPT) 实现的简单聊天机器人 。使用 Python 的 Flask 框架编写。

安装

  1. 克隆仓库到本地

git clone https://github.com/<YOUR_GITHUB_USERNAME>/EasyChatGPT-API.git

  1. 进入项目目录

cd EasyChatGPT-API

  1. 安装依赖

pip install flask markupsafe openai markdown

  1. 在 'app.py' 中设置你自己的 OpenAI APE key

openai.api_key = 'YOUR_API_KEY'

  1. 运行项目

python app.py

API 使用说明

  • /get_response:用于获取聊天机器人的回复。需要以 POST 请求发送用户输入,并返回聊天机器人的回复。
  • /reset:用于重置聊天历史记录。

代码说明

  • app.py:Flask 项目主文件,包含了 API 接口的定义和聊天机器人的实现。

许可证

EasyChatGPT-API 使用 MIT 许可证。请参阅 LICENSE 文件了解详情。

easychatgpt-api's People

Contributors

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