Skip to content

UnicDB v1.53.11

Choose a tag to compare

@lengockhoa lengockhoa released this 06 Sep 17:24
· 23 commits to main since this release

Robust text extraction from non-standard Lite Model responses

When the model produces 77 output tokens but UnicDB extracts 0 chars (as
happened with glm-5-turbo through some Lite Model proxies), the text was
missed because the response used a shape the parser didn't recognize.

Fix

  • parseChatCompletionsResponse now handles message.content as either a
    string or an array of typed parts ([{type:"text", text:"..."}]).
  • Both parsers fall back to extractAnyText, a recursive walker that
    concatenates any string in text-shaped keys (text, content,
    delta, output_text, message).
  • The SSE aggregator's empty-text path now calls fallbackTextFromSseEvents
    before throwing, so unrecognized SSE shapes still surface their text.

Files

  • src/ai/provider.tsextractAnyText + fallbackTextFromSseEvents + parser fallback wiring