WeKnora/internal/models/api/openaicompletions
LuckVd ea7cf8d5d7
fix(models): emit explicit empty content for assistant tool-call turns (#3605)
Assistant history messages that carry tool_calls but empty text previously
omitted the content field entirely on the wire. Strict local OpenAI-compatible
engines (vLLM / Xinference serving Qwen-family Jinja chat templates) treat the
missing field as undefined/null and crash while rendering the next turn,
surfacing as "I'm sorry, I was unable to generate a response".

Always serialize "content": "" for assistant tool-call turns. The empty
string is accepted by every standard OpenAI-compatible endpoint.

Fixes #1487

Co-authored-by: LuckVd <LuckVd@users.noreply.github.com>
2026-10-08 17:43:05 +08:00
..
client.go fix(llm): treat cut-off streams as broken and tighten LLM retries 2026-09-25 18:22:14 +08:00
golden_test.go fix(models): emit explicit empty content for assistant tool-call turns (#3605) 2026-10-08 17:43:05 +08:00
request.go fix(models): emit explicit empty content for assistant tool-call turns (#3605) 2026-10-08 17:43:05 +08:00