feat: enhance content filtering, token usage tracking, and stream error handling in chat-stream modules

This commit is contained in:
CJACK
2026-04-05 13:41:38 +08:00
parent 47dc121690
commit eff979d9ef
13 changed files with 439 additions and 33 deletions

View File

@@ -30,6 +30,9 @@ test('js compat: sse fixtures', () => {
assert.deepEqual(got.parts, expected.parts, `${name}: parts mismatch`);
assert.equal(got.finished, expected.finished, `${name}: finished mismatch`);
assert.equal(got.newType, expected.new_type, `${name}: newType mismatch`);
assert.equal(Boolean(got.contentFilter), Boolean(expected.content_filter), `${name}: contentFilter mismatch`);
assert.equal(Number(got.outputTokens || 0), Number(expected.output_tokens || 0), `${name}: outputTokens mismatch`);
assert.equal(got.errorMessage || '', expected.error_message || '', `${name}: errorMessage mismatch`);
}
});