Giter Club home page Giter Club logo

kimichattov1's Introduction

KimiChatToV1

KimiChat网页端逆向/v1/chat/completions接口,参考了COW插件,支持流式和非流式请求,内置自刷新token,支持ChatGPT-Next-Web,AMA问天等。

部署方式

直接部署

python版本需>=3.6

克隆本仓库

启动

bash start.sh

这将创建一个kimi-chat-to-v1的系统服务在后台启动,运行在本机6008端口。

Docker部署(推荐)

 docker run -d -p 6008:6008 tianzhentech/kimi-chat-to-v1

请求方式

先获取KimiChat的refresh_token:登录-->浏览器控制台-->应用程序-->存储-->本地存储-->refresh_token

curl

非流式

curl --location 'http://127.0.0.1:6008/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer refresh_token' \
--data '{
  "messages": [{"role": "user", "content": "hi"}]
}'

流式

curl --location 'http://127.0.0.1:6008/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer refresh_token' \
--data '{
  "stream": true,
  "messages": [{"role": "user", "content": "hi"}]
}'

不足

  • 暂不支持上传文件(因为ChatGPT-Next-Web这类软件大多没有上传文件的位置),后续可能会补充。

  • 解析网址也是时灵时不灵,但是好在可以联网。

  • 由于从官网向后端的接口只支持role为user的message,所以很多面具实现起来有点复杂,切换多个面具有可能会不能重置会话,我暂时没找到好的解决办法。

  • 由于实际上是从官网请求,模型和参数似乎是写死的,暂不支持切换模型,以及调参。

Star History

Star History Chart

kimichattov1's People

Contributors

tianzhen125 avatar tianzhen889 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.