Documentation ¶
Index ¶
- Variables
- func RegisterDiathekeServer(s *grpc.Server, srv DiathekeServer)
- type ASRRequest
- func (*ASRRequest) Descriptor() ([]byte, []int)deprecated
- func (m *ASRRequest) GetAsrData() isASRRequest_AsrData
- func (x *ASRRequest) GetAudio() []byte
- func (x *ASRRequest) GetModel() string
- func (*ASRRequest) ProtoMessage()
- func (x *ASRRequest) ProtoReflect() protoreflect.Message
- func (x *ASRRequest) Reset()
- func (x *ASRRequest) String() string
- type ASRRequest_Audio
- type ASRRequest_Model
- type ASRResponse
- func (*ASRResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ASRResponse) GetConfidenceScore() float64
- func (x *ASRResponse) GetText() string
- func (*ASRResponse) ProtoMessage()
- func (x *ASRResponse) ProtoReflect() protoreflect.Message
- func (x *ASRResponse) Reset()
- func (x *ASRResponse) String() string
- type AudioInput
- func (*AudioInput) Descriptor() ([]byte, []int)deprecated
- func (x *AudioInput) GetData() []byte
- func (m *AudioInput) GetRequest() isAudioInput_Request
- func (x *AudioInput) GetSessionId() string
- func (*AudioInput) ProtoMessage()
- func (x *AudioInput) ProtoReflect() protoreflect.Message
- func (x *AudioInput) Reset()
- func (x *AudioInput) String() string
- type AudioInput_Data
- type AudioInput_SessionId
- type AudioReply
- func (*AudioReply) Descriptor() ([]byte, []int)deprecated
- func (x *AudioReply) GetData() []byte
- func (x *AudioReply) GetEnd() *Empty
- func (x *AudioReply) GetLabel() string
- func (m *AudioReply) GetOutputMessage() isAudioReply_OutputMessage
- func (x *AudioReply) GetText() string
- func (*AudioReply) ProtoMessage()
- func (x *AudioReply) ProtoReflect() protoreflect.Message
- func (x *AudioReply) Reset()
- func (x *AudioReply) String() string
- type AudioReply_Data
- type AudioReply_End
- type AudioReply_Text
- type CommandEvent
- func (*CommandEvent) Descriptor() ([]byte, []int)deprecated
- func (x *CommandEvent) GetCommandId() string
- func (x *CommandEvent) GetCommandStateId() string
- func (x *CommandEvent) GetParameters() map[string]string
- func (*CommandEvent) ProtoMessage()
- func (x *CommandEvent) ProtoReflect() protoreflect.Message
- func (x *CommandEvent) Reset()
- func (x *CommandEvent) String() string
- type CommandStatus
- func (*CommandStatus) Descriptor() ([]byte, []int)deprecated
- func (x *CommandStatus) GetCommandId() string
- func (x *CommandStatus) GetCommandStateId() string
- func (x *CommandStatus) GetErrorMessageText() string
- func (x *CommandStatus) GetOutputParameters() map[string]string
- func (x *CommandStatus) GetReturnStatus() CommandStatus_StatusCode
- func (x *CommandStatus) GetSessionId() string
- func (*CommandStatus) ProtoMessage()
- func (x *CommandStatus) ProtoReflect() protoreflect.Message
- func (x *CommandStatus) Reset()
- func (x *CommandStatus) String() string
- type CommandStatus_StatusCode
- func (CommandStatus_StatusCode) Descriptor() protoreflect.EnumDescriptor
- func (x CommandStatus_StatusCode) Enum() *CommandStatus_StatusCode
- func (CommandStatus_StatusCode) EnumDescriptor() ([]byte, []int)deprecated
- func (x CommandStatus_StatusCode) Number() protoreflect.EnumNumber
- func (x CommandStatus_StatusCode) String() string
- func (CommandStatus_StatusCode) Type() protoreflect.EnumType
- type DiathekeClient
- type DiathekeEvent
- func (*DiathekeEvent) Descriptor() ([]byte, []int)deprecated
- func (x *DiathekeEvent) GetCommand() *CommandEvent
- func (x *DiathekeEvent) GetRecognize() *RecognizeEvent
- func (x *DiathekeEvent) GetReply() *ReplyEvent
- func (m *DiathekeEvent) GetResult() isDiathekeEvent_Result
- func (*DiathekeEvent) ProtoMessage()
- func (x *DiathekeEvent) ProtoReflect() protoreflect.Message
- func (x *DiathekeEvent) Reset()
- func (x *DiathekeEvent) String() string
- type DiathekeEvent_Command
- type DiathekeEvent_Recognize
- type DiathekeEvent_Reply
- type DiathekeServer
- type Diatheke_SessionEventStreamClient
- type Diatheke_SessionEventStreamServer
- type Diatheke_StreamASRClient
- type Diatheke_StreamASRServer
- type Diatheke_StreamAudioInputClient
- type Diatheke_StreamAudioInputServer
- type Diatheke_StreamAudioRepliesClient
- type Diatheke_StreamAudioRepliesServer
- type Diatheke_StreamTTSClient
- type Diatheke_StreamTTSServer
- type Empty
- type ModelsResponse
- type NewSessionRequest
- type PushTextRequest
- func (*PushTextRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PushTextRequest) GetSessionId() string
- func (x *PushTextRequest) GetText() string
- func (*PushTextRequest) ProtoMessage()
- func (x *PushTextRequest) ProtoReflect() protoreflect.Message
- func (x *PushTextRequest) Reset()
- func (x *PushTextRequest) String() string
- type RecognizeEvent
- func (*RecognizeEvent) Descriptor() ([]byte, []int)deprecated
- func (x *RecognizeEvent) GetText() string
- func (x *RecognizeEvent) GetValidInput() bool
- func (*RecognizeEvent) ProtoMessage()
- func (x *RecognizeEvent) ProtoReflect() protoreflect.Message
- func (x *RecognizeEvent) Reset()
- func (x *RecognizeEvent) String() string
- type ReplyEvent
- type SessionID
- type TTSRequest
- type TTSResponse
- type UnimplementedDiathekeServer
- func (*UnimplementedDiathekeServer) CommandFinished(context.Context, *CommandStatus) (*Empty, error)
- func (*UnimplementedDiathekeServer) EndSession(context.Context, *SessionID) (*Empty, error)
- func (*UnimplementedDiathekeServer) Models(context.Context, *Empty) (*ModelsResponse, error)
- func (*UnimplementedDiathekeServer) NewSession(context.Context, *NewSessionRequest) (*SessionID, error)
- func (*UnimplementedDiathekeServer) PushText(context.Context, *PushTextRequest) (*Empty, error)
- func (*UnimplementedDiathekeServer) SessionEventStream(*SessionID, Diatheke_SessionEventStreamServer) error
- func (*UnimplementedDiathekeServer) StreamASR(Diatheke_StreamASRServer) error
- func (*UnimplementedDiathekeServer) StreamAudioInput(Diatheke_StreamAudioInputServer) error
- func (*UnimplementedDiathekeServer) StreamAudioReplies(*SessionID, Diatheke_StreamAudioRepliesServer) error
- func (*UnimplementedDiathekeServer) StreamTTS(*TTSRequest, Diatheke_StreamTTSServer) error
- func (*UnimplementedDiathekeServer) Version(context.Context, *Empty) (*VersionResponse, error)
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
var ( CommandStatus_StatusCode_name = map[int32]string{ 0: "SUCCESS", 1: "FAILURE", } CommandStatus_StatusCode_value = map[string]int32{ "SUCCESS": 0, "FAILURE": 1, } )
Enum value maps for CommandStatus_StatusCode.
var File_diatheke_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDiathekeServer ¶
func RegisterDiathekeServer(s *grpc.Server, srv DiathekeServer)
Types ¶
type ASRRequest ¶
type ASRRequest struct { // Types that are assignable to AsrData: // *ASRRequest_Model // *ASRRequest_Audio AsrData isASRRequest_AsrData `protobuf_oneof:"asr_data"` // contains filtered or unexported fields }
Request for streaming ASR unrelated to a session.
func (*ASRRequest) Descriptor
deprecated
func (*ASRRequest) Descriptor() ([]byte, []int)
Deprecated: Use ASRRequest.ProtoReflect.Descriptor instead.
func (*ASRRequest) GetAsrData ¶
func (m *ASRRequest) GetAsrData() isASRRequest_AsrData
func (*ASRRequest) GetAudio ¶
func (x *ASRRequest) GetAudio() []byte
func (*ASRRequest) GetModel ¶
func (x *ASRRequest) GetModel() string
func (*ASRRequest) ProtoMessage ¶
func (*ASRRequest) ProtoMessage()
func (*ASRRequest) ProtoReflect ¶ added in v1.2.0
func (x *ASRRequest) ProtoReflect() protoreflect.Message
func (*ASRRequest) Reset ¶
func (x *ASRRequest) Reset()
func (*ASRRequest) String ¶
func (x *ASRRequest) String() string
type ASRRequest_Audio ¶
type ASRRequest_Audio struct { // Audio data to process. The encoding of the data should match what // was specified in the Diatheke server configuration. // NOTE: If the audio data is empty, the server may interpret it as // the end of the stream and stop accepting further messages. Audio []byte `protobuf:"bytes,2,opt,name=audio,proto3,oneof"` }
type ASRRequest_Model ¶
type ASRRequest_Model struct { // The Cubic model to use for ASR. This message should always be sent // before any audio data is sent. Model string `protobuf:"bytes,1,opt,name=model,proto3,oneof"` }
type ASRResponse ¶
type ASRResponse struct { // Text is the Cubic engine's formatted transcript of pushed audio. // This field will be the 1-best alternative. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // The confidence score is a floating point number between 0.0 - 1.0. A // score of 1.0 indicates that the ASR engine is 100% confident in the // transcription. ConfidenceScore float64 `protobuf:"fixed64,2,opt,name=confidence_score,json=confidenceScore,proto3" json:"confidence_score,omitempty"` // contains filtered or unexported fields }
ASRResponse contains speech recognition results.
func (*ASRResponse) Descriptor
deprecated
func (*ASRResponse) Descriptor() ([]byte, []int)
Deprecated: Use ASRResponse.ProtoReflect.Descriptor instead.
func (*ASRResponse) GetConfidenceScore ¶
func (x *ASRResponse) GetConfidenceScore() float64
func (*ASRResponse) GetText ¶
func (x *ASRResponse) GetText() string
func (*ASRResponse) ProtoMessage ¶
func (*ASRResponse) ProtoMessage()
func (*ASRResponse) ProtoReflect ¶ added in v1.2.0
func (x *ASRResponse) ProtoReflect() protoreflect.Message
func (*ASRResponse) Reset ¶
func (x *ASRResponse) Reset()
func (*ASRResponse) String ¶
func (x *ASRResponse) String() string
type AudioInput ¶
type AudioInput struct { // Types that are assignable to Request: // *AudioInput_SessionId // *AudioInput_Data Request isAudioInput_Request `protobuf_oneof:"request"` // contains filtered or unexported fields }
Provides input audio data for StreamAudioInput. The first message sent must contain the session ID only. All subsequent messages must contain audio data only.
func (*AudioInput) Descriptor
deprecated
func (*AudioInput) Descriptor() ([]byte, []int)
Deprecated: Use AudioInput.ProtoReflect.Descriptor instead.
func (*AudioInput) GetData ¶
func (x *AudioInput) GetData() []byte
func (*AudioInput) GetRequest ¶
func (m *AudioInput) GetRequest() isAudioInput_Request
func (*AudioInput) GetSessionId ¶
func (x *AudioInput) GetSessionId() string
func (*AudioInput) ProtoMessage ¶
func (*AudioInput) ProtoMessage()
func (*AudioInput) ProtoReflect ¶ added in v1.2.0
func (x *AudioInput) ProtoReflect() protoreflect.Message
func (*AudioInput) Reset ¶
func (x *AudioInput) Reset()
func (*AudioInput) String ¶
func (x *AudioInput) String() string
type AudioInput_Data ¶
type AudioInput_Data struct { // Audio data to process. The encoding of the data should match what // was specified in the Diatheke server configuration. // NOTE: If the audio data is empty, the server may interpret it as // the end of the stream and stop accepting further messages. Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` }
type AudioInput_SessionId ¶
type AudioInput_SessionId struct { // Session ID returned from the NewSession call. SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3,oneof"` }
type AudioReply ¶
type AudioReply struct { // The label defined in the Diatheke model. Identifies which reply // in the model this message corresponds to. Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` // Types that are assignable to OutputMessage: // *AudioReply_Text // *AudioReply_Data // *AudioReply_End OutputMessage isAudioReply_OutputMessage `protobuf_oneof:"output_message"` // contains filtered or unexported fields }
An AudioReply is the verbal and textual reply that Diatheke returns as part of a conversation (not to be confused with the server concepts of request and response).
func (*AudioReply) Descriptor
deprecated
func (*AudioReply) Descriptor() ([]byte, []int)
Deprecated: Use AudioReply.ProtoReflect.Descriptor instead.
func (*AudioReply) GetData ¶
func (x *AudioReply) GetData() []byte
func (*AudioReply) GetEnd ¶
func (x *AudioReply) GetEnd() *Empty
func (*AudioReply) GetLabel ¶
func (x *AudioReply) GetLabel() string
func (*AudioReply) GetOutputMessage ¶
func (m *AudioReply) GetOutputMessage() isAudioReply_OutputMessage
func (*AudioReply) GetText ¶
func (x *AudioReply) GetText() string
func (*AudioReply) ProtoMessage ¶
func (*AudioReply) ProtoMessage()
func (*AudioReply) ProtoReflect ¶ added in v1.2.0
func (x *AudioReply) ProtoReflect() protoreflect.Message
func (*AudioReply) Reset ¶
func (x *AudioReply) Reset()
func (*AudioReply) String ¶
func (x *AudioReply) String() string
type AudioReply_Data ¶
type AudioReply_Data struct { // The audio data from TTS. There can be any number of these messages // for an AudioReply after the first text message and before the final // end message. The encoding of the data will match what was specified // in the server configuration. Data []byte `protobuf:"bytes,3,opt,name=data,proto3,oneof"` }
type AudioReply_End ¶
type AudioReply_End struct { // Indicates that TTS has finished streaming audio for the reply. This // is the last message that will be received for an AudioReply. End *Empty `protobuf:"bytes,4,opt,name=end,proto3,oneof"` }
type AudioReply_Text ¶
type AudioReply_Text struct { // The reply text as defined in the Diatheke model. This is the first // message that will be received for an AudioReply. It contains the // same text as the corresponding ReplyEvent in the session's event // stream. Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"` }
type CommandEvent ¶
type CommandEvent struct { // ID of the command that should be run. i.e. "COM01" for Command #01. CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` // A generic map of parameters (name, value). The parameters are // defined in the Diatheke model. Depending on the command, these // parameters should be sent back with the CommandStatus update. Parameters map[string]string `` /* 161-byte string literal not displayed */ // ID to keep track of the dialog state when the command is requested. // This field is required in the CommandStatus message so that Diatheke // can correctly update the dialog state when CommandFinished is called. CommandStateId string `protobuf:"bytes,3,opt,name=command_state_id,json=commandStateId,proto3" json:"command_state_id,omitempty"` // contains filtered or unexported fields }
A CommandEvent occurs when Diatheke wants the client to execute the given command.
func (*CommandEvent) Descriptor
deprecated
func (*CommandEvent) Descriptor() ([]byte, []int)
Deprecated: Use CommandEvent.ProtoReflect.Descriptor instead.
func (*CommandEvent) GetCommandId ¶
func (x *CommandEvent) GetCommandId() string
func (*CommandEvent) GetCommandStateId ¶
func (x *CommandEvent) GetCommandStateId() string
func (*CommandEvent) GetParameters ¶
func (x *CommandEvent) GetParameters() map[string]string
func (*CommandEvent) ProtoMessage ¶
func (*CommandEvent) ProtoMessage()
func (*CommandEvent) ProtoReflect ¶ added in v1.2.0
func (x *CommandEvent) ProtoReflect() protoreflect.Message
func (*CommandEvent) Reset ¶
func (x *CommandEvent) Reset()
func (*CommandEvent) String ¶
func (x *CommandEvent) String() string
type CommandStatus ¶
type CommandStatus struct { // session_id should be the same as the status id returned from // NewSessionResponse. SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // ID of the command as given in the RunCommand object. CommandId string `protobuf:"bytes,2,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"` ReturnStatus CommandStatus_StatusCode `` /* 150-byte string literal not displayed */ // Parameters to return to Diatheke. For example, the map might contain // the entry "temperature", which was populated with a value of "30" // after the command finished. Expected parameters are defined by the // Diatheke model. OutputParameters map[string]string `` /* 197-byte string literal not displayed */ // Set this field with an error message if a fatal error occured while // executing the command (return_status == FAILURE). ErrorMessageText string `protobuf:"bytes,5,opt,name=error_message_text,json=errorMessageText,proto3" json:"error_message_text,omitempty"` // State ID from the original CommandEvent. This field is required for // Diatheke to correctly update the dialog state when CommandFinished // is called. CommandStateId string `protobuf:"bytes,6,opt,name=command_state_id,json=commandStateId,proto3" json:"command_state_id,omitempty"` // contains filtered or unexported fields }
The final status of an executed command.
func (*CommandStatus) Descriptor
deprecated
func (*CommandStatus) Descriptor() ([]byte, []int)
Deprecated: Use CommandStatus.ProtoReflect.Descriptor instead.
func (*CommandStatus) GetCommandId ¶
func (x *CommandStatus) GetCommandId() string
func (*CommandStatus) GetCommandStateId ¶
func (x *CommandStatus) GetCommandStateId() string
func (*CommandStatus) GetErrorMessageText ¶
func (x *CommandStatus) GetErrorMessageText() string
func (*CommandStatus) GetOutputParameters ¶
func (x *CommandStatus) GetOutputParameters() map[string]string
func (*CommandStatus) GetReturnStatus ¶
func (x *CommandStatus) GetReturnStatus() CommandStatus_StatusCode
func (*CommandStatus) GetSessionId ¶
func (x *CommandStatus) GetSessionId() string
func (*CommandStatus) ProtoMessage ¶
func (*CommandStatus) ProtoMessage()
func (*CommandStatus) ProtoReflect ¶ added in v1.2.0
func (x *CommandStatus) ProtoReflect() protoreflect.Message
func (*CommandStatus) Reset ¶
func (x *CommandStatus) Reset()
func (*CommandStatus) String ¶
func (x *CommandStatus) String() string
type CommandStatus_StatusCode ¶
type CommandStatus_StatusCode int32
CommandStatus are the resulting states of a command.
const ( // SUCCESS indicates that the command was successfully completed, and the // dialog state may now move on to the next state. CommandStatus_SUCCESS CommandStatus_StatusCode = 0 // FAILURE indicates that there was a fatal error running the command. // The session will log an error and return to the start state of the // model when this status is encountered. CommandStatus_FAILURE CommandStatus_StatusCode = 1 )
func (CommandStatus_StatusCode) Descriptor ¶ added in v1.2.0
func (CommandStatus_StatusCode) Descriptor() protoreflect.EnumDescriptor
func (CommandStatus_StatusCode) Enum ¶ added in v1.2.0
func (x CommandStatus_StatusCode) Enum() *CommandStatus_StatusCode
func (CommandStatus_StatusCode) EnumDescriptor
deprecated
func (CommandStatus_StatusCode) EnumDescriptor() ([]byte, []int)
Deprecated: Use CommandStatus_StatusCode.Descriptor instead.
func (CommandStatus_StatusCode) Number ¶ added in v1.2.0
func (x CommandStatus_StatusCode) Number() protoreflect.EnumNumber
func (CommandStatus_StatusCode) String ¶
func (x CommandStatus_StatusCode) String() string
func (CommandStatus_StatusCode) Type ¶ added in v1.2.0
func (CommandStatus_StatusCode) Type() protoreflect.EnumType
type DiathekeClient ¶
type DiathekeClient interface { // Queries the Version of the Server. Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionResponse, error) // Models will return a list of available versions. Model values from // this list may be used in NewSession calls. Models(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ModelsResponse, error) // Requests a new session with the given config and returns the session // ID, which is required for other rpc methods. NewSession(ctx context.Context, in *NewSessionRequest, opts ...grpc.CallOption) (*SessionID, error) // Terminates an existing session and closes any open session streams. // It is an error if the SessionEndRequest has an invalid SessionID. EndSession(ctx context.Context, in *SessionID, opts ...grpc.CallOption) (*Empty, error) // Requests a new event stream for the given session. Only one stream // per session is allowed. SessionEventStream(ctx context.Context, in *SessionID, opts ...grpc.CallOption) (Diatheke_SessionEventStreamClient, error) // Notify Diatheke when a command has completed so that it may update // the dialog state. The initial command request will come as part of // a DiathekeEvent. After sending a CommandEvent, Diatheke will wait // until it receives the CommandFinished notification before continuing // to the next action in the model. Client applications should therefore // always call this after receiving a CommandEvent, or else the session // will hang. CommandFinished(ctx context.Context, in *CommandStatus, opts ...grpc.CallOption) (*Empty, error) // Begin an audio input stream for a session. The first message to // the server should specify the sessionID, with binary audio data pushed // for every subsequent message. As the audio is recognized, Diatheke // will respond with appropriate events on the session's event stream. // <p> // Only one stream at a time is allowed for a session. A previously // created audio input stream must be closed before starting a new one. StreamAudioInput(ctx context.Context, opts ...grpc.CallOption) (Diatheke_StreamAudioInputClient, error) // Create an audio reply stream for a session. The returned stream // will receive replies (as defined in the Diatheke model) from the // server as they occur in the conversation. For each reply, the // stream will first receive the text to synthesize (defined by the model), // followed by one or more messages containing the synthesized audio bytes. // The reply will end with a message indicating that TTS for that // entry is complete. Only one reply stream at a time is allowed for a // session. // NOTE: The text in the first message of an audio reply is the same that // will be received in the session's event stream. StreamAudioReplies(ctx context.Context, in *SessionID, opts ...grpc.CallOption) (Diatheke_StreamAudioRepliesClient, error) // Push text to Diatheke as part of the conversation for a session. // Diatheke will respond with an appropriate event on the session's // event stream based on whether the given text was recognized as a // valid intent or not. PushText(ctx context.Context, in *PushTextRequest, opts ...grpc.CallOption) (*Empty, error) // Manually run streaming ASR unrelated to any session by pushing // audio data to the server on the audio stream. As transcriptions // become available, the server will return them on the ASRResponse // stream. The transcriptions may then be used for, e.g., the PushText // method. This function is provided as a convenience. StreamASR(ctx context.Context, opts ...grpc.CallOption) (Diatheke_StreamASRClient, error) // Manually run streaming TTS. The Audio stream will receive // binary audio data as it is synthesized and will close automatically // when synthesis is complete. This function is provided as a // convenience. StreamTTS(ctx context.Context, in *TTSRequest, opts ...grpc.CallOption) (Diatheke_StreamTTSClient, error) }
DiathekeClient is the client API for Diatheke service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDiathekeClient ¶
func NewDiathekeClient(cc grpc.ClientConnInterface) DiathekeClient
type DiathekeEvent ¶
type DiathekeEvent struct { // Types that are assignable to Result: // *DiathekeEvent_Command // *DiathekeEvent_Recognize // *DiathekeEvent_Reply Result isDiathekeEvent_Result `protobuf_oneof:"result"` // contains filtered or unexported fields }
An event from Diatheke in response to either recognized audio, submitted text, or some other transition in the model.
func (*DiathekeEvent) Descriptor
deprecated
func (*DiathekeEvent) Descriptor() ([]byte, []int)
Deprecated: Use DiathekeEvent.ProtoReflect.Descriptor instead.
func (*DiathekeEvent) GetCommand ¶
func (x *DiathekeEvent) GetCommand() *CommandEvent
func (*DiathekeEvent) GetRecognize ¶
func (x *DiathekeEvent) GetRecognize() *RecognizeEvent
func (*DiathekeEvent) GetReply ¶
func (x *DiathekeEvent) GetReply() *ReplyEvent
func (*DiathekeEvent) GetResult ¶
func (m *DiathekeEvent) GetResult() isDiathekeEvent_Result
func (*DiathekeEvent) ProtoMessage ¶
func (*DiathekeEvent) ProtoMessage()
func (*DiathekeEvent) ProtoReflect ¶ added in v1.2.0
func (x *DiathekeEvent) ProtoReflect() protoreflect.Message
func (*DiathekeEvent) Reset ¶
func (x *DiathekeEvent) Reset()
func (*DiathekeEvent) String ¶
func (x *DiathekeEvent) String() string
type DiathekeEvent_Command ¶
type DiathekeEvent_Command struct { // Indicates Diatheke found an actionable state in the dialog, // and requests the client to perform the given command. // // Users should always call CommandFinished after receiving // this event so that Diatheke can update the dialog state when the // command is complete. Command *CommandEvent `protobuf:"bytes,1,opt,name=command,proto3,oneof"` }
type DiathekeEvent_Recognize ¶
type DiathekeEvent_Recognize struct { // An event indicating whether pushed text and audio was recognized by // ASR and/or Diatheke. Recognize *RecognizeEvent `protobuf:"bytes,2,opt,name=recognize,proto3,oneof"` }
type DiathekeEvent_Reply ¶
type DiathekeEvent_Reply struct { // The textual reply from Diatheke in the conversation (not to be // confused with the server concepts of request and response). For // example, this could be a question to solicit more information // from the user, a status report, or any other reply defined by // the Diatheke model. The text of this message is also provided in // the AudioReply stream (if one is open). Reply *ReplyEvent `protobuf:"bytes,3,opt,name=reply,proto3,oneof"` }
type DiathekeServer ¶
type DiathekeServer interface { // Queries the Version of the Server. Version(context.Context, *Empty) (*VersionResponse, error) // Models will return a list of available versions. Model values from // this list may be used in NewSession calls. Models(context.Context, *Empty) (*ModelsResponse, error) // Requests a new session with the given config and returns the session // ID, which is required for other rpc methods. NewSession(context.Context, *NewSessionRequest) (*SessionID, error) // Terminates an existing session and closes any open session streams. // It is an error if the SessionEndRequest has an invalid SessionID. EndSession(context.Context, *SessionID) (*Empty, error) // Requests a new event stream for the given session. Only one stream // per session is allowed. SessionEventStream(*SessionID, Diatheke_SessionEventStreamServer) error // Notify Diatheke when a command has completed so that it may update // the dialog state. The initial command request will come as part of // a DiathekeEvent. After sending a CommandEvent, Diatheke will wait // until it receives the CommandFinished notification before continuing // to the next action in the model. Client applications should therefore // always call this after receiving a CommandEvent, or else the session // will hang. CommandFinished(context.Context, *CommandStatus) (*Empty, error) // Begin an audio input stream for a session. The first message to // the server should specify the sessionID, with binary audio data pushed // for every subsequent message. As the audio is recognized, Diatheke // will respond with appropriate events on the session's event stream. // <p> // Only one stream at a time is allowed for a session. A previously // created audio input stream must be closed before starting a new one. StreamAudioInput(Diatheke_StreamAudioInputServer) error // Create an audio reply stream for a session. The returned stream // will receive replies (as defined in the Diatheke model) from the // server as they occur in the conversation. For each reply, the // stream will first receive the text to synthesize (defined by the model), // followed by one or more messages containing the synthesized audio bytes. // The reply will end with a message indicating that TTS for that // entry is complete. Only one reply stream at a time is allowed for a // session. // NOTE: The text in the first message of an audio reply is the same that // will be received in the session's event stream. StreamAudioReplies(*SessionID, Diatheke_StreamAudioRepliesServer) error // Push text to Diatheke as part of the conversation for a session. // Diatheke will respond with an appropriate event on the session's // event stream based on whether the given text was recognized as a // valid intent or not. PushText(context.Context, *PushTextRequest) (*Empty, error) // Manually run streaming ASR unrelated to any session by pushing // audio data to the server on the audio stream. As transcriptions // become available, the server will return them on the ASRResponse // stream. The transcriptions may then be used for, e.g., the PushText // method. This function is provided as a convenience. StreamASR(Diatheke_StreamASRServer) error // Manually run streaming TTS. The Audio stream will receive // binary audio data as it is synthesized and will close automatically // when synthesis is complete. This function is provided as a // convenience. StreamTTS(*TTSRequest, Diatheke_StreamTTSServer) error }
DiathekeServer is the server API for Diatheke service.
type Diatheke_SessionEventStreamClient ¶
type Diatheke_SessionEventStreamClient interface { Recv() (*DiathekeEvent, error) grpc.ClientStream }
type Diatheke_SessionEventStreamServer ¶
type Diatheke_SessionEventStreamServer interface { Send(*DiathekeEvent) error grpc.ServerStream }
type Diatheke_StreamASRClient ¶
type Diatheke_StreamASRClient interface { Send(*ASRRequest) error Recv() (*ASRResponse, error) grpc.ClientStream }
type Diatheke_StreamASRServer ¶
type Diatheke_StreamASRServer interface { Send(*ASRResponse) error Recv() (*ASRRequest, error) grpc.ServerStream }
type Diatheke_StreamAudioInputClient ¶
type Diatheke_StreamAudioInputClient interface { Send(*AudioInput) error CloseAndRecv() (*Empty, error) grpc.ClientStream }
type Diatheke_StreamAudioInputServer ¶
type Diatheke_StreamAudioInputServer interface { SendAndClose(*Empty) error Recv() (*AudioInput, error) grpc.ServerStream }
type Diatheke_StreamAudioRepliesClient ¶
type Diatheke_StreamAudioRepliesClient interface { Recv() (*AudioReply, error) grpc.ClientStream }
type Diatheke_StreamAudioRepliesServer ¶
type Diatheke_StreamAudioRepliesServer interface { Send(*AudioReply) error grpc.ServerStream }
type Diatheke_StreamTTSClient ¶
type Diatheke_StreamTTSClient interface { Recv() (*TTSResponse, error) grpc.ClientStream }
type Diatheke_StreamTTSServer ¶
type Diatheke_StreamTTSServer interface { Send(*TTSResponse) error grpc.ServerStream }
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶ added in v1.2.0
func (x *Empty) ProtoReflect() protoreflect.Message
type ModelsResponse ¶
type ModelsResponse struct { // Array of models available for use. Models []string `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"` // contains filtered or unexported fields }
The message sent by the server in response to a Models request. Returns an array of model names.
func (*ModelsResponse) Descriptor
deprecated
func (*ModelsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ModelsResponse.ProtoReflect.Descriptor instead.
func (*ModelsResponse) GetModels ¶
func (x *ModelsResponse) GetModels() []string
func (*ModelsResponse) ProtoMessage ¶
func (*ModelsResponse) ProtoMessage()
func (*ModelsResponse) ProtoReflect ¶ added in v1.2.0
func (x *ModelsResponse) ProtoReflect() protoreflect.Message
func (*ModelsResponse) Reset ¶
func (x *ModelsResponse) Reset()
func (*ModelsResponse) String ¶
func (x *ModelsResponse) String() string
type NewSessionRequest ¶
type NewSessionRequest struct { // For applications that have more than one model to use for ASR/NLU. // ASR grammar can vary between models, as well as sets of commands. // Some applications will only have one model. Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // contains filtered or unexported fields }
Request for the NewSession call.
func (*NewSessionRequest) Descriptor
deprecated
func (*NewSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewSessionRequest.ProtoReflect.Descriptor instead.
func (*NewSessionRequest) GetModel ¶
func (x *NewSessionRequest) GetModel() string
func (*NewSessionRequest) ProtoMessage ¶
func (*NewSessionRequest) ProtoMessage()
func (*NewSessionRequest) ProtoReflect ¶ added in v1.2.0
func (x *NewSessionRequest) ProtoReflect() protoreflect.Message
func (*NewSessionRequest) Reset ¶
func (x *NewSessionRequest) Reset()
func (*NewSessionRequest) String ¶
func (x *NewSessionRequest) String() string
type PushTextRequest ¶
type PushTextRequest struct { // Session ID returned from the NewSession call. SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // User input. This could be a transcription from manually run ASR, // text selected from a dropdown list, entered in a prompt, etc. Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
Request to push text to Diatheke as part of a conversation.
func (*PushTextRequest) Descriptor
deprecated
func (*PushTextRequest) Descriptor() ([]byte, []int)
Deprecated: Use PushTextRequest.ProtoReflect.Descriptor instead.
func (*PushTextRequest) GetSessionId ¶
func (x *PushTextRequest) GetSessionId() string
func (*PushTextRequest) GetText ¶
func (x *PushTextRequest) GetText() string
func (*PushTextRequest) ProtoMessage ¶
func (*PushTextRequest) ProtoMessage()
func (*PushTextRequest) ProtoReflect ¶ added in v1.2.0
func (x *PushTextRequest) ProtoReflect() protoreflect.Message
func (*PushTextRequest) Reset ¶
func (x *PushTextRequest) Reset()
func (*PushTextRequest) String ¶
func (x *PushTextRequest) String() string
type RecognizeEvent ¶
type RecognizeEvent struct { // The pushed text or transcription of audio sent to Diatheke. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // True if the submitted text or audio transcription was recognized by the // Diatheke model as a valid intent or entity. ValidInput bool `protobuf:"varint,2,opt,name=valid_input,json=validInput,proto3" json:"valid_input,omitempty"` // contains filtered or unexported fields }
A RecognizeEvent occurs if a session's audio input has a transcription available, or if the PushText method was called. In both cases, the event will indicate whether the text was recognized as a valid intent by the Diatheke model.
func (*RecognizeEvent) Descriptor
deprecated
func (*RecognizeEvent) Descriptor() ([]byte, []int)
Deprecated: Use RecognizeEvent.ProtoReflect.Descriptor instead.
func (*RecognizeEvent) GetText ¶
func (x *RecognizeEvent) GetText() string
func (*RecognizeEvent) GetValidInput ¶
func (x *RecognizeEvent) GetValidInput() bool
func (*RecognizeEvent) ProtoMessage ¶
func (*RecognizeEvent) ProtoMessage()
func (*RecognizeEvent) ProtoReflect ¶ added in v1.2.0
func (x *RecognizeEvent) ProtoReflect() protoreflect.Message
func (*RecognizeEvent) Reset ¶
func (x *RecognizeEvent) Reset()
func (*RecognizeEvent) String ¶
func (x *RecognizeEvent) String() string
type ReplyEvent ¶
type ReplyEvent struct { // Text of the reply event (defined by the Diatheke model). Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // Label of the reply event (defined by the Diatheke model). Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` // contains filtered or unexported fields }
A ReplyEvent occurs when Diatheke has a reply in the conversation (not to be confused with the server concepts of request and response). These correspond to replies defined in the Diatheke model. For example, it might be a prompt for additional information from the user, a status update, or a confirmation. ReplyEvents are not generated in response to StreamTTS calls.
func (*ReplyEvent) Descriptor
deprecated
func (*ReplyEvent) Descriptor() ([]byte, []int)
Deprecated: Use ReplyEvent.ProtoReflect.Descriptor instead.
func (*ReplyEvent) GetLabel ¶
func (x *ReplyEvent) GetLabel() string
func (*ReplyEvent) GetText ¶
func (x *ReplyEvent) GetText() string
func (*ReplyEvent) ProtoMessage ¶
func (*ReplyEvent) ProtoMessage()
func (*ReplyEvent) ProtoReflect ¶ added in v1.2.0
func (x *ReplyEvent) ProtoReflect() protoreflect.Message
func (*ReplyEvent) Reset ¶
func (x *ReplyEvent) Reset()
func (*ReplyEvent) String ¶
func (x *ReplyEvent) String() string
type SessionID ¶
type SessionID struct { // Session ID returned from the NewSession call. SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // contains filtered or unexported fields }
Simple message that only contains the session ID.
func (*SessionID) Descriptor
deprecated
func (*SessionID) GetSessionId ¶
func (*SessionID) ProtoMessage ¶
func (*SessionID) ProtoMessage()
func (*SessionID) ProtoReflect ¶ added in v1.2.0
func (x *SessionID) ProtoReflect() protoreflect.Message
type TTSRequest ¶
type TTSRequest struct { // The Luna model to use for TTS (defined in the server config file). Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // Text to synthesize Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // contains filtered or unexported fields }
Request to synthesize speech unrelated to a session.
func (*TTSRequest) Descriptor
deprecated
func (*TTSRequest) Descriptor() ([]byte, []int)
Deprecated: Use TTSRequest.ProtoReflect.Descriptor instead.
func (*TTSRequest) GetModel ¶
func (x *TTSRequest) GetModel() string
func (*TTSRequest) GetText ¶
func (x *TTSRequest) GetText() string
func (*TTSRequest) ProtoMessage ¶
func (*TTSRequest) ProtoMessage()
func (*TTSRequest) ProtoReflect ¶ added in v1.2.0
func (x *TTSRequest) ProtoReflect() protoreflect.Message
func (*TTSRequest) Reset ¶
func (x *TTSRequest) Reset()
func (*TTSRequest) String ¶
func (x *TTSRequest) String() string
type TTSResponse ¶
type TTSResponse struct { // The synthesized audio data. The data encoding will match what was // specified in the server configuration. Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Response for text-to-speech unrelated to a session.
func (*TTSResponse) Descriptor
deprecated
func (*TTSResponse) Descriptor() ([]byte, []int)
Deprecated: Use TTSResponse.ProtoReflect.Descriptor instead.
func (*TTSResponse) GetData ¶
func (x *TTSResponse) GetData() []byte
func (*TTSResponse) ProtoMessage ¶
func (*TTSResponse) ProtoMessage()
func (*TTSResponse) ProtoReflect ¶ added in v1.2.0
func (x *TTSResponse) ProtoReflect() protoreflect.Message
func (*TTSResponse) Reset ¶
func (x *TTSResponse) Reset()
func (*TTSResponse) String ¶
func (x *TTSResponse) String() string
type UnimplementedDiathekeServer ¶ added in v1.2.0
type UnimplementedDiathekeServer struct { }
UnimplementedDiathekeServer can be embedded to have forward compatible implementations.
func (*UnimplementedDiathekeServer) CommandFinished ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) CommandFinished(context.Context, *CommandStatus) (*Empty, error)
func (*UnimplementedDiathekeServer) EndSession ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) Models ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) Models(context.Context, *Empty) (*ModelsResponse, error)
func (*UnimplementedDiathekeServer) NewSession ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) NewSession(context.Context, *NewSessionRequest) (*SessionID, error)
func (*UnimplementedDiathekeServer) PushText ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) PushText(context.Context, *PushTextRequest) (*Empty, error)
func (*UnimplementedDiathekeServer) SessionEventStream ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) SessionEventStream(*SessionID, Diatheke_SessionEventStreamServer) error
func (*UnimplementedDiathekeServer) StreamASR ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) StreamASR(Diatheke_StreamASRServer) error
func (*UnimplementedDiathekeServer) StreamAudioInput ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) StreamAudioInput(Diatheke_StreamAudioInputServer) error
func (*UnimplementedDiathekeServer) StreamAudioReplies ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) StreamAudioReplies(*SessionID, Diatheke_StreamAudioRepliesServer) error
func (*UnimplementedDiathekeServer) StreamTTS ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) StreamTTS(*TTSRequest, Diatheke_StreamTTSServer) error
func (*UnimplementedDiathekeServer) Version ¶ added in v1.2.0
func (*UnimplementedDiathekeServer) Version(context.Context, *Empty) (*VersionResponse, error)
type VersionResponse ¶
type VersionResponse struct { // Server that manages all of the the other components. Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` // contains filtered or unexported fields }
The message sent by the server for the `Version` method.
func (*VersionResponse) Descriptor
deprecated
func (*VersionResponse) Descriptor() ([]byte, []int)
Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead.
func (*VersionResponse) GetServer ¶
func (x *VersionResponse) GetServer() string
func (*VersionResponse) ProtoMessage ¶
func (*VersionResponse) ProtoMessage()
func (*VersionResponse) ProtoReflect ¶ added in v1.2.0
func (x *VersionResponse) ProtoReflect() protoreflect.Message
func (*VersionResponse) Reset ¶
func (x *VersionResponse) Reset()
func (*VersionResponse) String ¶
func (x *VersionResponse) String() string