ai.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. syntax = "proto3";
  2. package api.ai;
  3. import "google/api/annotations.proto";
  4. import "google/protobuf/struct.proto";
  5. import "google/protobuf/empty.proto";
  6. option go_package = "git.ikuban.com/server/pw-protobuf/api/ai;ai";
  7. option java_multiple_files = true;
  8. option java_package = "api.ai";
  9. service Ai {
  10. // 查询AI模板
  11. rpc FindAITemplate (FindAITemplateRequest) returns (FindAITemplateReply){
  12. option (google.api.http) = {
  13. post: "/api/ai/template/list",
  14. body:"*"
  15. };
  16. };
  17. // 创建AI
  18. rpc CreateAIRobot (CreateAIRobotRequest) returns (AIRobotIDReply){
  19. option (google.api.http) = {
  20. post: "/api/ai/create",
  21. body:"*"
  22. };
  23. };
  24. // 销毁AI
  25. rpc DeleteAIRobot (AIRobotIDRequest) returns (google.protobuf.Empty){
  26. option (google.api.http) = {
  27. post: "/api/ai/delete",
  28. body:"*"
  29. };
  30. };
  31. // 更新AI
  32. rpc UpdateAIRobot (UpdateAIRobotRequest) returns (AIRobotIDReply){
  33. option (google.api.http) = {
  34. post: "/api/ai/update",
  35. body:"*"
  36. };
  37. };
  38. // 查询AI机器人列表
  39. rpc FindAIRobotList (FindAIRobotListRequest) returns (AIRobotList){
  40. option (google.api.http) = {
  41. post: "/api/ai/find/list",
  42. body:"*"
  43. };
  44. };
  45. // 查询AI机器人
  46. rpc GetAIRobot (AIRobotIDRequest) returns (AIRobotInfo){
  47. option (google.api.http) = {
  48. post: "/api/ai/find/info",
  49. body:"*"
  50. };
  51. };
  52. // 查询AI聊天记录
  53. rpc FindAIChatRecordList (FindAIChatRecordListRequest) returns (AIRecordListReply){
  54. option (google.api.http) = {
  55. post: "/api/ai/chat/record",
  56. body:"*"
  57. };
  58. };
  59. // 发送消息给ai
  60. rpc SendAIChat (SendAIChatRequest) returns (google.protobuf.Empty){
  61. option (google.api.http) = {
  62. post: "/api/ai/send",
  63. body:"*"
  64. };
  65. };
  66. }
  67. message AIRobotIDReply{
  68. int64 id = 1;
  69. }
  70. message AIRecordListReply{
  71. repeated AIRecordInfo list = 1;
  72. int64 nextId = 2;
  73. }
  74. message AIRecordInfo{
  75. int64 messageId = 1; // 消息的ID
  76. string msgType = 2; // 消息类型
  77. Message message = 3; // 消息的结构
  78. int64 robotId = 4; // 机器人ID
  79. bool isSelf = 5; // 是否是自己
  80. int64 sendTime = 6; // 发送时间
  81. string status = 7; // 消息状态
  82. string statusMsg = 8;// 状态说明
  83. }
  84. message Message{
  85. string content = 1; // 文本内容
  86. }
  87. message SendAIChatRequest{
  88. int64 id = 1;
  89. string message = 2;// 消息
  90. }
  91. message FindAIChatRecordListRequest{
  92. int64 nextId = 1;
  93. int64 offset = 2;
  94. int64 id = 3;
  95. }
  96. message AIRobotList{
  97. int64 nextId = 1;
  98. repeated AIRobotInfo list = 2;
  99. }
  100. message AIRobotInfo{
  101. int64 id = 1;
  102. string name = 2;// ai名称
  103. string avatarUrl = 3;// ai头像
  104. int64 sex = 4;// ai性别
  105. int64 age = 5;// ai年龄
  106. string constellation = 6;// ai星座
  107. int64 lastTime = 7;// 上次发送时间
  108. string lastContent = 8;// 上次发送的内容
  109. int64 unreadNum = 9;// 未读
  110. string status = 10;// 状态
  111. int64 createTime = 11;// 创建时间
  112. }
  113. message FindAIRobotListRequest{
  114. int64 nextId = 1;
  115. int64 offset = 2;
  116. }
  117. message UpdateAIRobotRequest{
  118. int64 id = 1;
  119. string aiName = 2;// 自定义ai名称
  120. string userName = 3;// ai对我的称呼
  121. }
  122. message AIRobotIDRequest{
  123. int64 id = 1;
  124. }
  125. message FindAITemplateRequest{
  126. int64 nextId = 1;
  127. int64 offset = 2;
  128. int64 sex = 3;// 性别
  129. }
  130. message FindAITemplateReply{
  131. int64 nextId = 1;
  132. repeated AITemplateInfo list= 2;
  133. }
  134. message AITemplateInfo{
  135. int64 id = 1;// ai模板ID
  136. string name = 2;// ai名称
  137. string avatarUrl = 3;// ai头像
  138. int64 sex = 4;// ai性别
  139. int64 age = 5;// ai年龄
  140. repeated string label = 6;// ai标签
  141. string description = 7;// ai描述
  142. string constellation = 8;// ai星座
  143. repeated Relation relationList = 9;// ai关系列表
  144. }
  145. message Relation{
  146. int64 id = 1;// 关系ID
  147. string picture = 2;// 图片
  148. string relation = 3;// 关系
  149. }
  150. message CreateAIRobotRequest{
  151. int64 templateId = 1;// ai模板ID
  152. string aiName = 2;// 自定义ai名称
  153. string userName = 3;// ai对我的称呼
  154. int64 relationId = 4;// 关系ID
  155. }