speechpb

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: 0BSD Imports: 16 Imported by: 0

Documentation

Overview

Package speechpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	SpeechEvent_name = map[int32]string{
		0: "UNKNOWN_EVENT",
		1: "ERROR",
		2: "IAT",
		3: "NLP",
		4: "TTS",
	}
	SpeechEvent_value = map[string]int32{
		"UNKNOWN_EVENT": 0,
		"ERROR":         1,
		"IAT":           2,
		"NLP":           3,
		"TTS":           4,
	}
)

Enum value maps for SpeechEvent.

View Source
var File_proto_speech_speech_proto protoreflect.FileDescriptor

Functions

func RegisterSpeechHandler

func RegisterSpeechHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSpeechHandler registers the http handlers for service Speech to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSpeechHandlerClient

func RegisterSpeechHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SpeechClient) error

RegisterSpeechHandlerClient registers the http handlers for service Speech to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SpeechClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SpeechClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SpeechClient" to call the correct interceptors.

func RegisterSpeechHandlerFromEndpoint

func RegisterSpeechHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSpeechHandlerFromEndpoint is same as RegisterSpeechHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSpeechHandlerServer

func RegisterSpeechHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SpeechServer) error

RegisterSpeechHandlerServer registers the http handlers for service Speech to "mux". UnaryRPC :call SpeechServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSpeechHandlerFromEndpoint instead.

func RegisterSpeechServer

func RegisterSpeechServer(s *grpc.Server, srv SpeechServer)

Types

type ErrorInfo

type ErrorInfo struct {
	Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` // 错误描述
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` // 错误码
	// contains filtered or unexported fields
}

错误信息

func (*ErrorInfo) Descriptor deprecated

func (*ErrorInfo) Descriptor() ([]byte, []int)

Deprecated: Use ErrorInfo.ProtoReflect.Descriptor instead.

func (*ErrorInfo) GetCode

func (x *ErrorInfo) GetCode() string

func (*ErrorInfo) GetInfo

func (x *ErrorInfo) GetInfo() string

func (*ErrorInfo) ProtoMessage

func (*ErrorInfo) ProtoMessage()

func (*ErrorInfo) ProtoReflect added in v1.0.3

func (x *ErrorInfo) ProtoReflect() protoreflect.Message

func (*ErrorInfo) Reset

func (x *ErrorInfo) Reset()

func (*ErrorInfo) String

func (x *ErrorInfo) String() string

type GetIatRequest added in v1.0.3

type GetIatRequest struct {
	// contains filtered or unexported fields
}

iat获取

func (*GetIatRequest) Descriptor deprecated added in v1.0.3

