livekit_protocol/lib.rs
1// Copyright 2025 LiveKit, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![allow(non_snake_case)]
16#![allow(clippy::large_enum_variant)]
17
18include!("livekit.rs");
19
20/// The `livekit.agent` protobuf package: `AgentSessionEvent`, `SessionRequest` and the agent
21/// worker/inference messages. Generated by `generate_proto.sh`; a new package needs its own
22/// `include!` or the types exist on disk and are reachable from nowhere.
23pub mod agent {
24 include!("livekit.agent.rs");
25
26 /// The newest conversation schema a thread's database can hold (protocol's
27 /// `livekit/agent/thread_schema.go`).
28 pub const THREAD_SCHEMA_VERSION: i64 = 1;
29
30 /// Version 1 of the conversation schema inside a thread's database, one statement per `;`
31 /// (comments hold none).
32 pub const THREAD_SCHEMA_V1: &str =
33 include_str!("../protocol/livekit/agent/thread_schema_v1.sql");
34
35 #[cfg(test)]
36 mod tests {
37 use super::*;
38
39 #[test]
40 fn the_thread_schema_matches_protocol() {
41 let go = include_str!("../protocol/livekit/agent/thread_schema.go");
42 assert!(go.contains(&format!("const ThreadSchemaVersion = {THREAD_SCHEMA_VERSION}")));
43 assert!(THREAD_SCHEMA_V1.contains("CREATE TABLE schema_version"));
44 }
45 }
46}
47
48/// The `logger` protobuf package: the `Sensitivity` field annotation enum.
49pub mod logger {
50 include!("logger.rs");
51}