mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-06 01:15:29 +08:00
归一化优化
This commit is contained in:
@@ -233,6 +233,24 @@ test('parseChunkForContent handles response/fragments APPEND with thinking and r
|
||||
]);
|
||||
});
|
||||
|
||||
test('parseChunkForContent drops thinking content when thinking is disabled', () => {
|
||||
const thinking = parseChunkForContent(
|
||||
{ p: 'response/thinking_content', v: 'hidden thought' },
|
||||
false,
|
||||
'text',
|
||||
);
|
||||
assert.equal(thinking.finished, false);
|
||||
assert.equal(thinking.newType, 'text');
|
||||
assert.deepEqual(thinking.parts, []);
|
||||
|
||||
const answer = parseChunkForContent(
|
||||
{ p: 'response/content', v: 'visible answer' },
|
||||
false,
|
||||
thinking.newType,
|
||||
);
|
||||
assert.deepEqual(answer.parts, [{ text: 'visible answer', type: 'text' }]);
|
||||
});
|
||||
|
||||
test('parseChunkForContent supports wrapped response.fragments object shape', () => {
|
||||
const chunk = {
|
||||
p: 'response',
|
||||
|
||||
Reference in New Issue
Block a user