one-api 自定义渠道转发后丢失流式传输功能

cnjp1d6j  于 3个月前  发布在  其他
关注(0)|答案(2)|浏览(95)

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述

此项目 通过自定义渠道接入 one-api 后不支持流式传输。通过此项目的方法请求则是支持流式传输的。

复现步骤

  1. 通过正常方法请求上述项目可以流式传输;
  2. 接入 one-api 后通过 one-api 访问该渠道测试,发现不支持流式传输。

预期结果

接入 one-api 后能够正常流式请求。

相关截图

!

直接请求能够按照流式请求返回。
!

接入 one-api 后请求则返回空值(不支持流式请求)。

hvvq6cgz

hvvq6cgz1#

感觉是协议兼容有问题,如果方便的话,请将原始的stream贴在postman上。

chhqkbe1

chhqkbe12#

感觉是协议兼容有问题,如果方便的话,postman 把原始的 stream 贴一下。大佬我比较小白,不太知道什么叫原始的stream。我把返回的json原始格式发了一下:

https://paste.fastmirror.net/?cac122ec6c9079de#6sxEPRe9ARo2hBJaoSk2y72Zz1M7e464tWoyP8mWVyNz

data: {"choices":[{"index":0,"delta":{"content":null,"role":"assistant"}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":"Hello","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":"!","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" Nice","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" to","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" meet","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" you","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":".","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" How","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" can","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" I","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" assist","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":" you","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"index":0,"delta":{"content":"?","role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}
data: {"choices":[{"finish_reason":"stop","index":0,"delta":{"content":null,"role":null}}],"created":1702205900,"id":"chatcmpl-8UBnog7QRmNCQzqARvRza44g60uy1"}

相关问题