Documentation ¶
Index ¶
- Constants
- Variables
- func GetAi(uuid string) *typex.AI
- func GetRuleX() typex.RuleX
- func ListAi() []*typex.AI
- func LoadAi(Ai *typex.AI) error
- func NewBodyPoseRecognition(re typex.RuleX) typex.XAi
- func RegisterAIBaseServiceServer(s grpc.ServiceRegistrar, srv AIBaseServiceServer)
- func RemoveAi(uuid string) error
- func StartAi(uuid string) error
- func StartTestServer()
- func Stop()
- func StopAi(uuid string) error
- func UpdateAi(Ai *typex.AI) error
- type AIBaseServiceClient
- type AIBaseServiceServer
- type AIBaseService_StreamClient
- type AIBaseService_StreamServer
- type AIRuntime
- type AiBaseServer
- type Algorithm
- type AlgorithmResource
- type BodyPoseRecognition
- type CallRequest
- type CallResponse
- type StreamRequest
- type StreamResponse
- type UnimplementedAIBaseServiceServer
- type UnsafeAIBaseServiceServer
Constants ¶
const ( AIBaseService_Call_FullMethodName = "/aibase.AIBaseService/Call" AIBaseService_Stream_FullMethodName = "/aibase.AIBaseService/Stream" )
Variables ¶
var AIBaseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aibase.AIBaseService", HandlerType: (*AIBaseServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Call", Handler: _AIBaseService_Call_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Stream", Handler: _AIBaseService_Stream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "aibase.proto", }
AIBaseService_ServiceDesc is the grpc.ServiceDesc for AIBaseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_aibase_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAIBaseServiceServer ¶ added in v0.6.7
func RegisterAIBaseServiceServer(s grpc.ServiceRegistrar, srv AIBaseServiceServer)
func StartTestServer ¶ added in v0.6.7
func StartTestServer()
Types ¶
type AIBaseServiceClient ¶ added in v0.6.7
type AIBaseServiceClient interface { // 普通请求 Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error) // 流式请求 Stream(ctx context.Context, opts ...grpc.CallOption) (AIBaseService_StreamClient, error) }
AIBaseServiceClient is the client API for AIBaseService service.
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.
func NewAIBaseServiceClient ¶ added in v0.6.7
func NewAIBaseServiceClient(cc grpc.ClientConnInterface) AIBaseServiceClient
type AIBaseServiceServer ¶ added in v0.6.7
type AIBaseServiceServer interface { // 普通请求 Call(context.Context, *CallRequest) (*CallResponse, error) // 流式请求 Stream(AIBaseService_StreamServer) error // contains filtered or unexported methods }
AIBaseServiceServer is the server API for AIBaseService service. All implementations must embed UnimplementedAIBaseServiceServer for forward compatibility
type AIBaseService_StreamClient ¶ added in v0.6.7
type AIBaseService_StreamClient interface { Send(*StreamRequest) error Recv() (*StreamResponse, error) grpc.ClientStream }
type AIBaseService_StreamServer ¶ added in v0.6.7
type AIBaseService_StreamServer interface { Send(*StreamResponse) error Recv() (*StreamRequest, error) grpc.ServerStream }
type AiBaseServer ¶ added in v0.6.7
type AiBaseServer struct {
UnimplementedAIBaseServiceServer
}
func (*AiBaseServer) Call ¶ added in v0.6.7
func (s *AiBaseServer) Call(ctx context.Context, req *CallRequest) (resp *CallResponse, err error)
func (*AiBaseServer) Stream ¶ added in v0.6.7
func (s *AiBaseServer) Stream(s1 AIBaseService_StreamServer) error
流式请求
type Algorithm ¶
type Algorithm struct { UUID string // UUID Type string // 模型类型: ANN_APP1 RNN_APP2 CNN_APP3 .... Name string // 名称 State int // 0开启;1关闭 Document string // 文档连接 Description string // 概述 }
* * 算法模型 *
type AlgorithmResource ¶
type AlgorithmResource interface { Init(map[string]interface{}) error // 初始化环境 // Type , Sample, ExpectOut Train(string, [][]float64, [][]float64) error // 训练模型 Load() error // 加载模型 OnCall(string, [][]float64) map[string]interface{} // 用数据去执行 Unload() error // 卸载模型 AiDetail() Algorithm // 获取信息 }
* * AI 接口 *
type BodyPoseRecognition ¶
type BodyPoseRecognition struct { }
func (*BodyPoseRecognition) Infer ¶
func (ba *BodyPoseRecognition) Infer(input [][]float64) [][]float64
func (*BodyPoseRecognition) Start ¶
func (ba *BodyPoseRecognition) Start(map[string]interface{}) error
func (*BodyPoseRecognition) Stop ¶
func (ba *BodyPoseRecognition) Stop()
type CallRequest ¶ added in v0.6.7
type CallRequest struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CallRequest) Descriptor
deprecated
added in
v0.6.7
func (*CallRequest) Descriptor() ([]byte, []int)
Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.
func (*CallRequest) GetData ¶ added in v0.6.7
func (x *CallRequest) GetData() []byte
func (*CallRequest) ProtoMessage ¶ added in v0.6.7
func (*CallRequest) ProtoMessage()
func (*CallRequest) ProtoReflect ¶ added in v0.6.7
func (x *CallRequest) ProtoReflect() protoreflect.Message
func (*CallRequest) Reset ¶ added in v0.6.7
func (x *CallRequest) Reset()
func (*CallRequest) String ¶ added in v0.6.7
func (x *CallRequest) String() string
type CallResponse ¶ added in v0.6.7
type CallResponse struct { Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*CallResponse) Descriptor
deprecated
added in
v0.6.7
func (*CallResponse) Descriptor() ([]byte, []int)
Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.
func (*CallResponse) GetResult ¶ added in v0.6.7
func (x *CallResponse) GetResult() []byte
func (*CallResponse) ProtoMessage ¶ added in v0.6.7
func (*CallResponse) ProtoMessage()
func (*CallResponse) ProtoReflect ¶ added in v0.6.7
func (x *CallResponse) ProtoReflect() protoreflect.Message
func (*CallResponse) Reset ¶ added in v0.6.7
func (x *CallResponse) Reset()
func (*CallResponse) String ¶ added in v0.6.7
func (x *CallResponse) String() string
type StreamRequest ¶ added in v0.6.7
type StreamRequest struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*StreamRequest) Descriptor
deprecated
added in
v0.6.7
func (*StreamRequest) Descriptor() ([]byte, []int)
Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead.
func (*StreamRequest) GetData ¶ added in v0.6.7
func (x *StreamRequest) GetData() []byte
func (*StreamRequest) ProtoMessage ¶ added in v0.6.7
func (*StreamRequest) ProtoMessage()
func (*StreamRequest) ProtoReflect ¶ added in v0.6.7
func (x *StreamRequest) ProtoReflect() protoreflect.Message
func (*StreamRequest) Reset ¶ added in v0.6.7
func (x *StreamRequest) Reset()
func (*StreamRequest) String ¶ added in v0.6.7
func (x *StreamRequest) String() string
type StreamResponse ¶ added in v0.6.7
type StreamResponse struct { Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*StreamResponse) Descriptor
deprecated
added in
v0.6.7
func (*StreamResponse) Descriptor() ([]byte, []int)
Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead.
func (*StreamResponse) GetResult ¶ added in v0.6.7
func (x *StreamResponse) GetResult() []byte
func (*StreamResponse) ProtoMessage ¶ added in v0.6.7
func (*StreamResponse) ProtoMessage()
func (*StreamResponse) ProtoReflect ¶ added in v0.6.7
func (x *StreamResponse) ProtoReflect() protoreflect.Message
func (*StreamResponse) Reset ¶ added in v0.6.7
func (x *StreamResponse) Reset()
func (*StreamResponse) String ¶ added in v0.6.7
func (x *StreamResponse) String() string
type UnimplementedAIBaseServiceServer ¶ added in v0.6.7
type UnimplementedAIBaseServiceServer struct { }
UnimplementedAIBaseServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAIBaseServiceServer) Call ¶ added in v0.6.7
func (UnimplementedAIBaseServiceServer) Call(context.Context, *CallRequest) (*CallResponse, error)
func (UnimplementedAIBaseServiceServer) Stream ¶ added in v0.6.7
func (UnimplementedAIBaseServiceServer) Stream(AIBaseService_StreamServer) error
type UnsafeAIBaseServiceServer ¶ added in v0.6.7
type UnsafeAIBaseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAIBaseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AIBaseServiceServer will result in compilation errors.