[BUG] Unexpected non-whitespace character after JSON at position 4
Open
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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