2024-06-28 08:03:42 -07:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package agents;
|
|
|
|
|
2025-01-28 11:15:57 -05:00
|
|
|
option csharp_namespace = "Microsoft.AutoGen.Protobuf";
|
2024-09-24 09:26:30 -07:00
|
|
|
|
2024-09-17 09:01:49 -04:00
|
|
|
import "cloudevent.proto";
|
|
|
|
import "google/protobuf/any.proto";
|
|
|
|
|
|
|
|
|
2024-06-28 08:03:42 -07:00
|
|
|
message AgentId {
|
2024-09-05 16:36:59 -04:00
|
|
|
string type = 1;
|
|
|
|
string key = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Payload {
|
|
|
|
string data_type = 1;
|
|
|
|
string data_content_type = 2;
|
|
|
|
bytes data = 3;
|
2024-06-28 08:03:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message RpcRequest {
|
|
|
|
string request_id = 1;
|
2024-09-13 08:17:53 -07:00
|
|
|
optional AgentId source = 2;
|
2024-06-28 08:03:42 -07:00
|
|
|
AgentId target = 3;
|
|
|
|
string method = 4;
|
2024-09-05 16:36:59 -04:00
|
|
|
Payload payload = 5;
|
|
|
|
map<string, string> metadata = 6;
|
2024-06-28 08:03:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message RpcResponse {
|
|
|
|
string request_id = 1;
|
2024-09-05 16:36:59 -04:00
|
|
|
Payload payload = 2;
|
|
|
|
string error = 3;
|
|
|
|
map<string, string> metadata = 4;
|
2024-06-28 08:03:42 -07:00
|
|
|
}
|
|
|
|
|
2024-09-19 10:50:17 -07:00
|
|
|
message RegisterAgentTypeRequest {
|
2025-01-28 11:15:57 -05:00
|
|
|
string type = 1;
|
2024-09-19 10:50:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message RegisterAgentTypeResponse {
|
2024-06-28 08:03:42 -07:00
|
|
|
}
|
|
|
|
|
2024-08-22 09:07:28 -07:00
|
|
|
message TypeSubscription {
|
|
|
|
string topic_type = 1;
|
|
|
|
string agent_type = 2;
|
|
|
|
}
|
|
|
|
|
2024-11-26 15:58:26 -05:00
|
|
|
message TypePrefixSubscription {
|
|
|
|
string topic_type_prefix = 1;
|
|
|
|
string agent_type = 2;
|
|
|
|
}
|
|
|
|
|
2024-08-22 09:07:28 -07:00
|
|
|
message Subscription {
|
2025-01-23 17:46:47 -05:00
|
|
|
string id = 1;
|
2024-08-22 09:07:28 -07:00
|
|
|
oneof subscription {
|
2025-01-23 17:46:47 -05:00
|
|
|
TypeSubscription typeSubscription = 2;
|
|
|
|
TypePrefixSubscription typePrefixSubscription = 3;
|
2024-08-22 09:07:28 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-19 10:50:17 -07:00
|
|
|
message AddSubscriptionRequest {
|
2025-01-28 11:15:57 -05:00
|
|
|
Subscription subscription = 1;
|
2024-09-19 10:50:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddSubscriptionResponse {
|
2024-08-22 09:07:28 -07:00
|
|
|
}
|
|
|
|
|
2025-01-23 17:46:47 -05:00
|
|
|
message RemoveSubscriptionRequest {
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveSubscriptionResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetSubscriptionsRequest {}
|
|
|
|
message GetSubscriptionsResponse {
|
|
|
|
repeated Subscription subscriptions = 1;
|
|
|
|
}
|
|
|
|
|
2024-06-28 08:03:42 -07:00
|
|
|
message Message {
|
|
|
|
oneof message {
|
|
|
|
RpcRequest request = 1;
|
|
|
|
RpcResponse response = 2;
|
2024-12-10 01:26:53 -05:00
|
|
|
io.cloudevents.v1.CloudEvent cloudEvent = 3;
|
2024-06-28 08:03:42 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-06 16:54:21 -05:00
|
|
|
message SaveStateRequest {
|
|
|
|
AgentId agentId = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SaveStateResponse {
|
|
|
|
string state = 1;
|
|
|
|
optional string error = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoadStateRequest {
|
|
|
|
AgentId agentId = 1;
|
|
|
|
string state = 2;
|
|
|
|
}
|
|
|
|
message LoadStateResponse {
|
|
|
|
optional string error = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ControlMessage {
|
|
|
|
// A response message should have the same id as the request message
|
|
|
|
string rpc_id = 1;
|
|
|
|
// This is either:
|
|
|
|
// agentid=AGENT_ID
|
|
|
|
// clientid=CLIENT_ID
|
|
|
|
string destination = 2;
|
|
|
|
// This is either:
|
|
|
|
// agentid=AGENT_ID
|
|
|
|
// clientid=CLIENT_ID
|
|
|
|
// Empty string means the message is a response
|
|
|
|
optional string respond_to = 3;
|
|
|
|
// One of:
|
|
|
|
// SaveStateRequest saveStateRequest = 2;
|
|
|
|
// SaveStateResponse saveStateResponse = 3;
|
|
|
|
// LoadStateRequest loadStateRequest = 4;
|
|
|
|
// LoadStateResponse loadStateResponse = 5;
|
|
|
|
google.protobuf.Any rpcMessage = 4;
|
|
|
|
}
|
|
|
|
|
2025-01-28 11:15:57 -05:00
|
|
|
service AgentRpc {
|
|
|
|
rpc OpenChannel (stream Message) returns (stream Message);
|
2025-02-06 16:54:21 -05:00
|
|
|
rpc OpenControlChannel (stream ControlMessage) returns (stream ControlMessage);
|
2025-01-28 11:15:57 -05:00
|
|
|
rpc RegisterAgent(RegisterAgentTypeRequest) returns (RegisterAgentTypeResponse);
|
|
|
|
rpc AddSubscription(AddSubscriptionRequest) returns (AddSubscriptionResponse);
|
|
|
|
rpc RemoveSubscription(RemoveSubscriptionRequest) returns (RemoveSubscriptionResponse);
|
|
|
|
rpc GetSubscriptions(GetSubscriptionsRequest) returns (GetSubscriptionsResponse);
|
|
|
|
}
|