assemblyai 1.0.0.pre.beta → 1.0.0.pre.beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assemblyai/lemur/client.rb +16 -16
- data/lib/assemblyai/lemur/types/lemur_base_params.rb +5 -5
- data/lib/assemblyai/lemur/types/lemur_base_params_context.rb +3 -29
- data/lib/assemblyai/lemur/types/lemur_model.rb +7 -7
- data/lib/assemblyai/lemur/types/lemur_question_context.rb +3 -29
- data/lib/assemblyai/realtime/types/audio_encoding.rb +5 -2
- data/lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb +48 -0
- data/lib/assemblyai/realtime/types/force_end_utterance.rb +48 -0
- data/lib/assemblyai/realtime/types/message_type.rb +6 -7
- data/lib/assemblyai/realtime/types/realtime_base_message.rb +6 -6
- data/lib/assemblyai/realtime/types/realtime_message.rb +6 -35
- data/lib/assemblyai/realtime/types/realtime_transcript.rb +3 -29
- data/lib/assemblyai/realtime/types/realtime_transcript_type.rb +4 -2
- data/lib/assemblyai/realtime/types/terminate_session.rb +5 -14
- data/lib/assemblyai/transcripts/client.rb +20 -20
- data/lib/assemblyai/transcripts/list_by_url_client.rb +57 -0
- data/lib/assemblyai/transcripts/polling_client.rb +27 -25
- data/lib/assemblyai/transcripts/types/audio_intelligence_model_status.rb +5 -2
- data/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +5 -5
- data/lib/assemblyai/transcripts/types/entity.rb +6 -11
- data/lib/assemblyai/transcripts/types/entity_type.rb +32 -32
- data/lib/assemblyai/transcripts/types/pii_policy.rb +29 -30
- data/lib/assemblyai/transcripts/types/polling_options.rb +14 -15
- data/lib/assemblyai/transcripts/types/redact_pii_audio_quality.rb +5 -2
- data/lib/assemblyai/transcripts/types/sentiment.rb +5 -2
- data/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb +6 -6
- data/lib/assemblyai/transcripts/types/speech_model.rb +4 -1
- data/lib/assemblyai/transcripts/types/substitution_policy.rb +5 -2
- data/lib/assemblyai/transcripts/types/subtitle_format.rb +5 -2
- data/lib/assemblyai/transcripts/types/summary_model.rb +6 -2
- data/lib/assemblyai/transcripts/types/summary_type.rb +8 -8
- data/lib/assemblyai/transcripts/types/topic_detection_model_result.rb +5 -9
- data/lib/assemblyai/transcripts/types/transcript.rb +26 -29
- data/lib/assemblyai/transcripts/types/transcript_boost_param.rb +6 -2
- data/lib/assemblyai/transcripts/types/transcript_language_code.rb +24 -23
- data/lib/assemblyai/transcripts/types/transcript_list_item.rb +5 -5
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +36 -39
- data/lib/assemblyai/transcripts/types/transcript_ready_notification.rb +54 -0
- data/lib/assemblyai/transcripts/types/transcript_ready_status.rb +11 -0
- data/lib/assemblyai/transcripts/types/transcript_status.rb +7 -2
- data/lib/assemblyai.rb +1 -0
- data/lib/requests.rb +28 -2
- data/lib/types_export.rb +9 -5
- metadata +57 -14
@@ -1,21 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
4
|
+
class Transcripts
|
5
|
+
# Configuration options for polling requests.
|
6
|
+
class PollingOptions
|
7
|
+
attr_reader :interval, :timeout
|
8
|
+
|
9
|
+
# @param interval [Integer] The amount of time to wait between polling requests, in milliseconds. Defaults to 3000.
|
10
|
+
# @param timeout [Integer] The maximum amount of time to wait for the transcript to be ready, in milliseconds. Defaults to -1, which means poll forever.
|
11
|
+
# @return [Transcripts::PollingOptions]
|
12
|
+
def initialize(interval: 3000, timeout: -1)
|
13
|
+
# @type [Integer] The amount of time to wait between polling requests, in milliseconds.
|
14
|
+
@interval = interval
|
15
|
+
# @type [Integer] The maximum amount of time to wait for the transcript to be ready, in milliseconds.
|
16
|
+
@timeout = timeout
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
21
|
-
|
20
|
+
end
|
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
5
|
+
# Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
|
6
|
+
class RedactPiiAudioQuality
|
7
|
+
MP3 = "mp3"
|
8
|
+
WAV = "wav"
|
9
|
+
end
|
7
10
|
end
|
8
11
|
end
|
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
|
6
|
-
|
5
|
+
class Sentiment
|
6
|
+
POSITIVE = "POSITIVE"
|
7
|
+
NEUTRAL = "NEUTRAL"
|
8
|
+
NEGATIVE = "NEGATIVE"
|
9
|
+
end
|
7
10
|
end
|
8
11
|
end
|
@@ -12,7 +12,7 @@ module AssemblyAI
|
|
12
12
|
# @param text [String] The transcript of the sentence
|
13
13
|
# @param start [Integer] The starting time, in milliseconds, of the sentence
|
14
14
|
# @param end_ [Integer] The ending time, in milliseconds, of the sentence
|
15
|
-
# @param sentiment [
|
15
|
+
# @param sentiment [Transcripts::Sentiment] The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE
|
16
16
|
# @param confidence [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1
|
17
17
|
# @param speaker [String] The speaker of the sentence if [Speaker Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is enabled, else null
|
18
18
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -24,7 +24,7 @@ module AssemblyAI
|
|
24
24
|
@start = start
|
25
25
|
# @type [Integer] The ending time, in milliseconds, of the sentence
|
26
26
|
@end_ = end_
|
27
|
-
# @type [
|
27
|
+
# @type [Transcripts::Sentiment] The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE
|
28
28
|
@sentiment = sentiment
|
29
29
|
# @type [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1
|
30
30
|
@confidence = confidence
|
@@ -40,11 +40,11 @@ module AssemblyAI
|
|
40
40
|
# @return [Transcripts::SentimentAnalysisResult]
|
41
41
|
def self.from_json(json_object:)
|
42
42
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
-
|
43
|
+
JSON.parse(json_object)
|
44
44
|
text = struct.text
|
45
45
|
start = struct.start
|
46
46
|
end_ = struct.end
|
47
|
-
sentiment =
|
47
|
+
sentiment = struct.sentiment
|
48
48
|
confidence = struct.confidence
|
49
49
|
speaker = struct.speaker
|
50
50
|
new(text: text, start: start, end_: end_, sentiment: sentiment, confidence: confidence, speaker: speaker,
|
@@ -59,7 +59,7 @@ module AssemblyAI
|
|
59
59
|
"text": @text,
|
60
60
|
"start": @start,
|
61
61
|
"end": @end_,
|
62
|
-
"sentiment":
|
62
|
+
"sentiment": @sentiment,
|
63
63
|
"confidence": @confidence,
|
64
64
|
"speaker": @speaker
|
65
65
|
}.to_json
|
@@ -73,7 +73,7 @@ module AssemblyAI
|
|
73
73
|
obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
74
74
|
obj.start.is_a?(Integer) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
|
75
75
|
obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
|
76
|
-
obj.sentiment.is_a?(Transcripts::
|
76
|
+
obj.sentiment.is_a?(Transcripts::Sentiment) != false || raise("Passed value for field obj.sentiment is not the expected type, validation failed.")
|
77
77
|
obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
|
78
78
|
obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
|
79
79
|
end
|
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
5
|
+
# The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
|
6
|
+
class SubstitutionPolicy
|
7
|
+
ENTITY_TYPE = "entity_type"
|
8
|
+
HASH = "hash"
|
9
|
+
end
|
7
10
|
end
|
8
11
|
end
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
5
|
+
# The model to summarize the transcript
|
6
|
+
class SummaryModel
|
7
|
+
INFORMATIVE = "informative"
|
8
|
+
CONVERSATIONAL = "conversational"
|
9
|
+
CATCHY = "catchy"
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
# The type of summary
|
6
|
+
class SummaryType
|
7
|
+
BULLETS = "bullets"
|
8
|
+
BULLETS_VERBOSE = "bullets_verbose"
|
9
|
+
GIST = "gist"
|
10
|
+
HEADLINE = "headline"
|
11
|
+
PARAGRAPH = "paragraph"
|
12
|
+
end
|
13
13
|
end
|
14
14
|
end
|
@@ -11,13 +11,13 @@ module AssemblyAI
|
|
11
11
|
class TopicDetectionModelResult
|
12
12
|
attr_reader :status, :results, :summary, :additional_properties
|
13
13
|
|
14
|
-
# @param status [
|
14
|
+
# @param status [Transcripts::AudioIntelligenceModelStatus] The status of the Topic Detection model. Either success, or unavailable in the rare case that the model failed.
|
15
15
|
# @param results [Array<Transcripts::TopicDetectionResult>] An array of results for the Topic Detection model
|
16
16
|
# @param summary [Hash{String => String}] The overall relevance of topic to the entire audio file
|
17
17
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
18
18
|
# @return [Transcripts::TopicDetectionModelResult]
|
19
19
|
def initialize(status:, results:, summary:, additional_properties: nil)
|
20
|
-
# @type [
|
20
|
+
# @type [Transcripts::AudioIntelligenceModelStatus] The status of the Topic Detection model. Either success, or unavailable in the rare case that the model failed.
|
21
21
|
@status = status
|
22
22
|
# @type [Array<Transcripts::TopicDetectionResult>] An array of results for the Topic Detection model
|
23
23
|
@results = results
|
@@ -34,7 +34,7 @@ module AssemblyAI
|
|
34
34
|
def self.from_json(json_object:)
|
35
35
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
36
|
parsed_json = JSON.parse(json_object)
|
37
|
-
status =
|
37
|
+
status = struct.status
|
38
38
|
results = parsed_json["results"]&.map do |v|
|
39
39
|
v = v.to_json
|
40
40
|
Transcripts::TopicDetectionResult.from_json(json_object: v)
|
@@ -47,11 +47,7 @@ module AssemblyAI
|
|
47
47
|
#
|
48
48
|
# @return [JSON]
|
49
49
|
def to_json(*_args)
|
50
|
-
{
|
51
|
-
"status": Transcripts::AUDIO_INTELLIGENCE_MODEL_STATUS[@status] || @status,
|
52
|
-
"results": @results,
|
53
|
-
"summary": @summary
|
54
|
-
}.to_json
|
50
|
+
{ "status": @status, "results": @results, "summary": @summary }.to_json
|
55
51
|
end
|
56
52
|
|
57
53
|
# 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.
|
@@ -59,7 +55,7 @@ module AssemblyAI
|
|
59
55
|
# @param obj [Object]
|
60
56
|
# @return [Void]
|
61
57
|
def self.validate_raw(obj:)
|
62
|
-
obj.status.is_a?(Transcripts::
|
58
|
+
obj.status.is_a?(Transcripts::AudioIntelligenceModelStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
63
59
|
obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
64
60
|
obj.summary.is_a?(Hash) != false || raise("Passed value for field obj.summary is not the expected type, validation failed.")
|
65
61
|
end
|
@@ -25,11 +25,11 @@ module AssemblyAI
|
|
25
25
|
:words, :utterances, :confidence, :audio_duration, :punctuate, :format_text, :dual_channel, :webhook_url, :webhook_status_code, :webhook_auth, :webhook_auth_header_name, :speed_boost, :auto_highlights, :auto_highlights_result, :audio_start_from, :audio_end_at, :word_boost, :boost_param, :filter_profanity, :redact_pii, :redact_pii_audio, :redact_pii_audio_quality, :redact_pii_policies, :redact_pii_sub, :speaker_labels, :speakers_expected, :content_safety, :content_safety_labels, :iab_categories, :iab_categories_result, :language_detection, :custom_spelling, :auto_chapters, :chapters, :summarization, :summary_type, :summary_model, :summary, :custom_topics, :topics, :disfluencies, :sentiment_analysis, :sentiment_analysis_results, :entity_detection, :entities, :speech_threshold, :throttled, :error, :additional_properties
|
26
26
|
|
27
27
|
# @param id [String] The unique identifier of your transcript
|
28
|
-
# @param speech_model [Transcripts::
|
28
|
+
# @param speech_model [Transcripts::SpeechModel]
|
29
29
|
# @param language_model [String] The language model that was used for the transcript
|
30
30
|
# @param acoustic_model [String] The acoustic model that was used for the transcript
|
31
|
-
# @param status [
|
32
|
-
# @param language_code [
|
31
|
+
# @param status [Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing, completed, or error.
|
32
|
+
# @param language_code [Transcripts::TranscriptLanguageCode] The language of your audio file.
|
33
33
|
# Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
34
34
|
# The default value is 'en_us'.
|
35
35
|
# @param audio_url [String] The URL of the media that was transcribed
|
@@ -58,10 +58,10 @@ module AssemblyAI
|
|
58
58
|
# @param redact_pii [Boolean] Whether [PII Redaction](https://www.assemblyai.com/docs/models/pii-redaction) is enabled, either true or false
|
59
59
|
# @param redact_pii_audio [Boolean] Whether a redacted version of the audio file was generated,
|
60
60
|
# either true or false. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more information.
|
61
|
-
# @param redact_pii_audio_quality [
|
62
|
-
# @param redact_pii_policies [Array<Transcripts::
|
61
|
+
# @param redact_pii_audio_quality [Transcripts::RedactPiiAudioQuality]
|
62
|
+
# @param redact_pii_policies [Array<Transcripts::PiiPolicy>] The list of PII Redaction policies that were enabled, if PII Redaction is enabled.
|
63
63
|
# See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more information.
|
64
|
-
# @param redact_pii_sub [
|
64
|
+
# @param redact_pii_sub [Transcripts::SubstitutionPolicy] The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
|
65
65
|
# @param speaker_labels [Boolean] Whether [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is enabled, can be true or false
|
66
66
|
# @param speakers_expected [Integer] Tell the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for more details.
|
67
67
|
# @param content_safety [Boolean] Whether [Content Moderation](https://www.assemblyai.com/docs/models/content-moderation) is enabled, can be true or false
|
@@ -96,15 +96,15 @@ module AssemblyAI
|
|
96
96
|
text: nil, words: nil, utterances: nil, confidence: nil, audio_duration: nil, punctuate: nil, format_text: nil, dual_channel: nil, webhook_url: nil, webhook_status_code: nil, webhook_auth_header_name: nil, speed_boost: nil, auto_highlights_result: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_labels: nil, iab_categories: nil, iab_categories_result: nil, language_detection: nil, custom_spelling: nil, auto_chapters: nil, chapters: nil, summary_type: nil, summary_model: nil, summary: nil, custom_topics: nil, topics: nil, disfluencies: nil, sentiment_analysis: nil, sentiment_analysis_results: nil, entity_detection: nil, entities: nil, speech_threshold: nil, throttled: nil, error: nil, additional_properties: nil)
|
97
97
|
# @type [String] The unique identifier of your transcript
|
98
98
|
@id = id
|
99
|
-
# @type [Transcripts::
|
99
|
+
# @type [Transcripts::SpeechModel]
|
100
100
|
@speech_model = speech_model
|
101
101
|
# @type [String] The language model that was used for the transcript
|
102
102
|
@language_model = language_model
|
103
103
|
# @type [String] The acoustic model that was used for the transcript
|
104
104
|
@acoustic_model = acoustic_model
|
105
|
-
# @type [
|
105
|
+
# @type [Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing, completed, or error.
|
106
106
|
@status = status
|
107
|
-
# @type [
|
107
|
+
# @type [Transcripts::TranscriptLanguageCode] The language of your audio file.
|
108
108
|
# Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
109
109
|
# The default value is 'en_us'.
|
110
110
|
@language_code = language_code
|
@@ -157,12 +157,12 @@ module AssemblyAI
|
|
157
157
|
# @type [Boolean] Whether a redacted version of the audio file was generated,
|
158
158
|
# either true or false. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more information.
|
159
159
|
@redact_pii_audio = redact_pii_audio
|
160
|
-
# @type [
|
160
|
+
# @type [Transcripts::RedactPiiAudioQuality]
|
161
161
|
@redact_pii_audio_quality = redact_pii_audio_quality
|
162
|
-
# @type [Array<Transcripts::
|
162
|
+
# @type [Array<Transcripts::PiiPolicy>] The list of PII Redaction policies that were enabled, if PII Redaction is enabled.
|
163
163
|
# See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more information.
|
164
164
|
@redact_pii_policies = redact_pii_policies
|
165
|
-
# @type [
|
165
|
+
# @type [Transcripts::SubstitutionPolicy] The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
|
166
166
|
@redact_pii_sub = redact_pii_sub
|
167
167
|
# @type [Boolean] Whether [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is enabled, can be true or false
|
168
168
|
@speaker_labels = speaker_labels
|
@@ -231,8 +231,8 @@ module AssemblyAI
|
|
231
231
|
speech_model = struct.speech_model
|
232
232
|
language_model = struct.language_model
|
233
233
|
acoustic_model = struct.acoustic_model
|
234
|
-
status =
|
235
|
-
language_code =
|
234
|
+
status = struct.status
|
235
|
+
language_code = struct.language_code
|
236
236
|
audio_url = struct.audio_url
|
237
237
|
text = struct.text
|
238
238
|
words = parsed_json["words"]&.map do |v|
|
@@ -267,12 +267,9 @@ module AssemblyAI
|
|
267
267
|
filter_profanity = struct.filter_profanity
|
268
268
|
redact_pii = struct.redact_pii
|
269
269
|
redact_pii_audio = struct.redact_pii_audio
|
270
|
-
redact_pii_audio_quality =
|
271
|
-
redact_pii_policies =
|
272
|
-
|
273
|
-
Transcripts::PII_POLICY.key(v) || v
|
274
|
-
end
|
275
|
-
redact_pii_sub = Transcripts::SUBSTITUTION_POLICY.key(parsed_json["redact_pii_sub"]) || parsed_json["redact_pii_sub"]
|
270
|
+
redact_pii_audio_quality = struct.redact_pii_audio_quality
|
271
|
+
redact_pii_policies = struct.redact_pii_policies
|
272
|
+
redact_pii_sub = struct.redact_pii_sub
|
276
273
|
speaker_labels = struct.speaker_labels
|
277
274
|
speakers_expected = struct.speakers_expected
|
278
275
|
content_safety = struct.content_safety
|
@@ -332,8 +329,8 @@ module AssemblyAI
|
|
332
329
|
"speech_model": @speech_model,
|
333
330
|
"language_model": @language_model,
|
334
331
|
"acoustic_model": @acoustic_model,
|
335
|
-
"status":
|
336
|
-
"language_code":
|
332
|
+
"status": @status,
|
333
|
+
"language_code": @language_code,
|
337
334
|
"audio_url": @audio_url,
|
338
335
|
"text": @text,
|
339
336
|
"words": @words,
|
@@ -357,9 +354,9 @@ module AssemblyAI
|
|
357
354
|
"filter_profanity": @filter_profanity,
|
358
355
|
"redact_pii": @redact_pii,
|
359
356
|
"redact_pii_audio": @redact_pii_audio,
|
360
|
-
"redact_pii_audio_quality":
|
357
|
+
"redact_pii_audio_quality": @redact_pii_audio_quality,
|
361
358
|
"redact_pii_policies": @redact_pii_policies,
|
362
|
-
"redact_pii_sub":
|
359
|
+
"redact_pii_sub": @redact_pii_sub,
|
363
360
|
"speaker_labels": @speaker_labels,
|
364
361
|
"speakers_expected": @speakers_expected,
|
365
362
|
"content_safety": @content_safety,
|
@@ -393,11 +390,11 @@ module AssemblyAI
|
|
393
390
|
# @return [Void]
|
394
391
|
def self.validate_raw(obj:)
|
395
392
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
396
|
-
obj.speech_model&.is_a?(
|
393
|
+
obj.speech_model&.is_a?(Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
|
397
394
|
obj.language_model.is_a?(String) != false || raise("Passed value for field obj.language_model is not the expected type, validation failed.")
|
398
395
|
obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
|
399
|
-
obj.status.is_a?(Transcripts::
|
400
|
-
obj.language_code&.is_a?(Transcripts::
|
396
|
+
obj.status.is_a?(Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
397
|
+
obj.language_code&.is_a?(Transcripts::TranscriptLanguageCode) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.")
|
401
398
|
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|
402
399
|
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
403
400
|
obj.words&.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
|
@@ -421,9 +418,9 @@ module AssemblyAI
|
|
421
418
|
obj.filter_profanity&.is_a?(Boolean) != false || raise("Passed value for field obj.filter_profanity is not the expected type, validation failed.")
|
422
419
|
obj.redact_pii.is_a?(Boolean) != false || raise("Passed value for field obj.redact_pii is not the expected type, validation failed.")
|
423
420
|
obj.redact_pii_audio&.is_a?(Boolean) != false || raise("Passed value for field obj.redact_pii_audio is not the expected type, validation failed.")
|
424
|
-
obj.redact_pii_audio_quality&.is_a?(Transcripts::
|
421
|
+
obj.redact_pii_audio_quality&.is_a?(Transcripts::RedactPiiAudioQuality) != false || raise("Passed value for field obj.redact_pii_audio_quality is not the expected type, validation failed.")
|
425
422
|
obj.redact_pii_policies&.is_a?(Array) != false || raise("Passed value for field obj.redact_pii_policies is not the expected type, validation failed.")
|
426
|
-
obj.redact_pii_sub&.is_a?(Transcripts::
|
423
|
+
obj.redact_pii_sub&.is_a?(Transcripts::SubstitutionPolicy) != false || raise("Passed value for field obj.redact_pii_sub is not the expected type, validation failed.")
|
427
424
|
obj.speaker_labels&.is_a?(Boolean) != false || raise("Passed value for field obj.speaker_labels is not the expected type, validation failed.")
|
428
425
|
obj.speakers_expected&.is_a?(Integer) != false || raise("Passed value for field obj.speakers_expected is not the expected type, validation failed.")
|
429
426
|
obj.content_safety&.is_a?(Boolean) != false || raise("Passed value for field obj.content_safety is not the expected type, validation failed.")
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
5
|
+
# The word boost parameter value
|
6
|
+
class TranscriptBoostParam
|
7
|
+
LOW = "low"
|
8
|
+
DEFAULT = "default"
|
9
|
+
HIGH = "high"
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
@@ -2,28 +2,29 @@
|
|
2
2
|
|
3
3
|
module AssemblyAI
|
4
4
|
class Transcripts
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
5
|
+
# The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
6
|
+
# The default value is 'en_us'.
|
7
|
+
class TranscriptLanguageCode
|
8
|
+
EN = "en"
|
9
|
+
EN_AU = "en_au"
|
10
|
+
EN_UK = "en_uk"
|
11
|
+
EN_US = "en_us"
|
12
|
+
ES = "es"
|
13
|
+
FR = "fr"
|
14
|
+
DE = "de"
|
15
|
+
IT = "it"
|
16
|
+
PT = "pt"
|
17
|
+
NL = "nl"
|
18
|
+
HI = "hi"
|
19
|
+
JA = "ja"
|
20
|
+
ZH = "zh"
|
21
|
+
FI = "fi"
|
22
|
+
KO = "ko"
|
23
|
+
PL = "pl"
|
24
|
+
RU = "ru"
|
25
|
+
TR = "tr"
|
26
|
+
UK = "uk"
|
27
|
+
VI = "vi"
|
28
|
+
end
|
28
29
|
end
|
29
30
|
end
|
@@ -11,7 +11,7 @@ module AssemblyAI
|
|
11
11
|
|
12
12
|
# @param id [String]
|
13
13
|
# @param resource_url [String]
|
14
|
-
# @param status [
|
14
|
+
# @param status [Transcripts::TranscriptStatus]
|
15
15
|
# @param created [DateTime]
|
16
16
|
# @param completed [DateTime]
|
17
17
|
# @param audio_url [String]
|
@@ -22,7 +22,7 @@ module AssemblyAI
|
|
22
22
|
@id = id
|
23
23
|
# @type [String]
|
24
24
|
@resource_url = resource_url
|
25
|
-
# @type [
|
25
|
+
# @type [Transcripts::TranscriptStatus]
|
26
26
|
@status = status
|
27
27
|
# @type [DateTime]
|
28
28
|
@created = created
|
@@ -43,7 +43,7 @@ module AssemblyAI
|
|
43
43
|
parsed_json = JSON.parse(json_object)
|
44
44
|
id = struct.id
|
45
45
|
resource_url = struct.resource_url
|
46
|
-
status =
|
46
|
+
status = struct.status
|
47
47
|
created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?)
|
48
48
|
completed = (DateTime.parse(parsed_json["completed"]) unless parsed_json["completed"].nil?)
|
49
49
|
audio_url = struct.audio_url
|
@@ -58,7 +58,7 @@ module AssemblyAI
|
|
58
58
|
{
|
59
59
|
"id": @id,
|
60
60
|
"resource_url": @resource_url,
|
61
|
-
"status":
|
61
|
+
"status": @status,
|
62
62
|
"created": @created,
|
63
63
|
"completed": @completed,
|
64
64
|
"audio_url": @audio_url
|
@@ -72,7 +72,7 @@ module AssemblyAI
|
|
72
72
|
def self.validate_raw(obj:)
|
73
73
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
74
74
|
obj.resource_url.is_a?(String) != false || raise("Passed value for field obj.resource_url is not the expected type, validation failed.")
|
75
|
-
obj.status.is_a?(Transcripts::
|
75
|
+
obj.status.is_a?(Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
76
76
|
obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
|
77
77
|
obj.completed.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
|
78
78
|
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|