func (*GetIatRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetIatRequest.ProtoReflect.Descriptor instead.

func (*GetIatRequest) ProtoMessage added in v1.0.3

func (*GetIatRequest) ProtoMessage()

func (*GetIatRequest) ProtoReflect added in v1.0.3

func (x *GetIatRequest) ProtoReflect() protoreflect.Message

func (*GetIatRequest) Reset added in v1.0.3

func (x *GetIatRequest) Reset()

func (*GetIatRequest) String added in v1.0.3

func (x *GetIatRequest) String() string

type GetIatResponse added in v1.0.3

type GetIatResponse struct {
	Id   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //当前回话id
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*GetIatResponse) Descriptor deprecated added in v1.0.3

func (*GetIatResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetIatResponse.ProtoReflect.Descriptor instead.

func (*GetIatResponse) GetId added in v1.0.3

func (x *GetIatResponse) GetId() string

func (*GetIatResponse) GetText added in v1.0.3

func (x *GetIatResponse) GetText() string

func (*GetIatResponse) ProtoMessage added in v1.0.3

func (*GetIatResponse) ProtoMessage()

func (*GetIatResponse) ProtoReflect added in v1.0.3

func (x *GetIatResponse) ProtoReflect() protoreflect.Message

func (*GetIatResponse) Reset added in v1.0.3

func (x *GetIatResponse) Reset()

func (*GetIatResponse) String added in v1.0.3

func (x *GetIatResponse) String() string

type GetNlpRequest added in v1.0.3

type GetNlpRequest struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // 需要寻找nlp的文本
	// contains filtered or unexported fields
}

nlp获取

func (*GetNlpRequest) Descriptor deprecated added in v1.0.3

func (*GetNlpRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetNlpRequest.ProtoReflect.Descriptor instead.

func (*GetNlpRequest) GetText added in v1.0.3

func (x *GetNlpRequest) GetText() string

func (*GetNlpRequest) ProtoMessage added in v1.0.3

func (*GetNlpRequest) ProtoMessage()

func (*GetNlpRequest) ProtoReflect added in v1.0.3

func (x *GetNlpRequest) ProtoReflect() protoreflect.Message

func (*GetNlpRequest) Reset added in v1.0.3

func (x *GetNlpRequest) Reset()

func (*GetNlpRequest) String added in v1.0.3

func (x *GetNlpRequest) String() string

type GetNlpResponse added in v1.0.3

type GetNlpResponse struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`         //当前回话id
	Intent []byte `protobuf:"bytes,2,opt,name=intent,proto3" json:"intent,omitempty"` //aiui nlp详细信息,参考:https://aiui.xfyun.cn/doc/aiui/4_skill_develop/8_agreement/semantic_agreement.html#%E6%B6%88%E6%81%AF%E6%A0%BC%E5%BC%8F%E6%A6%82%E8%A7%88
	// contains filtered or unexported fields
}

func (*GetNlpResponse) Descriptor deprecated added in v1.0.3

func (*GetNlpResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetNlpResponse.ProtoReflect.Descriptor instead.

func (*GetNlpResponse) GetId added in v1.0.3

func (x *GetNlpResponse) GetId() string

func (*GetNlpResponse) GetIntent added in v1.0.3

func (x *GetNlpResponse) GetIntent() []byte

func (*GetNlpResponse) ProtoMessage added in v1.0.3

func (*GetNlpResponse) ProtoMessage()

func (*GetNlpResponse) ProtoReflect added in v1.0.3

func (x *GetNlpResponse) ProtoReflect() protoreflect.Message

func (*GetNlpResponse) Reset added in v1.0.3

func (x *GetNlpResponse) Reset()

func (*GetNlpResponse) String added in v1.0.3

func (x *GetNlpResponse) String() string

type GetTtsRequest

type GetTtsRequest struct {
	Text   string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`      // 需要合成的文本
	Volume int32  `protobuf:"varint,2,opt,name=volume,proto3" json:"volume,omitempty"` //合成的音量,默认是50
	// contains filtered or unexported fields
}

tts获取

func (*GetTtsRequest) Descriptor deprecated

func (*GetTtsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetTtsRequest.ProtoReflect.Descriptor instead.

func (*GetTtsRequest) GetText

func (x *GetTtsRequest) GetText() string

func (*GetTtsRequest) GetVolume added in v1.0.2

func (x *GetTtsRequest) GetVolume() int32

func (*GetTtsRequest) ProtoMessage

func (*GetTtsRequest) ProtoMessage()

func (*GetTtsRequest) ProtoReflect added in v1.0.3

func (x *GetTtsRequest) ProtoReflect() protoreflect.Message

func (*GetTtsRequest) Reset

func (x *GetTtsRequest) Reset()

func (*GetTtsRequest) String

func (x *GetTtsRequest) String() string

type GetTtsResponse

type GetTtsResponse struct {
	Id  string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //当前回话id
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTtsResponse) Descriptor deprecated

func (*GetTtsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetTtsResponse.ProtoReflect.Descriptor instead.

func (*GetTtsResponse) GetId added in v1.0.3

func (x *GetTtsResponse) GetId() string

func (*GetTtsResponse) GetUrl

func (x *GetTtsResponse) GetUrl() string

func (*GetTtsResponse) ProtoMessage

func (*GetTtsResponse) ProtoMessage()

func (*GetTtsResponse) ProtoReflect added in v1.0.3

func (x *GetTtsResponse) ProtoReflect() protoreflect.Message

func (*GetTtsResponse) Reset

func (x *GetTtsResponse) Reset()

func (*GetTtsResponse) String

func (x *GetTtsResponse) String() string

type Iat

type Iat struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                        //当前回话id
	Text   string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`                    //识别的文本
	IsLast bool   `protobuf:"varint,3,opt,name=is_last,json=isLast,proto3" json:"is_last,omitempty"` // 是否为完整句
	// contains filtered or unexported fields
}

func (*Iat) Descriptor deprecated

func (*Iat) Descriptor() ([]byte, []int)

Deprecated: Use Iat.ProtoReflect.Descriptor instead.

func (*Iat) GetId

func (x *Iat) GetId() string

func (*Iat) GetIsLast added in v1.0.3

func (x *Iat) GetIsLast() bool

func (*Iat) GetText

func (x *Iat) GetText() string

func (*Iat) ProtoMessage

func (*Iat) ProtoMessage()

func (*Iat) ProtoReflect added in v1.0.3

func (x *Iat) ProtoReflect() protoreflect.Message

func (*Iat) Reset

func (x *Iat) Reset()

func (*Iat) String

func (x *Iat) String() string

type Nlp

type Nlp struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`         //当前回话id
	Intent []byte `protobuf:"bytes,2,opt,name=intent,proto3" json:"intent,omitempty"` //aiui nlp详细信息,参考:https://aiui.xfyun.cn/doc/aiui/4_skill_develop/8_agreement/semantic_agreement.html#%E6%B6%88%E6%81%AF%E6%A0%BC%E5%BC%8F%E6%A6%82%E8%A7%88
	// contains filtered or unexported fields
}

func (*Nlp) Descriptor deprecated

func (*Nlp) Descriptor() ([]byte, []int)

Deprecated: Use Nlp.ProtoReflect.Descriptor instead.

func (*Nlp) GetId

func (x *Nlp) GetId() string

func (*Nlp) GetIntent

func (x *Nlp) GetIntent() []byte

func (*Nlp) ProtoMessage

func (*Nlp) ProtoMessage()

func (*Nlp) ProtoReflect added in v1.0.3

func (x *Nlp) ProtoReflect() protoreflect.Message

func (*Nlp) Reset

func (x *Nlp) Reset()

func (*Nlp) String

func (x *Nlp) String() string

type OnSpeechEventRequest

type OnSpeechEventRequest struct {
	Start   bool `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	WithNlp bool `protobuf:"varint,2,opt,name=with_nlp,json=withNlp,proto3" json:"with_nlp,omitempty"`
	Stop    bool `protobuf:"varint,3,opt,name=stop,proto3" json:"stop,omitempty"`
	// contains filtered or unexported fields
}

func (*OnSpeechEventRequest) Descriptor deprecated

func (*OnSpeechEventRequest) Descriptor() ([]byte, []int)

Deprecated: Use OnSpeechEventRequest.ProtoReflect.Descriptor instead.

func (*OnSpeechEventRequest) GetStart added in v1.0.3

func (x *OnSpeechEventRequest) GetStart() bool

func (*OnSpeechEventRequest) GetStop added in v1.0.3

func (x *OnSpeechEventRequest) GetStop() bool

func (*OnSpeechEventRequest) GetWithNlp added in v1.0.3

func (x *OnSpeechEventRequest) GetWithNlp() bool

func (*OnSpeechEventRequest) ProtoMessage

func (*OnSpeechEventRequest) ProtoMessage()

func (*OnSpeechEventRequest) ProtoReflect added in v1.0.3

func (x *OnSpeechEventRequest) ProtoReflect() protoreflect.Message

func (*OnSpeechEventRequest) Reset

func (x *OnSpeechEventRequest) Reset()

func (*OnSpeechEventRequest) String

func (x *OnSpeechEventRequest) String() string

type OnSpeechEventResponse

type OnSpeechEventResponse struct {
	EventType SpeechEvent `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=speechpb.SpeechEvent" json:"event_type,omitempty"`
	// Types that are assignable to EventOneof:
	//	*OnSpeechEventResponse_ErrorInfo
	//	*OnSpeechEventResponse_Iat
	//	*OnSpeechEventResponse_Nlp
	EventOneof isOnSpeechEventResponse_EventOneof `protobuf_oneof:"event_oneof"`
	// contains filtered or unexported fields
}

func (*OnSpeechEventResponse) Descriptor deprecated

func (*OnSpeechEventResponse) Descriptor() ([]byte, []int)

Deprecated: Use OnSpeechEventResponse.ProtoReflect.Descriptor instead.

func (*OnSpeechEventResponse) GetErrorInfo

func (x *OnSpeechEventResponse) GetErrorInfo() *ErrorInfo

func (*OnSpeechEventResponse) GetEventOneof

func (m *OnSpeechEventResponse) GetEventOneof() isOnSpeechEventResponse_EventOneof

func (*OnSpeechEventResponse) GetEventType

func (x *OnSpeechEventResponse) GetEventType() SpeechEvent

func (*OnSpeechEventResponse) GetIat

func (x *OnSpeechEventResponse) GetIat() *Iat

func (*OnSpeechEventResponse) GetNlp

func (x *OnSpeechEventResponse) GetNlp() *Nlp

func (*OnSpeechEventResponse) ProtoMessage

func (*OnSpeechEventResponse) ProtoMessage()

func (*OnSpeechEventResponse) ProtoReflect added in v1.0.3

func (x *OnSpeechEventResponse) ProtoReflect() protoreflect.Message

func (*OnSpeechEventResponse) Reset

func (x *OnSpeechEventResponse) Reset()

func (*OnSpeechEventResponse) String

func (x *OnSpeechEventResponse) String() string

type OnSpeechEventResponse_ErrorInfo

type OnSpeechEventResponse_ErrorInfo struct {
	ErrorInfo *ErrorInfo `protobuf:"bytes,2,opt,name=error_info,json=errorInfo,proto3,oneof"` // 错误结果
}

type OnSpeechEventResponse_Iat

type OnSpeechEventResponse_Iat struct {
	Iat *Iat `protobuf:"bytes,3,opt,name=iat,proto3,oneof"` // asr识别结果
}

type OnSpeechEventResponse_Nlp

type OnSpeechEventResponse_Nlp struct {
	Nlp *Nlp `protobuf:"bytes,4,opt,name=nlp,proto3,oneof"` //nlp结果
}

type SetBeamRequest added in v1.0.3

type SetBeamRequest struct {
	Beam int32 `protobuf:"varint,1,opt,name=beam,proto3" json:"beam,omitempty"` //拾音波束,0为面对麦克风左边60°,1为面对麦克风中间60°,2为面对麦克风右边60度
	// contains filtered or unexported fields
}

func (*SetBeamRequest) Descriptor deprecated added in v1.0.3

func (*SetBeamRequest) Descriptor() ([]byte, []int)

Deprecated: Use SetBeamRequest.ProtoReflect.Descriptor instead.

func (*SetBeamRequest) GetBeam added in v1.0.3

func (x *SetBeamRequest) GetBeam() int32

func (*SetBeamRequest) ProtoMessage added in v1.0.3

func (*SetBeamRequest) ProtoMessage()

func (*SetBeamRequest) ProtoReflect added in v1.0.3

func (x *SetBeamRequest) ProtoReflect() protoreflect.Message

func (*SetBeamRequest) Reset added in v1.0.3

func (x *SetBeamRequest) Reset()

func (*SetBeamRequest) String added in v1.0.3

func (x *SetBeamRequest) String() string

type SetBeamResponse added in v1.0.3

type SetBeamResponse struct {
	// contains filtered or unexported fields
}

func (*SetBeamResponse) Descriptor deprecated added in v1.0.3

func (*SetBeamResponse) Descriptor() ([]byte, []int)

Deprecated: Use SetBeamResponse.ProtoReflect.Descriptor instead.

func (*SetBeamResponse) ProtoMessage added in v1.0.3

func (*SetBeamResponse) ProtoMessage()

func (*SetBeamResponse) ProtoReflect added in v1.0.3

func (x *SetBeamResponse) ProtoReflect() protoreflect.Message

func (*SetBeamResponse) Reset added in v1.0.3

func (x *SetBeamResponse) Reset()

func (*SetBeamResponse) String added in v1.0.3

func (x *SetBeamResponse) String() string

type SpeechClient

type SpeechClient interface {
	SetBeam(ctx context.Context, in *SetBeamRequest, opts ...grpc.CallOption) (*SetBeamResponse, error)
	GetIat(ctx context.Context, in *GetIatRequest, opts ...grpc.CallOption) (*GetIatResponse, error)
	GetNlp(ctx context.Context, in *GetNlpRequest, opts ...grpc.CallOption) (*GetNlpResponse, error)
	GetTts(ctx context.Context, in *GetTtsRequest, opts ...grpc.CallOption) (*GetTtsResponse, error)
	OnSpeechEvent(ctx context.Context, opts ...grpc.CallOption) (Speech_OnSpeechEventClient, error)
}

SpeechClient is the client API for Speech service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSpeechClient

func NewSpeechClient(cc grpc.ClientConnInterface) SpeechClient

type SpeechEvent

type SpeechEvent int32

speech事件

const (
	SpeechEvent_UNKNOWN_EVENT SpeechEvent = 0 // 零值
	SpeechEvent_ERROR         SpeechEvent = 1 // 识别错误
	SpeechEvent_IAT           SpeechEvent = 2 //识别结果
	SpeechEvent_NLP           SpeechEvent = 3 //NLP结果
	SpeechEvent_TTS           SpeechEvent = 4 //TTS结果
)

func (SpeechEvent) Descriptor added in v1.0.3

func (SpeechEvent) Enum added in v1.0.3

func (x SpeechEvent) Enum() *SpeechEvent

func (SpeechEvent) EnumDescriptor deprecated

func (SpeechEvent) EnumDescriptor() ([]byte, []int)

Deprecated: Use SpeechEvent.Descriptor instead.

func (SpeechEvent) Number added in v1.0.3

func (x SpeechEvent) Number() protoreflect.EnumNumber

func (SpeechEvent) String

func (x SpeechEvent) String() string

func (SpeechEvent) Type added in v1.0.3

type SpeechServer

SpeechServer is the server API for Speech service.

type Speech_OnSpeechEventClient

type Speech_OnSpeechEventClient interface {
	Send(*OnSpeechEventRequest) error
	Recv() (*OnSpeechEventResponse, error)
	grpc.ClientStream
}

type Speech_OnSpeechEventServer

type Speech_OnSpeechEventServer interface {
	Send(*OnSpeechEventResponse) error
	Recv() (*OnSpeechEventRequest, error)
	grpc.ServerStream
}

type StartIat added in v1.0.3

type StartIat struct {
	Start   bool `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	WithNlp bool `protobuf:"varint,2,opt,name=with_nlp,json=withNlp,proto3" json:"with_nlp,omitempty"`
	// contains filtered or unexported fields
}

func (*StartIat) Descriptor deprecated added in v1.0.3

func (*StartIat) Descriptor() ([]byte, []int)

Deprecated: Use StartIat.ProtoReflect.Descriptor instead.

func (*StartIat) GetStart added in v1.0.3

func (x *StartIat) GetStart() bool

func (*StartIat) GetWithNlp added in v1.0.3

func (x *StartIat) GetWithNlp() bool

func (*StartIat) ProtoMessage added in v1.0.3

func (*StartIat) ProtoMessage()

func (*StartIat) ProtoReflect added in v1.0.3

func (x *StartIat) ProtoReflect() protoreflect.Message

func (*StartIat) Reset added in v1.0.3

func (x *StartIat) Reset()

func (*StartIat) String added in v1.0.3

func (x *StartIat) String() string

type StopIat added in v1.0.3

type StopIat struct {
	Stop bool `protobuf:"varint,1,opt,name=stop,proto3" json:"stop,omitempty"`
	// contains filtered or unexported fields
}

func (*StopIat) Descriptor deprecated added in v1.0.3

func (*StopIat) Descriptor() ([]byte, []int)

Deprecated: Use StopIat.ProtoReflect.Descriptor instead.

func (*StopIat) GetStop added in v1.0.3

func (x *StopIat) GetStop() bool

func (*StopIat) ProtoMessage added in v1.0.3

func (*StopIat) ProtoMessage()

func (*StopIat) ProtoReflect added in v1.0.3

func (x *StopIat) ProtoReflect() protoreflect.Message

func (*StopIat) Reset added in v1.0.3

func (x *StopIat) Reset()

func (*StopIat) String added in v1.0.3

func (x *StopIat) String() string

type UnimplementedSpeechServer

type UnimplementedSpeechServer struct {
}

UnimplementedSpeechServer can be embedded to have forward compatible implementations.

func (*UnimplementedSpeechServer) GetIat added in v1.0.3

func (*UnimplementedSpeechServer) GetNlp added in v1.0.3

func (*UnimplementedSpeechServer) GetTts

func (*UnimplementedSpeechServer) OnSpeechEvent

func (*UnimplementedSpeechServer) SetBeam added in v1.0.3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL