Skip to content

Media Path Billing#44

Merged
pragmatrix merged 11 commits intomasterfrom
media-path-billing
Jun 30, 2025
Merged

Media Path Billing#44
pragmatrix merged 11 commits intomasterfrom
media-path-billing

Conversation

@pragmatrix
Copy link
Copy Markdown
Owner

For more exact billing the support to push out billing and bill records through the media path needs to be supported.

@pragmatrix pragmatrix marked this pull request as ready for review June 30, 2025 13:48
@pragmatrix pragmatrix requested a review from Copilot June 30, 2025 13:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables inband billing by routing billing records through the media path, adds a scheduling model for when to bill, and updates downstream services to specify billing schedules.

  • Introduce service field and switch BillingRecords to media path in protocol.
  • Add BillingSchedule enum and update ConversationOutput::billing_records for immediate vs. media-path billing.
  • Update services and the audio-knife scheduler/dispatcher to tag and route billing records with schedules.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/protocol.rs Add service field to BillingRecords and use OutputPath::Media.
src/context_switch.rs Populate service in ServerEvent::BillingRecords.
services/playback/src/lib.rs Emit per-frame billing with BillingSchedule::Media.
services/openai-dialog/src/lib.rs Pass BillingSchedule::Now to billing calls.
services/azure/src/translate.rs Include BillingSchedule::Now in billing calls.
services/azure/src/transcribe.rs Include BillingSchedule::Now in billing calls.
services/azure/src/synthesize.rs Include BillingSchedule::Now in billing calls.
core/src/lib.rs Expose new billing_context module.
core/src/conversation.rs Add BillingSchedule, update billing_records logic and Output::BillingRecords.
core/src/billing_context.rs Introduce BillingContext for centralized billing.
audio-knife/src/main.rs Wire billing_collector into ContextSwitch and dispatcher.
audio-knife/src/event_scheduler.rs Refactor scheduler to handle media-path billing events.

Comment thread src/protocol.rs Outdated
Comment thread audio-knife/src/event_scheduler.rs Outdated
pragmatrix and others added 2 commits June 30, 2025 15:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pragmatrix pragmatrix merged commit c350095 into master Jun 30, 2025
6 checks passed
@pragmatrix pragmatrix deleted the media-path-billing branch June 30, 2025 13:52
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