Merged
Conversation
…yer and enable this for the playback services
…d that control events don't block audio events there anymore.
Contributor
There was a problem hiding this comment.
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
servicefield and switchBillingRecordsto media path in protocol. - Add
BillingScheduleenum and updateConversationOutput::billing_recordsfor 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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For more exact billing the support to push out billing and bill records through the media path needs to be supported.