graphlit-client 1.0.20250613005 → 1.0.20250613007

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.
@@ -277,7 +277,7 @@ export class UIEventAdapter {
277
277
  // Add final timing metadata
278
278
  if (this.streamStartTime > 0) {
279
279
  const totalTime = Date.now() - this.streamStartTime;
280
- // Final throughput (chars/second)
280
+ // Final throughput (chars/second) - includes entire duration
281
281
  finalMessage.throughput =
282
282
  totalTime > 0
283
283
  ? Math.round((this.currentMessage.length / totalTime) * 1000)
@@ -316,6 +316,13 @@ export class UIEventAdapter {
316
316
  const avgDelay = this.tokenDelays.reduce((a, b) => a + b, 0) / this.tokenDelays.length;
317
317
  finalMetrics.avgTokenDelay = Math.round(avgDelay);
318
318
  }
319
+ // Calculate streaming throughput (excludes TTFT)
320
+ if (this.firstTokenTime > 0 && this.streamStartTime > 0) {
321
+ const streamingTime = completionTime - this.firstTokenTime;
322
+ if (streamingTime > 0) {
323
+ finalMetrics.streamingThroughput = Math.round((this.currentMessage.length / streamingTime) * 1000);
324
+ }
325
+ }
319
326
  this.emitUIEvent({
320
327
  type: "conversation_completed",
321
328
  message: finalMessage,
@@ -444,6 +451,13 @@ export class UIEventAdapter {
444
451
  const avgDelay = this.tokenDelays.reduce((a, b) => a + b, 0) / this.tokenDelays.length;
445
452
  metrics.avgTokenDelay = Math.round(avgDelay);
446
453
  }
454
+ // Calculate streaming throughput (excludes TTFT)
455
+ if (this.firstTokenTime > 0 && this.streamStartTime > 0) {
456
+ const streamingTime = now - this.firstTokenTime;
457
+ if (streamingTime > 0) {
458
+ metrics.streamingThroughput = Math.round((this.currentMessage.length / streamingTime) * 1000);
459
+ }
460
+ }
447
461
  this.emitUIEvent({
448
462
  type: "message_update",
449
463
  message,
@@ -23,6 +23,7 @@ export type AgentStreamEvent = {
23
23
  conversationDuration: number;
24
24
  tokenCount?: number;
25
25
  avgTokenDelay?: number;
26
+ streamingThroughput?: number;
26
27
  };
27
28
  } | {
28
29
  type: "tool_update";
@@ -40,6 +41,7 @@ export type AgentStreamEvent = {
40
41
  tokenCount?: number;
41
42
  llmTokens?: number;
42
43
  avgTokenDelay?: number;
44
+ streamingThroughput?: number;
43
45
  };
44
46
  } | {
45
47
  type: "error";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20250613005",
3
+ "version": "1.0.20250613007",
4
4
  "description": "Graphlit API Client for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/client.js",