Git Product home page Git Product logo

coze2openaidocker's Introduction

coze2openaidocker

参考源项目:https://github.com/fatwang2/coze2openai

优化点:

  • 直接打包成docker镜像,方便快速部署

安装

docker-compose.yml,运行前需要去coze获取指定的机器人ID,登录coze,点击对应的bot,类似下面地址https://www .coze.com/space/732xxxx652166/bot/7372240xxxxx ,其中bot后面的就是BOT_ID,替换下面的BOT_ID

version: '3'
services:
  coze2openai:
    image: ghcr.io/luler/coze2openaidocker:latest
    restart: always
    ports:
      - 15150:3000
    environment:
      - BOT_ID=xxxx

运行

docker-compose up -d

访问

可以访问openai类似的chat接口,授权token来自于coze的api token,获取地址:https://www.coze.com/open/api

curl http://127.0.0.1:15150/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer coze_api_token" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "你是?"
      }
    ],
    "stream": false
    }'

coze2openaidocker's People

Contributors

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