assemblyai 1.0.0.pre.beta.6 → 1.0.0.pre.beta.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assemblyai/files/client.rb +4 -2
  3. data/lib/assemblyai/files/types/uploaded_file.rb +20 -11
  4. data/lib/assemblyai/lemur/client.rb +256 -150
  5. data/lib/assemblyai/lemur/types/lemur_action_items_response.rb +28 -14
  6. data/lib/assemblyai/lemur/types/lemur_base_params.rb +83 -54
  7. data/lib/assemblyai/lemur/types/lemur_base_params_context.rb +11 -5
  8. data/lib/assemblyai/lemur/types/lemur_base_response.rb +20 -11
  9. data/lib/assemblyai/lemur/types/lemur_question.rb +57 -31
  10. data/lib/assemblyai/lemur/types/lemur_question_answer.rb +28 -14
  11. data/lib/assemblyai/lemur/types/lemur_question_answer_response.rb +29 -14
  12. data/lib/assemblyai/lemur/types/lemur_question_context.rb +13 -6
  13. data/lib/assemblyai/lemur/types/lemur_summary_response.rb +28 -14
  14. data/lib/assemblyai/lemur/types/lemur_task_response.rb +28 -14
  15. data/lib/assemblyai/lemur/types/purge_lemur_request_data_response.rb +32 -17
  16. data/lib/assemblyai/realtime/client.rb +32 -16
  17. data/lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb +24 -13
  18. data/lib/assemblyai/realtime/types/final_transcript.rb +72 -41
  19. data/lib/assemblyai/realtime/types/force_end_utterance.rb +20 -11
  20. data/lib/assemblyai/realtime/types/message_type.rb +1 -0
  21. data/lib/assemblyai/realtime/types/partial_transcript.rb +62 -34
  22. data/lib/assemblyai/realtime/types/realtime_base_message.rb +22 -13
  23. data/lib/assemblyai/realtime/types/realtime_base_transcript.rb +57 -31
  24. data/lib/assemblyai/realtime/types/realtime_error.rb +20 -11
  25. data/lib/assemblyai/realtime/types/realtime_message.rb +44 -18
  26. data/lib/assemblyai/realtime/types/realtime_temporary_token_response.rb +21 -12
  27. data/lib/assemblyai/realtime/types/realtime_transcript.rb +15 -9
  28. data/lib/assemblyai/realtime/types/session_begins.rb +31 -14
  29. data/lib/assemblyai/realtime/types/session_information.rb +69 -0
  30. data/lib/assemblyai/realtime/types/session_terminated.rb +20 -11
  31. data/lib/assemblyai/realtime/types/terminate_session.rb +21 -12
  32. data/lib/assemblyai/realtime/types/word.rb +36 -18
  33. data/lib/assemblyai/streaming/types/receive_message.rb +113 -0
  34. data/lib/assemblyai/streaming/types/send_message.rb +86 -0
  35. data/lib/assemblyai/streaming/types/streaming.rb +11 -0
  36. data/lib/assemblyai/transcripts/client.rb +54 -20
  37. data/lib/assemblyai/transcripts/list_by_url_client.rb +6 -4
  38. data/lib/assemblyai/transcripts/polling_client.rb +12 -2
  39. data/lib/assemblyai/transcripts/types/auto_highlight_result.rb +40 -19
  40. data/lib/assemblyai/transcripts/types/auto_highlights_result.rb +38 -14
  41. data/lib/assemblyai/transcripts/types/chapter.rb +40 -20
  42. data/lib/assemblyai/transcripts/types/content_safety_label.rb +32 -16
  43. data/lib/assemblyai/transcripts/types/content_safety_label_result.rb +51 -29
  44. data/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +51 -29
  45. data/lib/assemblyai/transcripts/types/entity.rb +41 -21
  46. data/lib/assemblyai/transcripts/types/page_details.rb +60 -33
  47. data/lib/assemblyai/transcripts/types/paragraphs_response.rb +37 -19
  48. data/lib/assemblyai/transcripts/types/redact_pii_audio_quality.rb +4 -1
  49. data/lib/assemblyai/transcripts/types/redacted_audio_response.rb +29 -15
  50. data/lib/assemblyai/transcripts/types/sentences_response.rb +37 -19
  51. data/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb +62 -35
  52. data/lib/assemblyai/transcripts/types/severity_score_summary.rb +32 -16
  53. data/lib/assemblyai/transcripts/types/speech_model.rb +2 -0
  54. data/lib/assemblyai/transcripts/types/substitution_policy.rb +4 -2
  55. data/lib/assemblyai/transcripts/types/timestamp.rb +28 -14
  56. data/lib/assemblyai/transcripts/types/topic_detection_model_result.rb +39 -19
  57. data/lib/assemblyai/transcripts/types/topic_detection_result.rb +40 -21
  58. data/lib/assemblyai/transcripts/types/topic_detection_result_labels_item.rb +31 -15
  59. data/lib/assemblyai/transcripts/types/transcript.rb +512 -293
  60. data/lib/assemblyai/transcripts/types/transcript_custom_spelling.rb +30 -15
  61. data/lib/assemblyai/transcripts/types/transcript_language_code.rb +3 -2
  62. data/lib/assemblyai/transcripts/types/transcript_list.rb +33 -16
  63. data/lib/assemblyai/transcripts/types/transcript_list_item.rb +63 -30
  64. data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +334 -191
  65. data/lib/assemblyai/transcripts/types/transcript_paragraph.rb +61 -33
  66. data/lib/assemblyai/transcripts/types/transcript_ready_notification.rb +30 -16
  67. data/lib/assemblyai/transcripts/types/transcript_sentence.rb +61 -33
  68. data/lib/assemblyai/transcripts/types/transcript_status.rb +2 -1
  69. data/lib/assemblyai/transcripts/types/transcript_utterance.rb +55 -31
  70. data/lib/assemblyai/transcripts/types/transcript_word.rb +55 -24
  71. data/lib/assemblyai/transcripts/types/word_search_match.rb +40 -20
  72. data/lib/assemblyai/transcripts/types/word_search_response.rb +36 -17
  73. data/lib/assemblyai/types/error.rb +32 -16
  74. data/lib/requests.rb +80 -34
  75. data/lib/types_export.rb +9 -8
  76. metadata +6 -5
  77. data/lib/assemblyai/realtime/types/audio_data.rb +0 -7
  78. data/lib/assemblyai/realtime/types/receive_message.rb +0 -87
  79. data/lib/assemblyai/realtime/types/send_message.rb +0 -74
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "json"
4
- require_relative "terminate_session"
5
- require_relative "force_end_utterance"
6
- require_relative "configure_end_utterance_silence_threshold"
7
-
8
- module AssemblyAI
9
- class Realtime
10
- # Send messages to the WebSocket
11
- class SendMessage
12
- # Deserialize a JSON object to an instance of SendMessage
13
- #
14
- # @param json_object [JSON]
15
- # @return [Realtime::SendMessage]
16
- def self.from_json(json_object:)
17
- struct = JSON.parse(json_object, object_class: OpenStruct)
18
- begin
19
- struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
20
- return json_object
21
- rescue StandardError
22
- # noop
23
- end
24
- begin
25
- Realtime::TerminateSession.validate_raw(obj: struct)
26
- return Realtime::TerminateSession.from_json(json_object: json_object)
27
- rescue StandardError
28
- # noop
29
- end
30
- begin
31
- Realtime::ForceEndUtterance.validate_raw(obj: struct)
32
- return Realtime::ForceEndUtterance.from_json(json_object: json_object)
33
- rescue StandardError
34
- # noop
35
- end
36
- begin
37
- Realtime::ConfigureEndUtteranceSilenceThreshold.validate_raw(obj: struct)
38
- return Realtime::ConfigureEndUtteranceSilenceThreshold.from_json(json_object: json_object)
39
- rescue StandardError
40
- # noop
41
- end
42
- struct
43
- end
44
-
45
- # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
- #
47
- # @param obj [Object]
48
- # @return [Void]
49
- def self.validate_raw(obj:)
50
- begin
51
- return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
52
- rescue StandardError
53
- # noop
54
- end
55
- begin
56
- return Realtime::TerminateSession.validate_raw(obj: obj)
57
- rescue StandardError
58
- # noop
59
- end
60
- begin
61
- return Realtime::ForceEndUtterance.validate_raw(obj: obj)
62
- rescue StandardError
63
- # noop
64
- end
65
- begin
66
- return Realtime::ConfigureEndUtteranceSilenceThreshold.validate_raw(obj: obj)
67
- rescue StandardError
68
- # noop
69
- end
70
- raise("Passed value matched no type within the union, validation failed.")
71
- end
72
- end
73
- end
74
- end