You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.4 KiB

  1. // Copyright (c) 2021 Ximalaya Speech Team (Xiang Lyu)
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. option java_package = "ex.grpc";
  16. option objc_class_prefix = "wenet";
  17. package wenet;
  18. service ASR {
  19. rpc Recognize (stream Request) returns (stream Response) {}
  20. }
  21. message Request {
  22. message DecodeConfig {
  23. int32 nbest_config = 1;
  24. bool continuous_decoding_config = 2;
  25. }
  26. oneof RequestPayload {
  27. DecodeConfig decode_config = 1;
  28. bytes audio_data = 2;
  29. }
  30. }
  31. message Response {
  32. message OneBest {
  33. string sentence = 1;
  34. repeated OnePiece wordpieces = 2;
  35. }
  36. message OnePiece {
  37. string word = 1;
  38. int32 start = 2;
  39. int32 end = 3;
  40. }
  41. enum Status {
  42. ok = 0;
  43. failed = 1;
  44. }
  45. enum Type {
  46. server_ready = 0;
  47. partial_result = 1;
  48. final_result = 2;
  49. speech_end = 3;
  50. }
  51. Status status = 1;
  52. Type type = 2;
  53. repeated OneBest nbest = 3;
  54. }