Skip to content

feat: add per-conversation duration to Html reports#266

Merged
philipph-askui merged 2 commits intomainfrom
feat/conversation_duration
Apr 15, 2026
Merged

feat: add per-conversation duration to Html reports#266
philipph-askui merged 2 commits intomainfrom
feat/conversation_duration

Conversation

@philipph-askui
Copy link
Copy Markdown
Contributor

@philipph-askui philipph-askui commented Apr 15, 2026

Adds the duration of each conversation in the per-conversation usage breakdown of the Html reports

image

conversation_index: int
conversation_id: str
step_summaries: list[StepUsageSummary] = Field(default_factory=list)
duration_seconds: float | None = None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not have a times object for duration in Python lib?

Copy link
Copy Markdown
Collaborator

@programminx-askui programminx-askui Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed my mind. Please store the start time and end time and generate the duration in the generate function when the html is generated.

Then we have the values also for other information

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why is this part of the usage tracking?

Should we change the name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both addressed in #e12eb14b25093833b46467064ccc8fcbe61ae994:

  • renamed UsageTrackingCallback to ConversationStatisticsCallback
  • stored started_at and ended_at as datetime objects i/o duration_seconds in the ConversationUsageSummary

Comment thread src/askui/reporting.py
return [image]


def _format_duration(seconds: float) -> str:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we have a time object. Then we don't need to implement the format logic by our self

@philipph-askui philipph-askui merged commit 76ff93c into main Apr 15, 2026
1 check passed
@philipph-askui philipph-askui deleted the feat/conversation_duration branch April 15, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants