assemblyai 1.0.0.pre.beta.12 → 1.0.0.pre.beta.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assemblyai/lemur/client.rb +2 -2
- data/lib/assemblyai/lemur/types/lemur_action_items_response.rb +2 -2
- data/lib/assemblyai/lemur/types/lemur_response.rb +4 -32
- data/lib/assemblyai/lemur/types/lemur_string_response.rb +80 -0
- data/lib/assemblyai/lemur/types/lemur_summary_response.rb +2 -2
- data/lib/assemblyai/{streaming/types/streaming.rb → realtime/types/realtime.rb} +2 -2
- data/lib/assemblyai/{streaming → realtime}/types/receive_message.rb +8 -8
- data/lib/assemblyai/{streaming → realtime}/types/send_message.rb +5 -5
- data/lib/assemblyai/transcripts/types/paragraphs_response.rb +3 -3
- data/lib/assemblyai/transcripts/types/redacted_audio_notification.rb +9 -0
- data/lib/assemblyai/transcripts/types/sentences_response.rb +3 -3
- data/lib/assemblyai/transcripts/types/transcript.rb +19 -11
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +14 -8
- data/lib/assemblyai/transcripts/types/transcript_webhook_notification.rb +61 -0
- data/lib/gemconfig.rb +1 -1
- data/lib/types_export.rb +11 -8
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57111906829dc5c8b672c47fcfac95d6e6e05d6fd3df8523d16c5299f09e5aaf
|
4
|
+
data.tar.gz: 0300a4db2f0fa441594d7053f5232e06aaf70fddba251abe6664f4fbe4c1a617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501408f75273f6695433ea50640fa988db643e729341d70e1cc9275b0f3c26731d3321d62b3b610ccdbc6791ee8fc4a7824d448c3060d9f403ed7bf0e2e550ec
|
7
|
+
data.tar.gz: 4ee7018bf271a68a4fdec8c7676253188375ee9f00fb40a7d34d284fc93b87a0e3a31e702f5883031cb27712674abc9aa8462ad289ce7dd8aba4b66eb98f93a5
|
@@ -230,7 +230,7 @@ module AssemblyAI
|
|
230
230
|
# @param request_id [String] The ID of the LeMUR request you previously made.
|
231
231
|
# This would be found in the response of the original request.
|
232
232
|
# @param request_options [AssemblyAI::RequestOptions]
|
233
|
-
# @return [AssemblyAI::Lemur::
|
233
|
+
# @return [AssemblyAI::Lemur::LemurStringResponse, AssemblyAI::Lemur::LemurQuestionAnswerResponse]
|
234
234
|
# @example
|
235
235
|
# api = AssemblyAI::Client.new(
|
236
236
|
# environment: AssemblyAI::Environment::DEFAULT,
|
@@ -499,7 +499,7 @@ module AssemblyAI
|
|
499
499
|
# @param request_id [String] The ID of the LeMUR request you previously made.
|
500
500
|
# This would be found in the response of the original request.
|
501
501
|
# @param request_options [AssemblyAI::RequestOptions]
|
502
|
-
# @return [AssemblyAI::Lemur::
|
502
|
+
# @return [AssemblyAI::Lemur::LemurStringResponse, AssemblyAI::Lemur::LemurQuestionAnswerResponse]
|
503
503
|
# @example
|
504
504
|
# api = AssemblyAI::Client.new(
|
505
505
|
# environment: AssemblyAI::Environment::DEFAULT,
|
@@ -7,7 +7,7 @@ require "json"
|
|
7
7
|
module AssemblyAI
|
8
8
|
class Lemur
|
9
9
|
class LemurActionItemsResponse
|
10
|
-
# @return [String] The response generated by LeMUR
|
10
|
+
# @return [String] The response generated by LeMUR.
|
11
11
|
attr_reader :response
|
12
12
|
# @return [String] The ID of the LeMUR request
|
13
13
|
attr_reader :request_id
|
@@ -21,7 +21,7 @@ module AssemblyAI
|
|
21
21
|
|
22
22
|
OMIT = Object.new
|
23
23
|
|
24
|
-
# @param response [String] The response generated by LeMUR
|
24
|
+
# @param response [String] The response generated by LeMUR.
|
25
25
|
# @param request_id [String] The ID of the LeMUR request
|
26
26
|
# @param usage [AssemblyAI::Lemur::LemurUsage] The usage numbers for the LeMUR request
|
27
27
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "lemur_summary_response"
|
4
|
+
require_relative "lemur_string_response"
|
6
5
|
require_relative "lemur_question_answer_response"
|
7
|
-
require_relative "lemur_action_items_response"
|
8
6
|
|
9
7
|
module AssemblyAI
|
10
8
|
class Lemur
|
@@ -16,16 +14,8 @@ module AssemblyAI
|
|
16
14
|
def self.from_json(json_object:)
|
17
15
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
18
16
|
begin
|
19
|
-
AssemblyAI::Lemur::
|
20
|
-
return AssemblyAI::Lemur::
|
21
|
-
|
22
|
-
return nil
|
23
|
-
rescue StandardError
|
24
|
-
# noop
|
25
|
-
end
|
26
|
-
begin
|
27
|
-
AssemblyAI::Lemur::LemurSummaryResponse.validate_raw(obj: struct)
|
28
|
-
return AssemblyAI::Lemur::LemurSummaryResponse.from_json(json_object: json_object) unless json_object.nil?
|
17
|
+
AssemblyAI::Lemur::LemurStringResponse.validate_raw(obj: struct)
|
18
|
+
return AssemblyAI::Lemur::LemurStringResponse.from_json(json_object: json_object) unless json_object.nil?
|
29
19
|
|
30
20
|
return nil
|
31
21
|
rescue StandardError
|
@@ -41,14 +31,6 @@ module AssemblyAI
|
|
41
31
|
rescue StandardError
|
42
32
|
# noop
|
43
33
|
end
|
44
|
-
begin
|
45
|
-
AssemblyAI::Lemur::LemurActionItemsResponse.validate_raw(obj: struct)
|
46
|
-
return AssemblyAI::Lemur::LemurActionItemsResponse.from_json(json_object: json_object) unless json_object.nil?
|
47
|
-
|
48
|
-
return nil
|
49
|
-
rescue StandardError
|
50
|
-
# noop
|
51
|
-
end
|
52
34
|
struct
|
53
35
|
end
|
54
36
|
|
@@ -60,12 +42,7 @@ module AssemblyAI
|
|
60
42
|
# @return [Void]
|
61
43
|
def self.validate_raw(obj:)
|
62
44
|
begin
|
63
|
-
return AssemblyAI::Lemur::
|
64
|
-
rescue StandardError
|
65
|
-
# noop
|
66
|
-
end
|
67
|
-
begin
|
68
|
-
return AssemblyAI::Lemur::LemurSummaryResponse.validate_raw(obj: obj)
|
45
|
+
return AssemblyAI::Lemur::LemurStringResponse.validate_raw(obj: obj)
|
69
46
|
rescue StandardError
|
70
47
|
# noop
|
71
48
|
end
|
@@ -74,11 +51,6 @@ module AssemblyAI
|
|
74
51
|
rescue StandardError
|
75
52
|
# noop
|
76
53
|
end
|
77
|
-
begin
|
78
|
-
return AssemblyAI::Lemur::LemurActionItemsResponse.validate_raw(obj: obj)
|
79
|
-
rescue StandardError
|
80
|
-
# noop
|
81
|
-
end
|
82
54
|
raise("Passed value matched no type within the union, validation failed.")
|
83
55
|
end
|
84
56
|
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lemur_usage"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module AssemblyAI
|
8
|
+
class Lemur
|
9
|
+
class LemurStringResponse
|
10
|
+
# @return [String] The response generated by LeMUR.
|
11
|
+
attr_reader :response
|
12
|
+
# @return [String] The ID of the LeMUR request
|
13
|
+
attr_reader :request_id
|
14
|
+
# @return [AssemblyAI::Lemur::LemurUsage] The usage numbers for the LeMUR request
|
15
|
+
attr_reader :usage
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param response [String] The response generated by LeMUR.
|
25
|
+
# @param request_id [String] The ID of the LeMUR request
|
26
|
+
# @param usage [AssemblyAI::Lemur::LemurUsage] The usage numbers for the LeMUR request
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
# @return [AssemblyAI::Lemur::LemurStringResponse]
|
29
|
+
def initialize(response:, request_id:, usage:, additional_properties: nil)
|
30
|
+
@response = response
|
31
|
+
@request_id = request_id
|
32
|
+
@usage = usage
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "response": response, "request_id": request_id, "usage": usage }
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of LemurStringResponse
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [AssemblyAI::Lemur::LemurStringResponse]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
response = struct["response"]
|
45
|
+
request_id = struct["request_id"]
|
46
|
+
if parsed_json["usage"].nil?
|
47
|
+
usage = nil
|
48
|
+
else
|
49
|
+
usage = parsed_json["usage"].to_json
|
50
|
+
usage = AssemblyAI::Lemur::LemurUsage.from_json(json_object: usage)
|
51
|
+
end
|
52
|
+
new(
|
53
|
+
response: response,
|
54
|
+
request_id: request_id,
|
55
|
+
usage: usage,
|
56
|
+
additional_properties: struct
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Serialize an instance of LemurStringResponse to a JSON object
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
def to_json(*_args)
|
64
|
+
@_field_set&.to_json
|
65
|
+
end
|
66
|
+
|
67
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
68
|
+
# hash and check each fields type against the current object's property
|
69
|
+
# definitions.
|
70
|
+
#
|
71
|
+
# @param obj [Object]
|
72
|
+
# @return [Void]
|
73
|
+
def self.validate_raw(obj:)
|
74
|
+
obj.response.is_a?(String) != false || raise("Passed value for field obj.response is not the expected type, validation failed.")
|
75
|
+
obj.request_id.is_a?(String) != false || raise("Passed value for field obj.request_id is not the expected type, validation failed.")
|
76
|
+
AssemblyAI::Lemur::LemurUsage.validate_raw(obj: obj.usage)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -7,7 +7,7 @@ require "json"
|
|
7
7
|
module AssemblyAI
|
8
8
|
class Lemur
|
9
9
|
class LemurSummaryResponse
|
10
|
-
# @return [String] The response generated by LeMUR
|
10
|
+
# @return [String] The response generated by LeMUR.
|
11
11
|
attr_reader :response
|
12
12
|
# @return [String] The ID of the LeMUR request
|
13
13
|
attr_reader :request_id
|
@@ -21,7 +21,7 @@ module AssemblyAI
|
|
21
21
|
|
22
22
|
OMIT = Object.new
|
23
23
|
|
24
|
-
# @param response [String] The response generated by LeMUR
|
24
|
+
# @param response [String] The response generated by LeMUR.
|
25
25
|
# @param request_id [String] The ID of the LeMUR request
|
26
26
|
# @param usage [AssemblyAI::Lemur::LemurUsage] The usage numbers for the LeMUR request
|
27
27
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -1,21 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
9
|
-
require_relative "
|
4
|
+
require_relative "session_begins"
|
5
|
+
require_relative "partial_transcript"
|
6
|
+
require_relative "final_transcript"
|
7
|
+
require_relative "session_information"
|
8
|
+
require_relative "session_terminated"
|
9
|
+
require_relative "realtime_error"
|
10
10
|
|
11
11
|
module AssemblyAI
|
12
|
-
class
|
12
|
+
class Realtime
|
13
13
|
# Receive messages from the WebSocket
|
14
14
|
class ReceiveMessage
|
15
15
|
# Deserialize a JSON object to an instance of ReceiveMessage
|
16
16
|
#
|
17
17
|
# @param json_object [String]
|
18
|
-
# @return [AssemblyAI::
|
18
|
+
# @return [AssemblyAI::Realtime::ReceiveMessage]
|
19
19
|
def self.from_json(json_object:)
|
20
20
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
21
21
|
begin
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
4
|
+
require_relative "terminate_session"
|
5
|
+
require_relative "force_end_utterance"
|
6
|
+
require_relative "configure_end_utterance_silence_threshold"
|
7
7
|
|
8
8
|
module AssemblyAI
|
9
|
-
class
|
9
|
+
class Realtime
|
10
10
|
# Send messages to the WebSocket
|
11
11
|
class SendMessage
|
12
12
|
# Deserialize a JSON object to an instance of SendMessage
|
13
13
|
#
|
14
14
|
# @param json_object [String]
|
15
|
-
# @return [AssemblyAI::
|
15
|
+
# @return [AssemblyAI::Realtime::SendMessage]
|
16
16
|
def self.from_json(json_object:)
|
17
17
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
18
18
|
begin
|
@@ -11,7 +11,7 @@ module AssemblyAI
|
|
11
11
|
attr_reader :id
|
12
12
|
# @return [Float]
|
13
13
|
attr_reader :confidence
|
14
|
-
# @return [
|
14
|
+
# @return [Integer]
|
15
15
|
attr_reader :audio_duration
|
16
16
|
# @return [Array<AssemblyAI::Transcripts::TranscriptParagraph>]
|
17
17
|
attr_reader :paragraphs
|
@@ -25,7 +25,7 @@ module AssemblyAI
|
|
25
25
|
|
26
26
|
# @param id [String]
|
27
27
|
# @param confidence [Float]
|
28
|
-
# @param audio_duration [
|
28
|
+
# @param audio_duration [Integer]
|
29
29
|
# @param paragraphs [Array<AssemblyAI::Transcripts::TranscriptParagraph>]
|
30
30
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
31
|
# @return [AssemblyAI::Transcripts::ParagraphsResponse]
|
@@ -77,7 +77,7 @@ module AssemblyAI
|
|
77
77
|
def self.validate_raw(obj:)
|
78
78
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
79
79
|
obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
|
80
|
-
obj.audio_duration.is_a?(
|
80
|
+
obj.audio_duration.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
|
81
81
|
obj.paragraphs.is_a?(Array) != false || raise("Passed value for field obj.paragraphs is not the expected type, validation failed.")
|
82
82
|
end
|
83
83
|
end
|
@@ -11,7 +11,7 @@ module AssemblyAI
|
|
11
11
|
attr_reader :id
|
12
12
|
# @return [Float]
|
13
13
|
attr_reader :confidence
|
14
|
-
# @return [
|
14
|
+
# @return [Integer]
|
15
15
|
attr_reader :audio_duration
|
16
16
|
# @return [Array<AssemblyAI::Transcripts::TranscriptSentence>]
|
17
17
|
attr_reader :sentences
|
@@ -25,7 +25,7 @@ module AssemblyAI
|
|
25
25
|
|
26
26
|
# @param id [String]
|
27
27
|
# @param confidence [Float]
|
28
|
-
# @param audio_duration [
|
28
|
+
# @param audio_duration [Integer]
|
29
29
|
# @param sentences [Array<AssemblyAI::Transcripts::TranscriptSentence>]
|
30
30
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
31
|
# @return [AssemblyAI::Transcripts::SentencesResponse]
|
@@ -77,7 +77,7 @@ module AssemblyAI
|
|
77
77
|
def self.validate_raw(obj:)
|
78
78
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
79
79
|
obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
|
80
|
-
obj.audio_duration.is_a?(
|
80
|
+
obj.audio_duration.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
|
81
81
|
obj.sentences.is_a?(Array) != false || raise("Passed value for field obj.sentences is not the expected type, validation failed.")
|
82
82
|
end
|
83
83
|
end
|
@@ -55,7 +55,7 @@ module AssemblyAI
|
|
55
55
|
# @return [Float] The confidence score for the transcript, between 0.0 (low confidence) and 1.0
|
56
56
|
# (high confidence)
|
57
57
|
attr_reader :confidence
|
58
|
-
# @return [
|
58
|
+
# @return [Integer] The duration of this transcript object's media file, in seconds
|
59
59
|
attr_reader :audio_duration
|
60
60
|
# @return [Boolean] Whether Automatic Punctuation is enabled, either true or false
|
61
61
|
attr_reader :punctuate
|
@@ -67,14 +67,18 @@ module AssemblyAI
|
|
67
67
|
attr_reader :dual_channel
|
68
68
|
# @return [AssemblyAI::Transcripts::SpeechModel]
|
69
69
|
attr_reader :speech_model
|
70
|
-
# @return [String] The URL to which we send
|
70
|
+
# @return [String] The URL to which we send webhook requests.
|
71
|
+
# We sends two different types of webhook requests.
|
72
|
+
# One request when a transcript is completed or failed, and one request when the
|
73
|
+
# redacted audio is ready if redact_pii_audio is enabled.
|
71
74
|
attr_reader :webhook_url
|
72
|
-
# @return [Integer] The status code we received from your server when delivering
|
73
|
-
# webhook URL was provided
|
75
|
+
# @return [Integer] The status code we received from your server when delivering the transcript
|
76
|
+
# completed or failed webhook request, if a webhook URL was provided
|
74
77
|
attr_reader :webhook_status_code
|
75
78
|
# @return [Boolean] Whether webhook authentication details were provided
|
76
79
|
attr_reader :webhook_auth
|
77
|
-
# @return [String] The header name
|
80
|
+
# @return [String] The header name to be sent with the transcript completed or failed webhook
|
81
|
+
# requests
|
78
82
|
attr_reader :webhook_auth_header_name
|
79
83
|
# @return [Boolean] Whether speed boost is enabled
|
80
84
|
attr_reader :speed_boost
|
@@ -223,18 +227,22 @@ module AssemblyAI
|
|
223
227
|
# more information.
|
224
228
|
# @param confidence [Float] The confidence score for the transcript, between 0.0 (low confidence) and 1.0
|
225
229
|
# (high confidence)
|
226
|
-
# @param audio_duration [
|
230
|
+
# @param audio_duration [Integer] The duration of this transcript object's media file, in seconds
|
227
231
|
# @param punctuate [Boolean] Whether Automatic Punctuation is enabled, either true or false
|
228
232
|
# @param format_text [Boolean] Whether Text Formatting is enabled, either true or false
|
229
233
|
# @param dual_channel [Boolean] Whether [Dual channel
|
230
234
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
231
235
|
# was enabled in the transcription request, either true or false
|
232
236
|
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
233
|
-
# @param webhook_url [String] The URL to which we send
|
234
|
-
#
|
235
|
-
#
|
237
|
+
# @param webhook_url [String] The URL to which we send webhook requests.
|
238
|
+
# We sends two different types of webhook requests.
|
239
|
+
# One request when a transcript is completed or failed, and one request when the
|
240
|
+
# redacted audio is ready if redact_pii_audio is enabled.
|
241
|
+
# @param webhook_status_code [Integer] The status code we received from your server when delivering the transcript
|
242
|
+
# completed or failed webhook request, if a webhook URL was provided
|
236
243
|
# @param webhook_auth [Boolean] Whether webhook authentication details were provided
|
237
|
-
# @param webhook_auth_header_name [String] The header name
|
244
|
+
# @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
|
245
|
+
# requests
|
238
246
|
# @param speed_boost [Boolean] Whether speed boost is enabled
|
239
247
|
# @param auto_highlights [Boolean] Whether Key Phrases is enabled, either true or false
|
240
248
|
# @param auto_highlights_result [AssemblyAI::Transcripts::AutoHighlightsResult]
|
@@ -618,7 +626,7 @@ module AssemblyAI
|
|
618
626
|
obj.words&.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
|
619
627
|
obj.utterances&.is_a?(Array) != false || raise("Passed value for field obj.utterances is not the expected type, validation failed.")
|
620
628
|
obj.confidence&.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
|
621
|
-
obj.audio_duration&.is_a?(
|
629
|
+
obj.audio_duration&.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
|
622
630
|
obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
|
623
631
|
obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
|
624
632
|
obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
|
@@ -28,12 +28,15 @@ module AssemblyAI
|
|
28
28
|
attr_reader :dual_channel
|
29
29
|
# @return [AssemblyAI::Transcripts::SpeechModel]
|
30
30
|
attr_reader :speech_model
|
31
|
-
# @return [String] The URL to which
|
31
|
+
# @return [String] The URL to which we send webhook requests. We sends two different types of
|
32
|
+
# webhook requests. One request when a transcript is completed or failed, and one
|
33
|
+
# request when the redacted audio is ready if redact_pii_audio is enabled.
|
32
34
|
attr_reader :webhook_url
|
33
|
-
# @return [String] The header name
|
35
|
+
# @return [String] The header name to be sent with the transcript completed or failed webhook
|
36
|
+
# requests
|
34
37
|
attr_reader :webhook_auth_header_name
|
35
|
-
# @return [String]
|
36
|
-
# security
|
38
|
+
# @return [String] The header value to send back with the transcript completed or failed webhook
|
39
|
+
# requests for added security
|
37
40
|
attr_reader :webhook_auth_header_value
|
38
41
|
# @return [Boolean] Enable Key Phrases, either true or false
|
39
42
|
attr_reader :auto_highlights
|
@@ -134,10 +137,13 @@ module AssemblyAI
|
|
134
137
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
135
138
|
# transcription, can be true or false.
|
136
139
|
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
137
|
-
# @param webhook_url [String] The URL to which
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
140
|
+
# @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of
|
141
|
+
# webhook requests. One request when a transcript is completed or failed, and one
|
142
|
+
# request when the redacted audio is ready if redact_pii_audio is enabled.
|
143
|
+
# @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
|
144
|
+
# requests
|
145
|
+
# @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
|
146
|
+
# requests for added security
|
141
147
|
# @param auto_highlights [Boolean] Enable Key Phrases, either true or false
|
142
148
|
# @param audio_start_from [Integer] The point in time, in milliseconds, to begin transcribing in your media file
|
143
149
|
# @param audio_end_at [Integer] The point in time, in milliseconds, to stop transcribing in your media file
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "transcript_ready_notification"
|
5
|
+
require_relative "redacted_audio_response"
|
6
|
+
|
7
|
+
module AssemblyAI
|
8
|
+
class Transcripts
|
9
|
+
# The notifications sent to the webhook URL.
|
10
|
+
class TranscriptWebhookNotification
|
11
|
+
# Deserialize a JSON object to an instance of TranscriptWebhookNotification
|
12
|
+
#
|
13
|
+
# @param json_object [String]
|
14
|
+
# @return [AssemblyAI::Transcripts::TranscriptWebhookNotification]
|
15
|
+
def self.from_json(json_object:)
|
16
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
|
+
begin
|
18
|
+
AssemblyAI::Transcripts::TranscriptReadyNotification.validate_raw(obj: struct)
|
19
|
+
unless json_object.nil?
|
20
|
+
return AssemblyAI::Transcripts::TranscriptReadyNotification.from_json(json_object: json_object)
|
21
|
+
end
|
22
|
+
|
23
|
+
return nil
|
24
|
+
rescue StandardError
|
25
|
+
# noop
|
26
|
+
end
|
27
|
+
begin
|
28
|
+
AssemblyAI::Transcripts::RedactedAudioResponse.validate_raw(obj: struct)
|
29
|
+
unless json_object.nil?
|
30
|
+
return AssemblyAI::Transcripts::RedactedAudioResponse.from_json(json_object: json_object)
|
31
|
+
end
|
32
|
+
|
33
|
+
return nil
|
34
|
+
rescue StandardError
|
35
|
+
# noop
|
36
|
+
end
|
37
|
+
struct
|
38
|
+
end
|
39
|
+
|
40
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
41
|
+
# hash and check each fields type against the current object's property
|
42
|
+
# definitions.
|
43
|
+
#
|
44
|
+
# @param obj [Object]
|
45
|
+
# @return [Void]
|
46
|
+
def self.validate_raw(obj:)
|
47
|
+
begin
|
48
|
+
return AssemblyAI::Transcripts::TranscriptReadyNotification.validate_raw(obj: obj)
|
49
|
+
rescue StandardError
|
50
|
+
# noop
|
51
|
+
end
|
52
|
+
begin
|
53
|
+
return AssemblyAI::Transcripts::RedactedAudioResponse.validate_raw(obj: obj)
|
54
|
+
rescue StandardError
|
55
|
+
# noop
|
56
|
+
end
|
57
|
+
raise("Passed value matched no type within the union, validation failed.")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/lib/gemconfig.rb
CHANGED
data/lib/types_export.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require_relative "assemblyai/files/types/uploaded_file"
|
4
4
|
require_relative "assemblyai/transcripts/types/transcript_ready_notification"
|
5
5
|
require_relative "assemblyai/transcripts/types/redacted_audio_response"
|
6
|
+
require_relative "assemblyai/transcripts/types/redacted_audio_notification"
|
7
|
+
require_relative "assemblyai/transcripts/types/transcript_webhook_notification"
|
6
8
|
require_relative "assemblyai/transcripts/types/redacted_audio_status"
|
7
9
|
require_relative "assemblyai/transcripts/types/subtitle_format"
|
8
10
|
require_relative "assemblyai/transcripts/types/word_search_response"
|
@@ -46,31 +48,35 @@ require_relative "assemblyai/transcripts/types/page_details"
|
|
46
48
|
require_relative "assemblyai/transcripts/types/transcript_list_item"
|
47
49
|
require_relative "assemblyai/transcripts/types/transcript_list"
|
48
50
|
require_relative "assemblyai/transcripts/types/audio_intelligence_model_status"
|
49
|
-
require_relative "assemblyai/realtime/types/
|
51
|
+
require_relative "assemblyai/realtime/types/realtime"
|
50
52
|
require_relative "assemblyai/realtime/types/session_begins"
|
51
53
|
require_relative "assemblyai/realtime/types/partial_transcript"
|
52
54
|
require_relative "assemblyai/realtime/types/final_transcript"
|
53
55
|
require_relative "assemblyai/realtime/types/session_information"
|
54
56
|
require_relative "assemblyai/realtime/types/session_terminated"
|
55
57
|
require_relative "assemblyai/realtime/types/realtime_error"
|
58
|
+
require_relative "assemblyai/realtime/types/receive_message"
|
59
|
+
require_relative "assemblyai/realtime/types/terminate_session"
|
60
|
+
require_relative "assemblyai/realtime/types/force_end_utterance"
|
61
|
+
require_relative "assemblyai/realtime/types/configure_end_utterance_silence_threshold"
|
62
|
+
require_relative "assemblyai/realtime/types/send_message"
|
63
|
+
require_relative "assemblyai/realtime/types/realtime_base_message"
|
56
64
|
require_relative "assemblyai/realtime/types/realtime_message"
|
57
65
|
require_relative "assemblyai/realtime/types/message_type"
|
58
66
|
require_relative "assemblyai/realtime/types/realtime_transcript_type"
|
59
67
|
require_relative "assemblyai/realtime/types/realtime_transcript"
|
60
68
|
require_relative "assemblyai/realtime/types/realtime_base_transcript"
|
61
69
|
require_relative "assemblyai/realtime/types/word"
|
62
|
-
require_relative "assemblyai/realtime/types/force_end_utterance"
|
63
|
-
require_relative "assemblyai/realtime/types/configure_end_utterance_silence_threshold"
|
64
|
-
require_relative "assemblyai/realtime/types/terminate_session"
|
65
70
|
require_relative "assemblyai/realtime/types/audio_encoding"
|
66
71
|
require_relative "assemblyai/realtime/types/realtime_temporary_token_response"
|
67
72
|
require_relative "assemblyai/lemur/types/purge_lemur_request_data_response"
|
68
73
|
require_relative "assemblyai/lemur/types/lemur_base_response"
|
74
|
+
require_relative "assemblyai/lemur/types/lemur_string_response"
|
69
75
|
require_relative "assemblyai/lemur/types/lemur_task_response"
|
70
76
|
require_relative "assemblyai/lemur/types/lemur_summary_response"
|
77
|
+
require_relative "assemblyai/lemur/types/lemur_action_items_response"
|
71
78
|
require_relative "assemblyai/lemur/types/lemur_question_answer_response"
|
72
79
|
require_relative "assemblyai/lemur/types/lemur_question_answer"
|
73
|
-
require_relative "assemblyai/lemur/types/lemur_action_items_response"
|
74
80
|
require_relative "assemblyai/lemur/types/lemur_response"
|
75
81
|
require_relative "assemblyai/lemur/types/lemur_base_params_context"
|
76
82
|
require_relative "assemblyai/lemur/types/lemur_base_params"
|
@@ -78,7 +84,4 @@ require_relative "assemblyai/lemur/types/lemur_question_context"
|
|
78
84
|
require_relative "assemblyai/lemur/types/lemur_question"
|
79
85
|
require_relative "assemblyai/lemur/types/lemur_model"
|
80
86
|
require_relative "assemblyai/lemur/types/lemur_usage"
|
81
|
-
require_relative "assemblyai/streaming/types/streaming"
|
82
|
-
require_relative "assemblyai/streaming/types/receive_message"
|
83
|
-
require_relative "assemblyai/streaming/types/send_message"
|
84
87
|
require_relative "assemblyai/types/error"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assemblyai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/assemblyai/lemur/types/lemur_question_answer_response.rb
|
113
113
|
- lib/assemblyai/lemur/types/lemur_question_context.rb
|
114
114
|
- lib/assemblyai/lemur/types/lemur_response.rb
|
115
|
+
- lib/assemblyai/lemur/types/lemur_string_response.rb
|
115
116
|
- lib/assemblyai/lemur/types/lemur_summary_response.rb
|
116
117
|
- lib/assemblyai/lemur/types/lemur_task_response.rb
|
117
118
|
- lib/assemblyai/lemur/types/lemur_usage.rb
|
@@ -123,6 +124,7 @@ files:
|
|
123
124
|
- lib/assemblyai/realtime/types/force_end_utterance.rb
|
124
125
|
- lib/assemblyai/realtime/types/message_type.rb
|
125
126
|
- lib/assemblyai/realtime/types/partial_transcript.rb
|
127
|
+
- lib/assemblyai/realtime/types/realtime.rb
|
126
128
|
- lib/assemblyai/realtime/types/realtime_base_message.rb
|
127
129
|
- lib/assemblyai/realtime/types/realtime_base_transcript.rb
|
128
130
|
- lib/assemblyai/realtime/types/realtime_error.rb
|
@@ -130,14 +132,13 @@ files:
|
|
130
132
|
- lib/assemblyai/realtime/types/realtime_temporary_token_response.rb
|
131
133
|
- lib/assemblyai/realtime/types/realtime_transcript.rb
|
132
134
|
- lib/assemblyai/realtime/types/realtime_transcript_type.rb
|
135
|
+
- lib/assemblyai/realtime/types/receive_message.rb
|
136
|
+
- lib/assemblyai/realtime/types/send_message.rb
|
133
137
|
- lib/assemblyai/realtime/types/session_begins.rb
|
134
138
|
- lib/assemblyai/realtime/types/session_information.rb
|
135
139
|
- lib/assemblyai/realtime/types/session_terminated.rb
|
136
140
|
- lib/assemblyai/realtime/types/terminate_session.rb
|
137
141
|
- lib/assemblyai/realtime/types/word.rb
|
138
|
-
- lib/assemblyai/streaming/types/receive_message.rb
|
139
|
-
- lib/assemblyai/streaming/types/send_message.rb
|
140
|
-
- lib/assemblyai/streaming/types/streaming.rb
|
141
142
|
- lib/assemblyai/transcripts/client.rb
|
142
143
|
- lib/assemblyai/transcripts/list_by_url_client.rb
|
143
144
|
- lib/assemblyai/transcripts/polling_client.rb
|
@@ -155,6 +156,7 @@ files:
|
|
155
156
|
- lib/assemblyai/transcripts/types/pii_policy.rb
|
156
157
|
- lib/assemblyai/transcripts/types/polling_options.rb
|
157
158
|
- lib/assemblyai/transcripts/types/redact_pii_audio_quality.rb
|
159
|
+
- lib/assemblyai/transcripts/types/redacted_audio_notification.rb
|
158
160
|
- lib/assemblyai/transcripts/types/redacted_audio_response.rb
|
159
161
|
- lib/assemblyai/transcripts/types/redacted_audio_status.rb
|
160
162
|
- lib/assemblyai/transcripts/types/sentences_response.rb
|
@@ -183,6 +185,7 @@ files:
|
|
183
185
|
- lib/assemblyai/transcripts/types/transcript_sentence.rb
|
184
186
|
- lib/assemblyai/transcripts/types/transcript_status.rb
|
185
187
|
- lib/assemblyai/transcripts/types/transcript_utterance.rb
|
188
|
+
- lib/assemblyai/transcripts/types/transcript_webhook_notification.rb
|
186
189
|
- lib/assemblyai/transcripts/types/transcript_word.rb
|
187
190
|
- lib/assemblyai/transcripts/types/word_search_match.rb
|
188
191
|
- lib/assemblyai/transcripts/types/word_search_response.rb
|