autogen/protos/agent_worker.proto
Ryan Sweet 55e157cb99
Rysweet refactor 4670 rename abstractions to contracts (#4674)
* refactor renaming agent base

* 1st draft

* 1st draft

* format

* rename the tsts

* move IagentWorker

* 1st draft

* format

* gen-proto

* run gen-proto-samples

* format

* merge problem format
2024-12-12 19:43:26 -08:00

128 lines
2.6 KiB
Protocol Buffer

syntax = "proto3";
package agents;
option csharp_namespace = "Microsoft.AutoGen.Contracts";
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 TypePrefixSubscription {
string topic_type_prefix = 1;
string agent_type = 2;
}
message Subscription {
oneof subscription {
TypeSubscription typeSubscription = 1;
TypePrefixSubscription typePrefixSubscription = 2;
}
}
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;
io.cloudevents.v1.CloudEvent cloudEvent = 3;
RegisterAgentTypeRequest registerAgentTypeRequest = 4;
RegisterAgentTypeResponse registerAgentTypeResponse = 5;
AddSubscriptionRequest addSubscriptionRequest = 6;
AddSubscriptionResponse addSubscriptionResponse = 7;
}
}