syntax = "proto3"; service SpeechService { rpc StartSpeechService (stream SpeechServiceRequest) returns (stream SpeechServiceResponse); } message SpeechServiceRequest { oneof message_type { StartSpeechRecognitionRequest start_speech_recognition = 1; SetSpeechSettingsRequest set_speech_settings = 2; SpeakRequest speak = 3; StopSpeakingRequest stop_speaking = 4; ShutdownRequest shutdown = 5; PingRequest ping = 6; StopSpeechRecognitionRequest stop_speech_recognition = 7; SetSpeechVolumeRequest set_volume = 8; } } message SpeechServiceResponse { oneof message_type { SpeakUpdateResponse speak_update = 1; SpeechRecognitionResponse speech_recognized = 2; SpeechServiceError error = 3; PingResponse ping = 4; StartSpeechRecognitionResponse speech_recognition_started = 5; SetSpeechSettingsResponse speech_settings_set = 6; SetSpeechVolumeResponse set_volume = 7; } } message SpeechServiceError { string error_message = 1; string exception = 2; } message StartSpeechRecognitionRequest { string vosk_model = 1; string grammar_file = 2; double required_confidence = 3; } message StopSpeechRecognitionRequest {} message SetSpeechSettingsRequest { SpeechSettings speech_settings = 1; } message SpeechSettings { string model_name = 1; string onnx_path = 2; string config_path = 3; string alt_model_name = 4; string alt_onnx_path = 5; string alt_config_path = 6; double speed = 7; double gain = 8; double pitch = 9; } message SpeakRequest { string message = 1; optional SpeechSettings speech_settings = 2; uint64 message_id = 3; } message StopSpeakingRequest {} message SpeakUpdateResponse { string message = 1; string chunk = 2; bool is_start_of_message = 3; bool is_start_of_chunk = 4; bool is_end_of_message = 5; bool is_end_of_chunk = 6; bool has_another_request = 7; uint64 message_id = 8; } message SpeechRecognitionResponse { string heard_text = 1; string recognized_text = 2; string recognized_rule = 3; double confidence = 4; map semantics = 5; } message ShutdownRequest {} message PingRequest { string time = 1; } message PingResponse { string time = 1; } message StartSpeechRecognitionResponse { bool successful = 1; } message SetSpeechSettingsResponse { bool successful = 1; } message SetSpeechVolumeRequest { double volume = 1; } message SetSpeechVolumeResponse { bool successful = 1; }