ai_grpc.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package ai
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. emptypb "google.golang.org/protobuf/types/known/emptypb"
  9. )
  10. // This is a compile-time assertion to ensure that this generated file
  11. // is compatible with the grpc package it is being compiled against.
  12. // Requires gRPC-Go v1.32.0 or later.
  13. const _ = grpc.SupportPackageIsVersion7
  14. // AiClient is the client API for Ai service.
  15. //
  16. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  17. type AiClient interface {
  18. // 查询AI模板
  19. FindAITemplate(ctx context.Context, in *FindAITemplateRequest, opts ...grpc.CallOption) (*FindAITemplateReply, error)
  20. // 创建AI
  21. CreateAIRobot(ctx context.Context, in *CreateAIRobotRequest, opts ...grpc.CallOption) (*AIRobotIDReply, error)
  22. // 销毁AI
  23. DeleteAIRobot(ctx context.Context, in *AIRobotIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  24. // 更新AI
  25. UpdateAIRobot(ctx context.Context, in *UpdateAIRobotRequest, opts ...grpc.CallOption) (*AIRobotIDReply, error)
  26. // 查询AI机器人列表
  27. FindAIRobotList(ctx context.Context, in *FindAIRobotListRequest, opts ...grpc.CallOption) (*AIRobotList, error)
  28. // 查询AI机器人
  29. GetAIRobot(ctx context.Context, in *AIRobotIDRequest, opts ...grpc.CallOption) (*AIRobotInfo, error)
  30. // 查询AI聊天记录
  31. FindAIChatRecordList(ctx context.Context, in *FindAIChatRecordListRequest, opts ...grpc.CallOption) (*AIRecordListReply, error)
  32. // 发送消息给ai
  33. SendAIChat(ctx context.Context, in *SendAIChatRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  34. }
  35. type aiClient struct {
  36. cc grpc.ClientConnInterface
  37. }
  38. func NewAiClient(cc grpc.ClientConnInterface) AiClient {
  39. return &aiClient{cc}
  40. }
  41. func (c *aiClient) FindAITemplate(ctx context.Context, in *FindAITemplateRequest, opts ...grpc.CallOption) (*FindAITemplateReply, error) {
  42. out := new(FindAITemplateReply)
  43. err := c.cc.Invoke(ctx, "/api.ai.Ai/FindAITemplate", in, out, opts...)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *aiClient) CreateAIRobot(ctx context.Context, in *CreateAIRobotRequest, opts ...grpc.CallOption) (*AIRobotIDReply, error) {
  50. out := new(AIRobotIDReply)
  51. err := c.cc.Invoke(ctx, "/api.ai.Ai/CreateAIRobot", in, out, opts...)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *aiClient) DeleteAIRobot(ctx context.Context, in *AIRobotIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  58. out := new(emptypb.Empty)
  59. err := c.cc.Invoke(ctx, "/api.ai.Ai/DeleteAIRobot", in, out, opts...)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *aiClient) UpdateAIRobot(ctx context.Context, in *UpdateAIRobotRequest, opts ...grpc.CallOption) (*AIRobotIDReply, error) {
  66. out := new(AIRobotIDReply)
  67. err := c.cc.Invoke(ctx, "/api.ai.Ai/UpdateAIRobot", in, out, opts...)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. func (c *aiClient) FindAIRobotList(ctx context.Context, in *FindAIRobotListRequest, opts ...grpc.CallOption) (*AIRobotList, error) {
  74. out := new(AIRobotList)
  75. err := c.cc.Invoke(ctx, "/api.ai.Ai/FindAIRobotList", in, out, opts...)
  76. if err != nil {
  77. return nil, err
  78. }
  79. return out, nil
  80. }
  81. func (c *aiClient) GetAIRobot(ctx context.Context, in *AIRobotIDRequest, opts ...grpc.CallOption) (*AIRobotInfo, error) {
  82. out := new(AIRobotInfo)
  83. err := c.cc.Invoke(ctx, "/api.ai.Ai/GetAIRobot", in, out, opts...)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return out, nil
  88. }
  89. func (c *aiClient) FindAIChatRecordList(ctx context.Context, in *FindAIChatRecordListRequest, opts ...grpc.CallOption) (*AIRecordListReply, error) {
  90. out := new(AIRecordListReply)
  91. err := c.cc.Invoke(ctx, "/api.ai.Ai/FindAIChatRecordList", in, out, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. return out, nil
  96. }
  97. func (c *aiClient) SendAIChat(ctx context.Context, in *SendAIChatRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  98. out := new(emptypb.Empty)
  99. err := c.cc.Invoke(ctx, "/api.ai.Ai/SendAIChat", in, out, opts...)
  100. if err != nil {
  101. return nil, err
  102. }
  103. return out, nil
  104. }
  105. // AiServer is the server API for Ai service.
  106. // All implementations must embed UnimplementedAiServer
  107. // for forward compatibility
  108. type AiServer interface {
  109. // 查询AI模板
  110. FindAITemplate(context.Context, *FindAITemplateRequest) (*FindAITemplateReply, error)
  111. // 创建AI
  112. CreateAIRobot(context.Context, *CreateAIRobotRequest) (*AIRobotIDReply, error)
  113. // 销毁AI
  114. DeleteAIRobot(context.Context, *AIRobotIDRequest) (*emptypb.Empty, error)
  115. // 更新AI
  116. UpdateAIRobot(context.Context, *UpdateAIRobotRequest) (*AIRobotIDReply, error)
  117. // 查询AI机器人列表
  118. FindAIRobotList(context.Context, *FindAIRobotListRequest) (*AIRobotList, error)
  119. // 查询AI机器人
  120. GetAIRobot(context.Context, *AIRobotIDRequest) (*AIRobotInfo, error)
  121. // 查询AI聊天记录
  122. FindAIChatRecordList(context.Context, *FindAIChatRecordListRequest) (*AIRecordListReply, error)
  123. // 发送消息给ai
  124. SendAIChat(context.Context, *SendAIChatRequest) (*emptypb.Empty, error)
  125. mustEmbedUnimplementedAiServer()
  126. }
  127. // UnimplementedAiServer must be embedded to have forward compatible implementations.
  128. type UnimplementedAiServer struct {
  129. }
  130. func (UnimplementedAiServer) FindAITemplate(context.Context, *FindAITemplateRequest) (*FindAITemplateReply, error) {
  131. return nil, status.Errorf(codes.Unimplemented, "method FindAITemplate not implemented")
  132. }
  133. func (UnimplementedAiServer) CreateAIRobot(context.Context, *CreateAIRobotRequest) (*AIRobotIDReply, error) {
  134. return nil, status.Errorf(codes.Unimplemented, "method CreateAIRobot not implemented")
  135. }
  136. func (UnimplementedAiServer) DeleteAIRobot(context.Context, *AIRobotIDRequest) (*emptypb.Empty, error) {
  137. return nil, status.Errorf(codes.Unimplemented, "method DeleteAIRobot not implemented")
  138. }
  139. func (UnimplementedAiServer) UpdateAIRobot(context.Context, *UpdateAIRobotRequest) (*AIRobotIDReply, error) {
  140. return nil, status.Errorf(codes.Unimplemented, "method UpdateAIRobot not implemented")
  141. }
  142. func (UnimplementedAiServer) FindAIRobotList(context.Context, *FindAIRobotListRequest) (*AIRobotList, error) {
  143. return nil, status.Errorf(codes.Unimplemented, "method FindAIRobotList not implemented")
  144. }
  145. func (UnimplementedAiServer) GetAIRobot(context.Context, *AIRobotIDRequest) (*AIRobotInfo, error) {
  146. return nil, status.Errorf(codes.Unimplemented, "method GetAIRobot not implemented")
  147. }
  148. func (UnimplementedAiServer) FindAIChatRecordList(context.Context, *FindAIChatRecordListRequest) (*AIRecordListReply, error) {
  149. return nil, status.Errorf(codes.Unimplemented, "method FindAIChatRecordList not implemented")
  150. }
  151. func (UnimplementedAiServer) SendAIChat(context.Context, *SendAIChatRequest) (*emptypb.Empty, error) {
  152. return nil, status.Errorf(codes.Unimplemented, "method SendAIChat not implemented")
  153. }
  154. func (UnimplementedAiServer) mustEmbedUnimplementedAiServer() {}
  155. // UnsafeAiServer may be embedded to opt out of forward compatibility for this service.
  156. // Use of this interface is not recommended, as added methods to AiServer will
  157. // result in compilation errors.
  158. type UnsafeAiServer interface {
  159. mustEmbedUnimplementedAiServer()
  160. }
  161. func RegisterAiServer(s grpc.ServiceRegistrar, srv AiServer) {
  162. s.RegisterService(&Ai_ServiceDesc, srv)
  163. }
  164. func _Ai_FindAITemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  165. in := new(FindAITemplateRequest)
  166. if err := dec(in); err != nil {
  167. return nil, err
  168. }
  169. if interceptor == nil {
  170. return srv.(AiServer).FindAITemplate(ctx, in)
  171. }
  172. info := &grpc.UnaryServerInfo{
  173. Server: srv,
  174. FullMethod: "/api.ai.Ai/FindAITemplate",
  175. }
  176. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  177. return srv.(AiServer).FindAITemplate(ctx, req.(*FindAITemplateRequest))
  178. }
  179. return interceptor(ctx, in, info, handler)
  180. }
  181. func _Ai_CreateAIRobot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  182. in := new(CreateAIRobotRequest)
  183. if err := dec(in); err != nil {
  184. return nil, err
  185. }
  186. if interceptor == nil {
  187. return srv.(AiServer).CreateAIRobot(ctx, in)
  188. }
  189. info := &grpc.UnaryServerInfo{
  190. Server: srv,
  191. FullMethod: "/api.ai.Ai/CreateAIRobot",
  192. }
  193. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  194. return srv.(AiServer).CreateAIRobot(ctx, req.(*CreateAIRobotRequest))
  195. }
  196. return interceptor(ctx, in, info, handler)
  197. }
  198. func _Ai_DeleteAIRobot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  199. in := new(AIRobotIDRequest)
  200. if err := dec(in); err != nil {
  201. return nil, err
  202. }
  203. if interceptor == nil {
  204. return srv.(AiServer).DeleteAIRobot(ctx, in)
  205. }
  206. info := &grpc.UnaryServerInfo{
  207. Server: srv,
  208. FullMethod: "/api.ai.Ai/DeleteAIRobot",
  209. }
  210. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  211. return srv.(AiServer).DeleteAIRobot(ctx, req.(*AIRobotIDRequest))
  212. }
  213. return interceptor(ctx, in, info, handler)
  214. }
  215. func _Ai_UpdateAIRobot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  216. in := new(UpdateAIRobotRequest)
  217. if err := dec(in); err != nil {
  218. return nil, err
  219. }
  220. if interceptor == nil {
  221. return srv.(AiServer).UpdateAIRobot(ctx, in)
  222. }
  223. info := &grpc.UnaryServerInfo{
  224. Server: srv,
  225. FullMethod: "/api.ai.Ai/UpdateAIRobot",
  226. }
  227. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  228. return srv.(AiServer).UpdateAIRobot(ctx, req.(*UpdateAIRobotRequest))
  229. }
  230. return interceptor(ctx, in, info, handler)
  231. }
  232. func _Ai_FindAIRobotList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  233. in := new(FindAIRobotListRequest)
  234. if err := dec(in); err != nil {
  235. return nil, err
  236. }
  237. if interceptor == nil {
  238. return srv.(AiServer).FindAIRobotList(ctx, in)
  239. }
  240. info := &grpc.UnaryServerInfo{
  241. Server: srv,
  242. FullMethod: "/api.ai.Ai/FindAIRobotList",
  243. }
  244. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  245. return srv.(AiServer).FindAIRobotList(ctx, req.(*FindAIRobotListRequest))
  246. }
  247. return interceptor(ctx, in, info, handler)
  248. }
  249. func _Ai_GetAIRobot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  250. in := new(AIRobotIDRequest)
  251. if err := dec(in); err != nil {
  252. return nil, err
  253. }
  254. if interceptor == nil {
  255. return srv.(AiServer).GetAIRobot(ctx, in)
  256. }
  257. info := &grpc.UnaryServerInfo{
  258. Server: srv,
  259. FullMethod: "/api.ai.Ai/GetAIRobot",
  260. }
  261. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  262. return srv.(AiServer).GetAIRobot(ctx, req.(*AIRobotIDRequest))
  263. }
  264. return interceptor(ctx, in, info, handler)
  265. }
  266. func _Ai_FindAIChatRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  267. in := new(FindAIChatRecordListRequest)
  268. if err := dec(in); err != nil {
  269. return nil, err
  270. }
  271. if interceptor == nil {
  272. return srv.(AiServer).FindAIChatRecordList(ctx, in)
  273. }
  274. info := &grpc.UnaryServerInfo{
  275. Server: srv,
  276. FullMethod: "/api.ai.Ai/FindAIChatRecordList",
  277. }
  278. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  279. return srv.(AiServer).FindAIChatRecordList(ctx, req.(*FindAIChatRecordListRequest))
  280. }
  281. return interceptor(ctx, in, info, handler)
  282. }
  283. func _Ai_SendAIChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  284. in := new(SendAIChatRequest)
  285. if err := dec(in); err != nil {
  286. return nil, err
  287. }
  288. if interceptor == nil {
  289. return srv.(AiServer).SendAIChat(ctx, in)
  290. }
  291. info := &grpc.UnaryServerInfo{
  292. Server: srv,
  293. FullMethod: "/api.ai.Ai/SendAIChat",
  294. }
  295. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  296. return srv.(AiServer).SendAIChat(ctx, req.(*SendAIChatRequest))
  297. }
  298. return interceptor(ctx, in, info, handler)
  299. }
  300. // Ai_ServiceDesc is the grpc.ServiceDesc for Ai service.
  301. // It's only intended for direct use with grpc.RegisterService,
  302. // and not to be introspected or modified (even as a copy)
  303. var Ai_ServiceDesc = grpc.ServiceDesc{
  304. ServiceName: "api.ai.Ai",
  305. HandlerType: (*AiServer)(nil),
  306. Methods: []grpc.MethodDesc{
  307. {
  308. MethodName: "FindAITemplate",
  309. Handler: _Ai_FindAITemplate_Handler,
  310. },
  311. {
  312. MethodName: "CreateAIRobot",
  313. Handler: _Ai_CreateAIRobot_Handler,
  314. },
  315. {
  316. MethodName: "DeleteAIRobot",
  317. Handler: _Ai_DeleteAIRobot_Handler,
  318. },
  319. {
  320. MethodName: "UpdateAIRobot",
  321. Handler: _Ai_UpdateAIRobot_Handler,
  322. },
  323. {
  324. MethodName: "FindAIRobotList",
  325. Handler: _Ai_FindAIRobotList_Handler,
  326. },
  327. {
  328. MethodName: "GetAIRobot",
  329. Handler: _Ai_GetAIRobot_Handler,
  330. },
  331. {
  332. MethodName: "FindAIChatRecordList",
  333. Handler: _Ai_FindAIChatRecordList_Handler,
  334. },
  335. {
  336. MethodName: "SendAIChat",
  337. Handler: _Ai_SendAIChat_Handler,
  338. },
  339. },
  340. Streams: []grpc.StreamDesc{},
  341. Metadata: "ai.proto",
  342. }