fruitbars / simple-one-api

OpenAI 接口接入适配,支持千帆大模型平台、讯飞星火大模型、腾讯混元以及MiniMax、Deep-Seek,等兼容OpenAI接口,仅单可执行文件,配置超级简单,一键部署,开箱即用. Seamlessly integrate with OpenAI and compatible APIs using a single executable for quick setup and deployment.
MIT License
1.34k stars 117 forks source link

希望可以支持通义千问 #14

Closed MisteryLiuCode closed 4 months ago

fruitbars commented 4 months ago

通义API是有DashScope提供的,本身做了openai的接口兼容: https://help.aliyun.com/zh/dashscope/developer-reference/compatibility-of-openai-with-dashscope/?spm=a2c4g.11186623.0.i2

因此可以这样配置:

{
  "server_port": ":9099",
  "load_balancing": "random",
  "services": {
    "openai": [
      {
        "models": ["qwen-plus"],
        "enabled": true,
        "credentials": {
          "api_key": "xxx"
        },
        "server_url":"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
      }
    ]
  }
}

api_key获取说明文档:https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key?spm=a2c4g.11186623.0.0.37913116wDxJop

MisteryLiuCode commented 4 months ago

好的,感谢

lopins commented 2 months ago

通义API是有DashScope提供的,本身做了openai的接口兼容: https://help.aliyun.com/zh/dashscope/developer-reference/compatibility-of-openai-with-dashscope/?spm=a2c4g.11186623.0.i2

因此可以这样配置:

{
  "server_port": ":9099",
  "load_balancing": "random",
  "services": {
    "openai": [
      {
        "models": ["qwen-plus"],
        "enabled": true,
        "credentials": {
          "api_key": "xxx"
        },
        "server_url":"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions"
      }
    ]
  }
}

api_key获取说明文档:https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key?spm=a2c4g.11186623.0.0.37913116wDxJop

多个openai兼容的接口配置是否可以在一个openai节点下:

     "openai": [
       {
         "models": ["qwen-plus"],
         "enabled": true,
         "credentials": {
           "api_key": "xxx"
         },
       {
         "models": ["claude-xxxx"],
         "enabled": true,
         "credentials": {
           "api_key": "xxx"
         },