github.com/livekit/protocol@v1.39.3/protobufs/rpc/agent.proto (about)

     1  // Copyright 2023 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  syntax = "proto3";
    16  
    17  package rpc;
    18  
    19  option go_package = "github.com/livekit/protocol/rpc";
    20  
    21  import "google/protobuf/empty.proto";
    22  import "options.proto";
    23  import "livekit_agent.proto";
    24  
    25  service AgentInternal {
    26    rpc CheckEnabled(CheckEnabledRequest) returns (CheckEnabledResponse) {
    27      option (psrpc.options).multi = true;
    28    };
    29    rpc JobRequest(livekit.Job) returns (JobRequestResponse) {
    30      option (psrpc.options) = {
    31        affinity_func: true
    32        topics: true
    33        topic_params: {
    34          names: ["namespace", "job_type"]
    35          typed: false
    36        }
    37      };
    38    };
    39    rpc JobTerminate(JobTerminateRequest) returns (JobTerminateResponse) {
    40      option (psrpc.options) = {
    41        topics: true
    42        topic_params: {
    43          names: ["job_id"]
    44          typed: false
    45        }
    46      };
    47    }
    48    rpc WorkerRegistered(google.protobuf.Empty) returns (google.protobuf.Empty) {
    49      option (psrpc.options) = {
    50        subscription: true
    51        multi: true
    52        topics: true
    53        topic_params: {
    54          names: ["handler_namespace"]
    55          typed: false
    56        }
    57      };
    58    };
    59  }
    60  
    61  enum JobTerminateReason {
    62    TERMINATION_REQUESTED = 0;
    63    AGENT_LEFT_ROOM = 1;
    64  }
    65  
    66  message CheckEnabledRequest{}
    67  
    68  message CheckEnabledResponse {
    69    bool room_enabled = 1;
    70    bool publisher_enabled = 2;
    71    bool participant_enabled = 5;
    72    repeated string namespaces = 3 [deprecated = true];
    73    repeated string agent_names = 4;
    74  
    75    // NEXT ID: 6
    76  }
    77  
    78  message JobRequestResponse {
    79    livekit.JobState state = 1;
    80  }
    81  
    82  message JobTerminateRequest {
    83    string job_id = 1;
    84    JobTerminateReason reason = 2;
    85  }
    86  
    87  message JobTerminateResponse {
    88    livekit.JobState state = 1;
    89  }
    90