autogen/protos/agent_worker.proto

123 lines
2.4 KiB
Protocol Buffer

syntax = "proto3";
package agents;
option csharp_namespace = "Microsoft.AutoGen.Abstractions";
import "cloudevent.proto";
import "google/protobuf/any.proto";
message TopicId {
string type = 1;
string source = 2;
}
message AgentId {
string type = 1;
string key = 2;
}
message Payload {
string data_type = 1;
string data_content_type = 2;
bytes data = 3;
}
message RpcRequest {
string request_id = 1;
optional AgentId source = 2;
AgentId target = 3;
string method = 4;
Payload payload = 5;
map<string, string> metadata = 6;
}
message RpcResponse {
string request_id = 1;
Payload payload = 2;
string error = 3;
map<string, string> metadata = 4;
}
message Event {
string topic_type = 1;
string topic_source = 2;
optional AgentId source = 3;
Payload payload = 4;
map<string, string> metadata = 5;
}
message RegisterAgentTypeRequest {
string request_id = 1;
string type = 2;
}
message RegisterAgentTypeResponse {
string request_id = 1;
bool success = 2;
optional string error = 3;
}
message TypeSubscription {
string topic_type = 1;
string agent_type = 2;
}
message Subscription {
oneof subscription {
TypeSubscription typeSubscription = 1;
}
}
message AddSubscriptionRequest {
string request_id = 1;
Subscription subscription = 2;
}
message AddSubscriptionResponse {
string request_id = 1;
bool success = 2;
optional string error = 3;
}
service AgentRpc {
rpc OpenChannel (stream Message) returns (stream Message);
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;
}
message Message {
oneof message {
RpcRequest request = 1;
RpcResponse response = 2;
Event event = 3;
RegisterAgentTypeRequest registerAgentTypeRequest = 4;
RegisterAgentTypeResponse registerAgentTypeResponse = 5;
AddSubscriptionRequest addSubscriptionRequest = 6;
AddSubscriptionResponse addSubscriptionResponse = 7;
cloudevent.CloudEvent cloudEvent = 8;
}
}