chatboxai / chatboxai/chatbox

[BUG] Unexpected non-whitespace character after JSON at position 4

Open
#2,139 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
41.8k
Forks
4.3k
Avg merge
9h 39m
Merged PRs (30d)
2

Description

Bug Description
当输出内容达到一定长度就会报Unexpected non-whitespace character after JSON at position 4这个错误,请问是什么原因?

Steps to Reproduce
Please provide the steps to reproduce the bug:
接入自己的模型(OpenAI兼容API)后,提问后,当输出内容达到一定长度就会报这个错。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the error with the reported OpenAI-compatible API and a response long enough to trigger it. Trace where the response is parsed, then verify that long outputs complete without the JSON error and add or update coverage for the failure if the relevant test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.