2024-06-28 23:03:42 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package agents;
|
|
|
|
|
2024-10-17 11:09:39 +08:00
|
|
|
option csharp_namespace = "Microsoft.AutoGen.Abstractions";
|
2024-09-25 00:26:30 +08:00
|
|
|
|
2024-09-17 21:01:49 +08:00
|
|
|
import "cloudevent.proto";
|
|
|
|
import "google/protobuf/any.proto";
|
|
|
|
|
|
|
|
message TopicId {
|
|
|
|
string type = 1;
|
|
|
|
string source = 2;
|
|
|
|
}
|
|
|
|
|
2024-06-28 23:03:42 +08:00
|
|
|
message AgentId {
|
2024-09-06 04:36:59 +08:00
|
|
|
string type = 1;
|
|
|
|
string key = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Payload {
|
|
|
|
string data_type = 1;
|
|
|
|
string data_content_type = 2;
|
|
|
|
bytes data = 3;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message RpcRequest {
|
|
|
|
string request_id = 1;
|
2024-09-13 23:17:53 +08:00
|
|
|
optional AgentId source = 2;
|
2024-06-28 23:03:42 +08:00
|
|
|
AgentId target = 3;
|
|
|
|
string method = 4;
|
2024-09-06 04:36:59 +08:00
|
|
|
Payload payload = 5;
|
|
|
|
map<string, string> metadata = 6;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message RpcResponse {
|
|
|
|
string request_id = 1;
|
2024-09-06 04:36:59 +08:00
|
|
|
Payload payload = 2;
|
|
|
|
string error = 3;
|
|
|
|
map<string, string> metadata = 4;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message Event {
|
2024-09-06 04:36:59 +08:00
|
|
|
string topic_type = 1;
|
|
|
|
string topic_source = 2;
|
2024-09-13 23:17:53 +08:00
|
|
|
optional AgentId source = 3;
|
|
|
|
Payload payload = 4;
|
|
|
|
map<string, string> metadata = 5;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
2024-09-20 01:50:17 +08:00
|
|
|
message RegisterAgentTypeRequest {
|
|
|
|
string request_id = 1;
|
|
|
|
string type = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RegisterAgentTypeResponse {
|
|
|
|
string request_id = 1;
|
|
|
|
bool success = 2;
|
|
|
|
optional string error = 3;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
2024-08-23 00:07:28 +08:00
|
|
|
message TypeSubscription {
|
|
|
|
string topic_type = 1;
|
|
|
|
string agent_type = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Subscription {
|
|
|
|
oneof subscription {
|
|
|
|
TypeSubscription typeSubscription = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-20 01:50:17 +08:00
|
|
|
message AddSubscriptionRequest {
|
|
|
|
string request_id = 1;
|
|
|
|
Subscription subscription = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AddSubscriptionResponse {
|
|
|
|
string request_id = 1;
|
|
|
|
bool success = 2;
|
|
|
|
optional string error = 3;
|
2024-08-23 00:07:28 +08:00
|
|
|
}
|
|
|
|
|
2024-06-28 23:03:42 +08:00
|
|
|
service AgentRpc {
|
|
|
|
rpc OpenChannel (stream Message) returns (stream Message);
|
2024-10-29 08:28:36 +08:00
|
|
|
rpc GetState(AgentId) returns (GetStateResponse);
|
|
|
|
rpc SaveState(AgentState) returns (SaveStateResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
message AgentState {
|
|
|
|
AgentId agent_id = 1;
|
|
|
|
string eTag = 2;
|
|
|
|
oneof data {
|
|
|
|
bytes binary_data = 3;
|
|
|
|
string text_data = 4;
|
|
|
|
google.protobuf.Any proto_data = 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetStateResponse {
|
|
|
|
AgentState agent_state = 1;
|
|
|
|
bool success = 2;
|
|
|
|
optional string error = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SaveStateResponse {
|
|
|
|
bool success = 1;
|
|
|
|
optional string error = 2;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message Message {
|
|
|
|
oneof message {
|
|
|
|
RpcRequest request = 1;
|
|
|
|
RpcResponse response = 2;
|
2024-09-17 22:11:17 +08:00
|
|
|
Event event = 3;
|
2024-09-20 01:50:17 +08:00
|
|
|
RegisterAgentTypeRequest registerAgentTypeRequest = 4;
|
|
|
|
RegisterAgentTypeResponse registerAgentTypeResponse = 5;
|
|
|
|
AddSubscriptionRequest addSubscriptionRequest = 6;
|
|
|
|
AddSubscriptionResponse addSubscriptionResponse = 7;
|
|
|
|
cloudevent.CloudEvent cloudEvent = 8;
|
2024-06-28 23:03:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|