-
Notifications
You must be signed in to change notification settings - Fork 137
AGT-2669: Add turn detection and interruption protobufs #1485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4be8ffa
add turn detection protobufs
chenghao-mou 073003b
Create many-seas-fry.md
chenghao-mou d8da1d2
add num_samples in each audio frame
chenghao-mou 0d749fd
Merge branch 'chenghao/feat/turn-detection-proto' of https://github.c…
chenghao-mou 8cc28aa
add barge in
chenghao-mou f4d080f
add request, response, and prediction
chenghao-mou 4124981
rename for eou and interruption
chenghao-mou ea0d27e
refactor
chenghao-mou 9ebcbd5
rename
chenghao-mou 2de75f4
Merge branch 'main' into chenghao/feat/turn-detection-proto
chenghao-mou 68c05a6
rename bargein to interruption
chenghao-mou a233c45
rename bargein to interruption
chenghao-mou 720f1f5
address comments
chenghao-mou d8c306d
Merge branch 'main' into chenghao/feat/turn-detection-proto
chenghao-mou a84e436
add file to magefile
chenghao-mou 9670cbd
generated protobuf
github-actions[bot] 628f3b0
add backend field
chenghao-mou 1e496b6
Merge branch 'chenghao/feat/turn-detection-proto' of https://github.c…
chenghao-mou 47d6736
generated protobuf
github-actions[bot] e230161
simplify stats protos
chenghao-mou e9c9e5d
clean up
chenghao-mou 3197b21
generated protobuf
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| // Copyright 2026 LiveKit, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| syntax = "proto3"; | ||
|
|
||
| package livekit.agent; | ||
|
|
||
| option go_package = "github.com/livekit/protocol/livekit/agent"; | ||
| option csharp_namespace = "LiveKit.Proto"; | ||
| option ruby_package = "LiveKit::Proto"; | ||
| option optimize_for = SPEED; | ||
|
|
||
| import "agent/livekit_agent_session.proto"; | ||
| import "google/protobuf/duration.proto"; | ||
| import "google/protobuf/timestamp.proto"; | ||
|
|
||
| enum TdAudioEncoding { | ||
| TD_AUDIO_ENCODING_OPUS = 0; | ||
| } | ||
|
|
||
| message TdSessionSettings { | ||
| uint32 sample_rate = 1; | ||
| TdAudioEncoding encoding = 2; | ||
| } | ||
|
|
||
| message TdInferenceStats { | ||
| google.protobuf.Duration e2e_latency = 1; | ||
| google.protobuf.Duration preprocessing_duration = 2; | ||
| google.protobuf.Duration inference_duration = 3; | ||
| } | ||
|
|
||
| message TdError { | ||
| string message = 1; | ||
| // error code follows the HTTP status code convention | ||
| // 4xx for client errors | ||
| // 5xx for server errors | ||
| uint32 code = 2; | ||
| } | ||
|
|
||
| // --- Client -> Server --- | ||
|
|
||
| message TdSessionCreate { | ||
| TdSessionSettings settings = 1; | ||
| } | ||
|
|
||
| message TdInputAudio { | ||
| bytes audio = 1; | ||
| google.protobuf.Timestamp created_at = 2; | ||
| } | ||
|
|
||
| message TdInputChatContext { | ||
| repeated ChatMessage messages = 1; | ||
| } | ||
|
|
||
| message TdSessionFlush {} | ||
|
|
||
| message TdSessionClose {} | ||
|
|
||
| message TdInferenceStart { | ||
| string request_id = 1; | ||
| } | ||
|
|
||
| message TdInferenceStop { | ||
| string request_id = 1; | ||
| } | ||
|
|
||
| message TdClientMessage { | ||
| oneof message { | ||
| TdSessionCreate session_create = 1; | ||
| TdInputAudio input_audio = 2; | ||
| TdInputChatContext input_chat_context = 3; | ||
| TdSessionFlush session_flush = 4; | ||
| TdSessionClose session_close = 5; | ||
| TdInferenceStart inference_start = 6; | ||
| TdInferenceStop inference_stop = 7; | ||
| } | ||
| google.protobuf.Timestamp created_at = 8; | ||
| } | ||
|
|
||
| // --- Server -> Model --- | ||
|
|
||
| message TdInferenceRequest { | ||
| bytes audio = 1; | ||
| string assistant_text = 2; | ||
| TdAudioEncoding encoding = 3; | ||
| uint32 sample_rate = 4; | ||
| } | ||
|
|
||
| // --- Model -> Server --- | ||
|
|
||
| message TdInferenceResponse { | ||
| float probability = 1; | ||
| TdInferenceStats stats = 2; | ||
| } | ||
|
|
||
| // --- Server -> Client --- | ||
|
|
||
| message TdSessionCreated {} | ||
|
|
||
| message TdProcessingStats { | ||
| google.protobuf.Timestamp earliest_client_created_at = 1; | ||
| google.protobuf.Timestamp latest_client_created_at = 2; | ||
| // server-side E2E latency | ||
| google.protobuf.Duration e2e_latency = 3; | ||
| // stats including model-side E2E latency | ||
| TdInferenceStats inference_stats = 4; | ||
| } | ||
|
|
||
| message TdEouPrediction { | ||
| float probability = 1; | ||
| TdProcessingStats processing_stats = 2; | ||
| } | ||
|
|
||
| message TdInferenceStarted {} | ||
|
|
||
| message TdInferenceStopped {} | ||
|
|
||
| message TdSessionClosed {} | ||
|
|
||
| message TdServerMessage { | ||
| oneof message { | ||
| TdSessionCreated session_created = 1; | ||
| TdInferenceStarted inference_started = 2; | ||
| TdInferenceStopped inference_stopped = 3; | ||
| TdEouPrediction eou_prediction = 4; | ||
| TdSessionClosed session_closed = 5; | ||
| TdError error = 6; | ||
| } | ||
| optional string request_id = 7; | ||
| google.protobuf.Timestamp server_created_at = 8; | ||
| optional google.protobuf.Timestamp client_created_at = 9; | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we split this into a Request/Response message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the RemoteSession, I have Request/Response and events
https://github.com/livekit/protocol/blob/main/protobufs/agent/livekit_agent_session.proto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nit tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it depends on how you look at them: e.g.
TdInferenceStartandTdInferenceStartedis a Request-and-Response pair, we just wrap all the requests and responses inTdClientMessageandTdServerMessage.