版本号修改

This commit is contained in:
CJACK
2026-04-27 20:12:33 +08:00
parent 0378d8c0a9
commit fb43bd92f5
6 changed files with 223 additions and 49 deletions

View File

@@ -6,6 +6,7 @@ const fs = require('node:fs');
const path = require('node:path');
const chatStream = require('../../api/chat-stream.js');
const deepseekConstants = require('../../internal/js/shared/deepseek-constants.js');
const { parseToolCallsDetailed, parseStandaloneToolCallsDetailed } = require('../../internal/js/helpers/stream-tool-sieve.js');
const { parseChunkForContent, estimateTokens } = chatStream.__test;
@@ -16,6 +17,15 @@ function readJSON(filePath) {
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
}
test('js shared constants derive client headers from shared json', () => {
const shared = readJSON(path.resolve(__dirname, '../../internal/deepseek/protocol/constants_shared.json'));
const client = shared.client;
assert.equal(deepseekConstants.CLIENT_VERSION, client.version);
assert.equal(deepseekConstants.BASE_HEADERS['x-client-version'], client.version);
assert.equal(deepseekConstants.BASE_HEADERS['User-Agent'], `${client.name}/${client.version} Android/${client.android_api_level}`);
assert.equal(deepseekConstants.BASE_HEADERS['Content-Type'], 'application/json');
});
test('js compat: sse fixtures', () => {
const fixtureDir = path.join(compatRoot, 'fixtures', 'sse_chunks');
const expectedDir = path.join(compatRoot, 'expected');