Compare commits

...

21 Commits

Author SHA1 Message Date
Chenghao Mou
b1a4596908 Merge remote-tracking branch 'origin/chenghao/feat/turn-detection-proto' into eot-integration
Some checks failed
Generate / generate (push) Has been cancelled
2026-04-22 19:00:40 +08:00
Chenghao Mou
b33d0a7aa2 generated: add eot reporter methods to gatewayobs
Regenerated from cloud-observability schema/gateway.yaml changes that added
eot_requests and eot_request_types. Adds ModelEotRequestTypes enum and
ReportEotRequests / ReportEotRequestTypes methods on ModelTx.

Made-with: Cursor
2026-04-22 18:23:43 +08:00
github-actions
47d6736ff9 generated protobuf 2026-04-22 03:24:32 +00:00
Chenghao Mou
1e496b64cf Merge branch 'chenghao/feat/turn-detection-proto' of https://github.com/livekit/protocol into chenghao/feat/turn-detection-proto 2026-04-22 11:23:27 +08:00
Chenghao Mou
628f3b07bc add backend field 2026-04-22 11:22:59 +08:00
github-actions
9670cbd69d generated protobuf 2026-04-21 09:08:00 +00:00
Chenghao Mou
a84e436abc add file to magefile 2026-04-21 17:07:13 +08:00
Chenghao Mou
d8c306d8d4 Merge branch 'main' into chenghao/feat/turn-detection-proto 2026-04-21 16:59:28 +08:00
Chenghao Mou
720f1f575d address comments 2026-04-21 16:48:37 +08:00
Chenghao Mou
a233c45ca8 rename bargein to interruption 2026-04-20 11:34:23 +08:00
Chenghao Mou
68c05a6330 rename bargein to interruption 2026-04-20 11:33:29 +08:00
Chenghao Mou
2de75f464e Merge branch 'main' into chenghao/feat/turn-detection-proto 2026-04-20 11:25:50 +08:00
Chenghao Mou
9ebcbd5c3d rename 2026-04-20 11:19:39 +08:00
Chenghao Mou
ea0d27e94a refactor 2026-04-20 11:15:45 +08:00
Chenghao Mou
4124981591 rename for eou and interruption 2026-04-20 11:01:11 +08:00
Chenghao Mou
f4d080fb25 add request, response, and prediction 2026-04-10 15:16:16 +08:00
Chenghao Mou
8cc28aa1ee add barge in 2026-04-10 15:02:03 +08:00
Chenghao Mou
0d749fd75f Merge branch 'chenghao/feat/turn-detection-proto' of https://github.com/livekit/protocol into chenghao/feat/turn-detection-proto 2026-04-09 22:23:55 +08:00
Chenghao Mou
d8da1d27ef add num_samples in each audio frame 2026-04-09 22:21:47 +08:00
Chenghao Mou
073003beb2 Create many-seas-fry.md 2026-04-09 16:50:30 +08:00
Chenghao Mou
4be8ffa318 add turn detection protobufs 2026-04-08 11:17:25 +08:00
7 changed files with 2537 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@fake-scope/fake-pkg": patch
---
Add turn detection protobufs

File diff suppressed because it is too large Load Diff

View File

