Documentation
¶
Index ¶
- func IsIntent(i IntentGraphResponse) bool
- func IsKnowledgeGraph(i IntentGraphResponse) bool
- type CompressOpts
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) NewConnectionStream(ctx context.Context, opts ConnectOpts) (Stream, error)
- func (c *Conn) NewIntentGraphStream(ctx context.Context, opts IntentGraphOpts) (Stream, error)
- func (c *Conn) NewIntentStream(ctx context.Context, opts IntentOpts) (Stream, error)
- func (c *Conn) NewKGStream(ctx context.Context, opts KGOpts) (Stream, error)
- func (c *Conn) SendText(ctx context.Context, text, session, device string, service pb.IntentService) *pb.IntentResult
- type ConnOpt
- func WithBootID(value string) ConnOpt
- func WithCredentials(value credentials.PerRPCCredentials) ConnOpt
- func WithDeviceID(value string) ConnOpt
- func WithFirmwareVersion(value string) ConnOpt
- func WithGrpcOptions(value ...grpc.DialOption) ConnOpt
- func WithInsecure(value bool) ConnOpt
- func WithSessionID(value string) ConnOpt
- type ConnectOpts
- type ConnectionCheckResponse
- type IntentGraphOpts
- type IntentGraphResponse
- type IntentOpts
- type IntentResponse
- type IntentResult
- type KGOpts
- type KnowledgeGraphResponse
- type Stream
- type StreamOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIntent ¶
func IsIntent(i IntentGraphResponse) bool
func IsKnowledgeGraph ¶
func IsKnowledgeGraph(i IntentGraphResponse) bool
Types ¶
type CompressOpts ¶
type CompressOpts struct { Bitrate uint Complexity uint FrameSize float32 PreEncoded bool Compress bool }
CompressOpts specifies whether compression should be used and, if so, allows the specification of parameters related to it
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents an underlying GRPC connection to the Chipper server
func NewConn ¶
func NewConn(ctx context.Context, serverURL string, appKey string, options ...ConnOpt) (*Conn, error)
NewConn creates a new connection to the given GRPC server
func (*Conn) NewConnectionStream ¶
NewConnectionStream opens a stream for doing connection checks
func (*Conn) NewIntentGraphStream ¶
NewIntentGraphStream opens a new stream on the given connection to stream audio for the purpose of getting a knowledge graph response
func (*Conn) NewIntentStream ¶
NewIntentStream opens a new stream on the given connection to stream audio for the purpose of getting an intent response
func (*Conn) NewKGStream ¶
NewKGStream opens a new stream on the given connection to stream audio for the purpose of getting a knowledge graph response
func (*Conn) SendText ¶
func (c *Conn) SendText(ctx context.Context, text, session, device string, service pb.IntentService) *pb.IntentResult
SendText performs an intent request with a text string instead of voice data
type ConnOpt ¶
type ConnOpt func(o *connOpts)
ConnOpt represents an option that can be used to change connection behavior
func WithBootID ¶
WithBootID will include the given boot ID with requests
func WithCredentials ¶
func WithCredentials(value credentials.PerRPCCredentials) ConnOpt
WithCredentials adds the given per RPC credentials to GRPC requests
func WithDeviceID ¶
WithDeviceID specifies the device ID to provide the server
func WithFirmwareVersion ¶
WithFirmwareVersion specifies the firmware version to provide the server
func WithGrpcOptions ¶
func WithGrpcOptions(value ...grpc.DialOption) ConnOpt
WithGrpcOptions adds the given GRPC DialOption values to those we pass to GRPC when creating a connection
func WithInsecure ¶
WithInsecure specifies whether the connection with chipper should be insecure
func WithSessionID ¶
WithSessionID specifies the session ID to provide the server
type ConnectOpts ¶
type ConnectOpts struct { StreamOpts TotalAudioMs uint32 AudioPerRequestMs uint32 }
ConnectOpts extends StreamOpts with options unique to connection check streams
type ConnectionCheckResponse ¶
type ConnectionCheckResponse = pb.ConnectionCheckResponse
ConnectionCheckResponse aliases the protobuf ConnectionCheckResponse type
type IntentGraphOpts ¶
type IntentGraphOpts struct { StreamOpts Handler pb.IntentService Mode pb.RobotMode SpeechOnly bool // Doesnt seem to be passing this in Timezone string }
IntentGraphOpts extends StreamOpts with options of both Intent and KG
type IntentGraphResponse ¶
type IntentGraphResponse = pb.IntentGraphResponse
IntentGraphResponse aliases the protobuf IntentGraphResponse type
type IntentOpts ¶
type IntentOpts struct { StreamOpts Handler pb.IntentService Mode pb.RobotMode SpeechOnly bool }
IntentOpts extends StreamOpts with options unique to intent streams
type IntentResponse ¶
type IntentResponse = pb.IntentResponse
IntentResponse aliases the protobuf IntentResponse type
type IntentResult ¶
type IntentResult = pb.IntentResult
IntentResult aliases the protobuf IntentResult type
func ConvertToIntentResp ¶
func ConvertToIntentResp(resp *IntentGraphResponse) *IntentResult
type KGOpts ¶
type KGOpts struct { StreamOpts Timezone string }
KGOpts extends StreamOpts with options unique to knowledge graph streams
type KnowledgeGraphResponse ¶
type KnowledgeGraphResponse = pb.KnowledgeGraphResponse
KnowledgeGraphResponse aliases the protobuf KnowledgeGraphResponse type
func ConvertToKnowledgeGraphResp ¶
func ConvertToKnowledgeGraphResp(resp *IntentGraphResponse) *KnowledgeGraphResponse
type Stream ¶
type Stream interface { SendAudio(audioData []byte) error WaitForResponse() (interface{}, error) Close() error CloseSend() error }
Stream represents an open stream of various possible types (intent, knowledge graph) to Chipper
type StreamOpts ¶
type StreamOpts struct { CompressOpts Timeout time.Duration Language pb.LanguageCode SaveAudio bool NoDas bool }
StreamOpts defines options common to all possible stream types