You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

agent_worker.proto 3.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. syntax = "proto3";
  2. package agents;
  3. option csharp_namespace = "Microsoft.AutoGen.Protobuf";
  4. import "cloudevent.proto";
  5. import "google/protobuf/any.proto";
  6. message AgentId {
  7. string type = 1;
  8. string key = 2;
  9. }
  10. message Payload {
  11. string data_type = 1;
  12. string data_content_type = 2;
  13. bytes data = 3;
  14. }
  15. message RpcRequest {
  16. string request_id = 1;
  17. optional AgentId source = 2;
  18. AgentId target = 3;
  19. string method = 4;
  20. Payload payload = 5;
  21. map<string, string> metadata = 6;
  22. }
  23. message RpcResponse {
  24. string request_id = 1;
  25. Payload payload = 2;
  26. string error = 3;
  27. map<string, string> metadata = 4;
  28. }
  29. message RegisterAgentTypeRequest {
  30. string type = 1;
  31. }
  32. message RegisterAgentTypeResponse {
  33. }
  34. message TypeSubscription {
  35. string topic_type = 1;
  36. string agent_type = 2;
  37. }
  38. message TypePrefixSubscription {
  39. string topic_type_prefix = 1;
  40. string agent_type = 2;
  41. }
  42. message Subscription {
  43. string id = 1;
  44. oneof subscription {
  45. TypeSubscription typeSubscription = 2;
  46. TypePrefixSubscription typePrefixSubscription = 3;
  47. }
  48. }
  49. message AddSubscriptionRequest {
  50. Subscription subscription = 1;
  51. }
  52. message AddSubscriptionResponse {
  53. }
  54. message RemoveSubscriptionRequest {
  55. string id = 1;
  56. }
  57. message RemoveSubscriptionResponse {
  58. }
  59. message GetSubscriptionsRequest {}
  60. message GetSubscriptionsResponse {
  61. repeated Subscription subscriptions = 1;
  62. }
  63. message Message {
  64. oneof message {
  65. RpcRequest request = 1;
  66. RpcResponse response = 2;
  67. io.cloudevents.v1.CloudEvent cloudEvent = 3;
  68. }
  69. }
  70. message SaveStateRequest {
  71. AgentId agentId = 1;
  72. }
  73. message SaveStateResponse {
  74. string state = 1;
  75. optional string error = 2;
  76. }
  77. message LoadStateRequest {
  78. AgentId agentId = 1;
  79. string state = 2;
  80. }
  81. message LoadStateResponse {
  82. optional string error = 1;
  83. }
  84. message ControlMessage {
  85. // A response message should have the same id as the request message
  86. string rpc_id = 1;
  87. // This is either:
  88. // agentid=AGENT_ID
  89. // clientid=CLIENT_ID
  90. string destination = 2;
  91. // This is either:
  92. // agentid=AGENT_ID
  93. // clientid=CLIENT_ID
  94. // Empty string means the message is a response
  95. optional string respond_to = 3;
  96. // One of:
  97. // SaveStateRequest saveStateRequest = 2;
  98. // SaveStateResponse saveStateResponse = 3;
  99. // LoadStateRequest loadStateRequest = 4;
  100. // LoadStateResponse loadStateResponse = 5;
  101. google.protobuf.Any rpcMessage = 4;
  102. }
  103. service AgentRpc {
  104. rpc OpenChannel (stream Message) returns (stream Message);
  105. rpc OpenControlChannel (stream ControlMessage) returns (stream ControlMessage);
  106. rpc RegisterAgent(RegisterAgentTypeRequest) returns (RegisterAgentTypeResponse);
  107. rpc AddSubscription(AddSubscriptionRequest) returns (AddSubscriptionResponse);
  108. rpc RemoveSubscription(RemoveSubscriptionRequest) returns (RemoveSubscriptionResponse);
  109. rpc GetSubscriptions(GetSubscriptionsRequest) returns (GetSubscriptionsResponse);
  110. }