@@ -60,6 +60,7 @@ func Proto() error {
agentProtoFiles := []string{
"agent/livekit_agent_session.proto",
"agent/livekit_agent_dev.proto",
"agent/livekit_agent_inference.proto",
}
protoFiles := []string{

View File

@@ -6,7 +6,7 @@ import (
"time"
)
const Version_NI039G8 = true
const Version_9V68R3G = true
type KeyResolver interface {
Resolve(string)
@@ -85,6 +85,8 @@ type ModelTx interface {
ReportBargeInRequests(v uint64)
ReportBargeInRequestTypes(v ModelBargeInRequestTypes)
ReportVoiceCloneRequests(v uint64)
ReportEotRequests(v uint64)
ReportEotRequestTypes(v ModelEotRequestTypes)
}
type ModelReporter interface {

View File

@@ -137,3 +137,5 @@ func (r *noopModelReporter) ReportTtsChars(v uint32)
func (r *noopModelReporter) ReportBargeInRequests(v uint64) {}
func (r *noopModelReporter) ReportBargeInRequestTypes(v ModelBargeInRequestTypes) {}
func (r *noopModelReporter) ReportVoiceCloneRequests(v uint64) {}
func (r *noopModelReporter) ReportEotRequests(v uint64) {}
func (r *noopModelReporter) ReportEotRequestTypes(v ModelEotRequestTypes) {}

View File

@@ -9,6 +9,14 @@ const (
ModelBargeInRequestTypesSelfHosted ModelBargeInRequestTypes = "self_hosted"
)
type ModelEotRequestTypes string
const (
ModelEotRequestTypesUndefined ModelEotRequestTypes = ""
ModelEotRequestTypesCloud ModelEotRequestTypes = "cloud"
ModelEotRequestTypesSelfHosted ModelEotRequestTypes = "self_hosted"
)
type Rollup string
const (

View File

@@ -0,0 +1,219 @@
// 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";
// --- Shared Types ---
enum AudioEncoding {
AUDIO_ENCODING_PCM_S16LE = 0;
AUDIO_ENCODING_OPUS = 1;
}
message SessionSettings {
uint32 sample_rate = 1;
AudioEncoding encoding = 2;
oneof type_settings {
EotSettings eot_settings = 3;
InterruptionSettings interruption_settings = 4;
}
}
message InferenceError {
string message = 1;
// error code follows the HTTP status code convention
// 4xx for client errors
// 5xx for server errors
uint32 code = 2;
}
// --- End of Turn (EOT) Settings ---
message EotSettings {
google.protobuf.Duration detection_interval = 1;
}
// --- Interruption Settings ---
message InterruptionSettings {
// detection threshold in range [0.0, 1.0]; higher values are less sensitive
float threshold = 1;
// minimum number of frames with probability greater than threshold to trigger an interruption
uint32 min_frames = 2;
google.protobuf.Duration max_audio_duration = 3;
google.protobuf.Duration audio_prefix_duration = 4;
google.protobuf.Duration detection_interval = 5;
}
// --- Client -> Server ---
message SessionCreate {
SessionSettings settings = 1;
}
message InputAudio {
bytes audio = 1;
google.protobuf.Timestamp created_at = 2;
uint32 num_samples = 3;
}
message EotInputChatContext {
repeated ChatMessage messages = 1;
}
message SessionFlush {}
message SessionClose {}
message InferenceStart {
string request_id = 1;
}
message InferenceStop {
string request_id = 1;
}
// audio buffer sentinel messages
message BufferStart {}
message BufferStop {}
message ClientMessage {
google.protobuf.Timestamp created_at = 1;
oneof message {
SessionCreate session_create = 2;
InputAudio input_audio = 3;
SessionFlush session_flush = 4;
SessionClose session_close = 5;
InferenceStart inference_start = 6;
InferenceStop inference_stop = 7;
BufferStart buffer_start = 8;
BufferStop buffer_stop = 9;
// only for end of turn
EotInputChatContext eot_input_chat_context = 10;
}
}
// --- Server -> Model ---
message EotInferenceRequest {
bytes audio = 1;
string assistant_text = 2;
AudioEncoding encoding = 3;
uint32 sample_rate = 4;
}
message InterruptionInferenceRequest {
bytes audio = 1;
AudioEncoding encoding = 2;
uint32 sample_rate = 3;
}
message InferenceRequest {
oneof request {
EotInferenceRequest eot_inference_request = 1;
InterruptionInferenceRequest interruption_inference_request = 2;
}
}
message InferenceStats {
// server-side e2e latency (server input to server output)
google.protobuf.Duration e2e_latency = 1;
google.protobuf.Duration preprocessing_duration = 2;
google.protobuf.Duration inference_duration = 3;
}
message ProcessingStats {
google.protobuf.Timestamp earliest_client_created_at = 1;
google.protobuf.Timestamp latest_client_created_at = 2;
// client-side e2e latency (client send to client receive)
google.protobuf.Duration e2e_latency = 3;
InferenceStats inference_stats = 4;
}
message EotInferenceResponse {
float probability = 1;
InferenceStats stats = 2;
}
message InterruptionInferenceResponse {
bool is_interruption = 1;
// per frame probabilities
repeated float probabilities = 2;
InferenceStats stats = 3;
}
message InferenceResponse {
oneof response {
EotInferenceResponse eot_inference_response = 1;
InterruptionInferenceResponse interruption_inference_response = 2;
}
}
// --- Server -> Client ---
message SessionCreated {}
message InferenceStarted {}
message InferenceStopped {}
message SessionClosed {}
message EotPrediction {
enum EotBackend {
EOT_BACKEND_UNKNOWN = 0;
EOT_BACKEND_MULTIMODAL = 1;
EOT_BACKEND_TEXT = 2;
}
float probability = 1;
ProcessingStats processing_stats = 2;
EotBackend backend = 3;
}
message InterruptionPrediction {
bool is_interruption = 1;
repeated float probabilities = 2;
ProcessingStats processing_stats = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Duration prediction_duration = 5;
}
message ServerMessage {
google.protobuf.Timestamp server_created_at = 1;
optional string request_id = 2;
// echoes the client-side created_at timestamp
optional google.protobuf.Timestamp client_created_at = 3;
oneof message {
SessionCreated session_created = 4;
InferenceStarted inference_started = 5;
InferenceStopped inference_stopped = 6;
SessionClosed session_closed = 7;
InferenceError error = 8;
EotPrediction eot_prediction = 9;
InterruptionPrediction interruption_prediction = 10;
}
}