labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://fastgpt.in
Other
16.58k stars 4.42k forks source link

The first packet returned by streaming from the OpenAPI chat interface is inconsistent with the openai standard. #670

Closed zhiluan233 closed 8 months ago

zhiluan233 commented 8 months ago

例行检查

你的版本

问题描述

我使用FastGPT的OpenAPI聊天接口时,发现返回流的首包json结果delta内不包含role: "assistant",这直接导致飞书智能伙伴自定义模型的上下文无法使用。

复现步骤

正常用stream=true请求Chat/Completions接口

预期结果

流式传输的首包应当与OpenAI标准的接口一样,包含role: "assistant"

相关截图 问题请求: image OpenAI的流式返回结果首包存在role: "assistant" image 希望修复~

c121914yu commented 8 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Routine inspection

your version

Problem Description

When I used the OpenAPI chat interface of FastGPT, I found that the delta of the first json result of the return stream did not contain role: "assistant", which directly caused the context of Feishu Smart Partner's custom model to be unusable.

Steps to reproduce

Normally use stream=true to request the Chat/Completions interface

expected outcome

The first packet of streaming should be the same as the OpenAI standard interface, including role: "assistant"

Related screenshots Question request: image The first packet of OpenAI's streaming return result contains role: "assistant" image Hope to fix~

c121914yu commented 8 months ago

https://github.com/labring/FastGPT/pull/676 fix it