agentic icon indicating copy to clipboard operation
agentic copied to clipboard

Why does the returned content often contain '�'

Open ShingWalker opened this issue 1 year ago • 0 comments

Verify latest release

  • [X] I verified that the issue exists in the latest chatgpt release

Verify webapp is working

  • [X] I verify that the ChatGPT webapp is working properly for this account.

Environment details

chatgpt: "^5.2.4" node: v18.15.0 macos

Describe the Bug

I use onProgress to return a stream, but the content often contains '�'. Is the encoding format incorrect?

image

 const res = await this.chatGPTProvider.sendMessage(searchDto.content, {
      systemMessage: '首选用中文回复',
      parentMessageId,
      onProgress: (partialResponse) => {
        if (partialResponse.delta) {
          response.write(partialResponse.delta);
        }
      },
    });

ShingWalker avatar May 24 '23 13:05 ShingWalker