gpteam 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bench.js +16 -9
- package/lib/help.js +1 -1
- package/package.json +1 -1
package/lib/bench.js
CHANGED
|
@@ -118,15 +118,7 @@ function measureStream(baseUrl, options) {
|
|
|
118
118
|
const url = new URL(`${baseUrl.replace(/\/$/, '')}/responses`);
|
|
119
119
|
const started = performance.now();
|
|
120
120
|
const timings = { dnsMs: NaN, tcpMs: NaN, tlsMs: NaN, firstEventMs: NaN };
|
|
121
|
-
const payload = JSON.stringify(
|
|
122
|
-
model: options.model,
|
|
123
|
-
stream: true,
|
|
124
|
-
instructions: 'You are a helpful coding assistant.',
|
|
125
|
-
input: options.prompt || '请只回复一句话:节点测速完成。',
|
|
126
|
-
max_output_tokens: options.maxOutputTokens || 648,
|
|
127
|
-
reasoning: options.effort ? { effort: options.effort } : undefined,
|
|
128
|
-
metadata: { gpteam_config_probe: '1' }
|
|
129
|
-
});
|
|
121
|
+
const payload = JSON.stringify(buildResponsesProbePayload(options));
|
|
130
122
|
|
|
131
123
|
const request = https.request({
|
|
132
124
|
protocol: url.protocol,
|
|
@@ -198,6 +190,21 @@ function measureStream(baseUrl, options) {
|
|
|
198
190
|
});
|
|
199
191
|
}
|
|
200
192
|
|
|
193
|
+
export function buildResponsesProbePayload(options = {}) {
|
|
194
|
+
const prompt = options.prompt || '请只回复一句话:节点测速完成。';
|
|
195
|
+
return {
|
|
196
|
+
model: options.model,
|
|
197
|
+
stream: true,
|
|
198
|
+
instructions: 'You are a helpful coding assistant.',
|
|
199
|
+
input: [{
|
|
200
|
+
role: 'user',
|
|
201
|
+
content: [{ type: 'input_text', text: prompt }]
|
|
202
|
+
}],
|
|
203
|
+
reasoning: options.effort ? { effort: options.effort } : undefined,
|
|
204
|
+
metadata: { gpteam_config_probe: '1' }
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
201
208
|
export function formatStreamProbeError(status, headers, body, semanticError) {
|
|
202
209
|
const statusCode = Number(status || 0);
|
|
203
210
|
const contentType = String(headers?.['content-type'] || headers?.['Content-Type'] || '').trim();
|
package/lib/help.js
CHANGED