Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit cbd7f72

Browse files
committed
Nicer timings info
1 parent c254928 commit cbd7f72

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

src/utils/live_display.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,25 +391,36 @@ def show_response(self, progress: TestProgress, response: ModelResponse) -> None
391391
response_content = response_content[:500] + "..."
392392

393393
if self.console:
394+
# Build title with timing and token info
395+
title = "🤖 RESPONSE"
396+
timing_parts = [f"took: {response.response_time:.2f}s"]
397+
if response.total_tokens > 0:
398+
timing_parts.append(f"tokens: {response.total_tokens}")
399+
400+
if timing_parts:
401+
title += f" ({' | '.join(timing_parts)})"
402+
394403
response_panel = Panel(
395404
Text(response_content, style="white"),
396-
title="🤖 RESPONSE",
405+
title=title,
397406
title_align="left",
398407
style="green",
399408
padding=(1, 2),
400409
)
401410
self.console.print(response_panel)
402411

403-
# Show timing and token info
404-
timing_info = f"⏱️ Response time: {response.response_time:.2f}s"
405-
if response.total_tokens > 0:
406-
timing_info += f" | Tokens: {response.total_tokens}"
407-
self.console.print(timing_info, style="dim")
408-
409412
else:
410-
print("\n🤖 RESPONSE:")
413+
# Build title with timing info for fallback
414+
title = "🤖 RESPONSE"
415+
timing_parts = [f"took: {response.response_time:.2f}s"]
416+
if response.total_tokens > 0:
417+
timing_parts.append(f"tokens: {response.total_tokens}")
418+
419+
if timing_parts:
420+
title += f" ({' | '.join(timing_parts)})"
421+
422+
print(f"\n{title}:")
411423
print(f" {response_content}")
412-
print(f"⏱️ Response time: {response.response_time:.2f}s")
413424

414425
def show_evaluation(self, progress: TestProgress, evaluation: EvaluationResult) -> None:
415426
"""Display evaluation results"""

0 commit comments

Comments
 (0)