assemblyai 1.0.0.pre.beta.3 → 1.0.0.pre.beta.5
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 +8 -8
- data/lib/assemblyai/realtime/types/receive_message.rb +87 -0
- data/lib/assemblyai/realtime/types/send_message.rb +74 -0
- data/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +8 -5
- data/lib/assemblyai/transcripts/types/speech_model.rb +1 -0
- data/lib/assemblyai/transcripts/types/topic_detection_model_result.rb +2 -2
- data/lib/requests.rb +4 -4
- data/lib/types_export.rb +8 -6
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d91bff775d7a91af629545e3aebf04fd8af3757c0593c9782eff3bd6e838170
|
4
|
+
data.tar.gz: 27b065dedebaab7a01389e58870f322dd7c7f7eb2e0aafac71077b73eff4833a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a793a096563db2d9f57be102e5076fd6a2b2a8c293cac817c83bf578f32dac03ee7ab1f05246200a9f87eafd8451eb2fb71d86aa2302e26191c6ac8bfe2634
|
7
|
+
data.tar.gz: 591118e0a7fde11c070e19518e338498defda2187bd8e4d1fa0a8205c5baba910e29d64c22462c1fce4c57f969b6b9bb657c1da64f29d1e9eeb8194fb4c3f650
|
@@ -28,7 +28,7 @@ module AssemblyAI
|
|
28
28
|
# Use either transcript_ids or input_text as input into LeMUR.
|
29
29
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
30
30
|
# Use either transcript_ids or input_text as input into LeMUR.
|
31
|
-
# @param context [String, Hash{String =>
|
31
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
32
32
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
33
33
|
# Defaults to "default".
|
34
34
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -66,7 +66,7 @@ module AssemblyAI
|
|
66
66
|
# Use either transcript_ids or input_text as input into LeMUR.
|
67
67
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
68
68
|
# Use either transcript_ids or input_text as input into LeMUR.
|
69
|
-
# @param context [String, Hash{String =>
|
69
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
70
70
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
71
71
|
# Defaults to "default".
|
72
72
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -104,7 +104,7 @@ module AssemblyAI
|
|
104
104
|
# Use either transcript_ids or input_text as input into LeMUR.
|
105
105
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
106
106
|
# Use either transcript_ids or input_text as input into LeMUR.
|
107
|
-
# @param context [String, Hash{String =>
|
107
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
108
108
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
109
109
|
# Defaults to "default".
|
110
110
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -146,7 +146,7 @@ module AssemblyAI
|
|
146
146
|
# Use either transcript_ids or input_text as input into LeMUR.
|
147
147
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
148
148
|
# Use either transcript_ids or input_text as input into LeMUR.
|
149
|
-
# @param context [String, Hash{String =>
|
149
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
150
150
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
151
151
|
# Defaults to "default".
|
152
152
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -211,7 +211,7 @@ module AssemblyAI
|
|
211
211
|
# Use either transcript_ids or input_text as input into LeMUR.
|
212
212
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
213
213
|
# Use either transcript_ids or input_text as input into LeMUR.
|
214
|
-
# @param context [String, Hash{String =>
|
214
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
215
215
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
216
216
|
# Defaults to "default".
|
217
217
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -251,7 +251,7 @@ module AssemblyAI
|
|
251
251
|
# Use either transcript_ids or input_text as input into LeMUR.
|
252
252
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
253
253
|
# Use either transcript_ids or input_text as input into LeMUR.
|
254
|
-
# @param context [String, Hash{String =>
|
254
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
255
255
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
256
256
|
# Defaults to "default".
|
257
257
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -291,7 +291,7 @@ module AssemblyAI
|
|
291
291
|
# Use either transcript_ids or input_text as input into LeMUR.
|
292
292
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
293
293
|
# Use either transcript_ids or input_text as input into LeMUR.
|
294
|
-
# @param context [String, Hash{String =>
|
294
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
295
295
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
296
296
|
# Defaults to "default".
|
297
297
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -335,7 +335,7 @@ module AssemblyAI
|
|
335
335
|
# Use either transcript_ids or input_text as input into LeMUR.
|
336
336
|
# @param input_text [String] Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
337
337
|
# Use either transcript_ids or input_text as input into LeMUR.
|
338
|
-
# @param context [String, Hash{String =>
|
338
|
+
# @param context [String, Hash{String => Object}] Context to provide the model. This can be a string or a free-form JSON value.
|
339
339
|
# @param final_model [Lemur::LemurModel] The model that is used for the final prompt after compression is performed.
|
340
340
|
# Defaults to "default".
|
341
341
|
# @param max_output_size [Integer] Max output size in tokens, up to 4000
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "session_begins"
|
5
|
+
require_relative "partial_transcript"
|
6
|
+
require_relative "final_transcript"
|
7
|
+
require_relative "session_terminated"
|
8
|
+
require_relative "realtime_error"
|
9
|
+
|
10
|
+
module AssemblyAI
|
11
|
+
class Realtime
|
12
|
+
# Receive messages from the WebSocket
|
13
|
+
class ReceiveMessage
|
14
|
+
# Deserialize a JSON object to an instance of ReceiveMessage
|
15
|
+
#
|
16
|
+
# @param json_object [JSON]
|
17
|
+
# @return [Realtime::ReceiveMessage]
|
18
|
+
def self.from_json(json_object:)
|
19
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
20
|
+
begin
|
21
|
+
Realtime::SessionBegins.validate_raw(obj: struct)
|
22
|
+
return Realtime::SessionBegins.from_json(json_object: json_object)
|
23
|
+
rescue StandardError
|
24
|
+
# noop
|
25
|
+
end
|
26
|
+
begin
|
27
|
+
Realtime::PartialTranscript.validate_raw(obj: struct)
|
28
|
+
return Realtime::PartialTranscript.from_json(json_object: json_object)
|
29
|
+
rescue StandardError
|
30
|
+
# noop
|
31
|
+
end
|
32
|
+
begin
|
33
|
+
Realtime::FinalTranscript.validate_raw(obj: struct)
|
34
|
+
return Realtime::FinalTranscript.from_json(json_object: json_object)
|
35
|
+
rescue StandardError
|
36
|
+
# noop
|
37
|
+
end
|
38
|
+
begin
|
39
|
+
Realtime::SessionTerminated.validate_raw(obj: struct)
|
40
|
+
return Realtime::SessionTerminated.from_json(json_object: json_object)
|
41
|
+
rescue StandardError
|
42
|
+
# noop
|
43
|
+
end
|
44
|
+
begin
|
45
|
+
Realtime::RealtimeError.validate_raw(obj: struct)
|
46
|
+
return Realtime::RealtimeError.from_json(json_object: json_object)
|
47
|
+
rescue StandardError
|
48
|
+
# noop
|
49
|
+
end
|
50
|
+
struct
|
51
|
+
end
|
52
|
+
|
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.
|
54
|
+
#
|
55
|
+
# @param obj [Object]
|
56
|
+
# @return [Void]
|
57
|
+
def self.validate_raw(obj:)
|
58
|
+
begin
|
59
|
+
return Realtime::SessionBegins.validate_raw(obj: obj)
|
60
|
+
rescue StandardError
|
61
|
+
# noop
|
62
|
+
end
|
63
|
+
begin
|
64
|
+
return Realtime::PartialTranscript.validate_raw(obj: obj)
|
65
|
+
rescue StandardError
|
66
|
+
# noop
|
67
|
+
end
|
68
|
+
begin
|
69
|
+
return Realtime::FinalTranscript.validate_raw(obj: obj)
|
70
|
+
rescue StandardError
|
71
|
+
# noop
|
72
|
+
end
|
73
|
+
begin
|
74
|
+
return Realtime::SessionTerminated.validate_raw(obj: obj)
|
75
|
+
rescue StandardError
|
76
|
+
# noop
|
77
|
+
end
|
78
|
+
begin
|
79
|
+
return Realtime::RealtimeError.validate_raw(obj: obj)
|
80
|
+
rescue StandardError
|
81
|
+
# noop
|
82
|
+
end
|
83
|
+
raise("Passed value matched no type within the union, validation failed.")
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,74 @@
|
|
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
|
@@ -13,8 +13,8 @@ module AssemblyAI
|
|
13
13
|
|
14
14
|
# @param status [Transcripts::AudioIntelligenceModelStatus] The status of the Content Moderation model. Either success, or unavailable in the rare case that the model failed.
|
15
15
|
# @param results [Array<Transcripts::ContentSafetyLabelResult>]
|
16
|
-
# @param summary [Hash{String =>
|
17
|
-
# @param severity_score_summary [Hash{String =>
|
16
|
+
# @param summary [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file
|
17
|
+
# @param severity_score_summary [Hash{String => Transcripts::SeverityScoreSummary}] A summary of the Content Moderation severity results for the entire audio file
|
18
18
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
19
19
|
# @return [Transcripts::ContentSafetyLabelsResult]
|
20
20
|
def initialize(status:, results:, summary:, severity_score_summary:, additional_properties: nil)
|
@@ -22,9 +22,9 @@ module AssemblyAI
|
|
22
22
|
@status = status
|
23
23
|
# @type [Array<Transcripts::ContentSafetyLabelResult>]
|
24
24
|
@results = results
|
25
|
-
# @type [Hash{String =>
|
25
|
+
# @type [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file
|
26
26
|
@summary = summary
|
27
|
-
# @type [Hash{String =>
|
27
|
+
# @type [Hash{String => Transcripts::SeverityScoreSummary}] A summary of the Content Moderation severity results for the entire audio file
|
28
28
|
@severity_score_summary = severity_score_summary
|
29
29
|
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
@additional_properties = additional_properties
|
@@ -43,7 +43,10 @@ module AssemblyAI
|
|
43
43
|
Transcripts::ContentSafetyLabelResult.from_json(json_object: v)
|
44
44
|
end
|
45
45
|
summary = struct.summary
|
46
|
-
severity_score_summary =
|
46
|
+
severity_score_summary = parsed_json["severity_score_summary"]&.transform_values do |_k, v|
|
47
|
+
v = v.to_json
|
48
|
+
Transcripts::SeverityScoreSummary.from_json(json_object: v)
|
49
|
+
end
|
47
50
|
new(status: status, results: results, summary: summary, severity_score_summary: severity_score_summary,
|
48
51
|
additional_properties: struct)
|
49
52
|
end
|
@@ -13,7 +13,7 @@ module AssemblyAI
|
|
13
13
|
|
14
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
|
-
# @param summary [Hash{String =>
|
16
|
+
# @param summary [Hash{String => Float}] 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)
|
@@ -21,7 +21,7 @@ module AssemblyAI
|
|
21
21
|
@status = status
|
22
22
|
# @type [Array<Transcripts::TopicDetectionResult>] An array of results for the Topic Detection model
|
23
23
|
@results = results
|
24
|
-
# @type [Hash{String =>
|
24
|
+
# @type [Hash{String => Float}] The overall relevance of topic to the entire audio file
|
25
25
|
@summary = summary
|
26
26
|
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
27
27
|
@additional_properties = additional_properties
|
data/lib/requests.rb
CHANGED
@@ -19,8 +19,8 @@ module AssemblyAI
|
|
19
19
|
@base_url = environment
|
20
20
|
@headers = {
|
21
21
|
"X-Fern-Language": "Ruby",
|
22
|
-
"X-Fern-SDK-Name": "
|
23
|
-
"X-Fern-SDK-Version": "1.0.0-beta.
|
22
|
+
"X-Fern-SDK-Name": "assemblyai",
|
23
|
+
"X-Fern-SDK-Version": "1.0.0-beta.5",
|
24
24
|
"Authorization": api_key.to_s
|
25
25
|
}
|
26
26
|
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
|
@@ -45,8 +45,8 @@ module AssemblyAI
|
|
45
45
|
@base_url = environment
|
46
46
|
@headers = {
|
47
47
|
"X-Fern-Language": "Ruby",
|
48
|
-
"X-Fern-SDK-Name": "
|
49
|
-
"X-Fern-SDK-Version": "1.0.0-beta.
|
48
|
+
"X-Fern-SDK-Name": "assemblyai",
|
49
|
+
"X-Fern-SDK-Version": "1.0.0-beta.5",
|
50
50
|
"Authorization": api_key.to_s
|
51
51
|
}
|
52
52
|
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
|
data/lib/types_export.rb
CHANGED
@@ -46,23 +46,25 @@ require_relative "assemblyai/transcripts/types/page_details"
|
|
46
46
|
require_relative "assemblyai/transcripts/types/transcript_list_item"
|
47
47
|
require_relative "assemblyai/transcripts/types/transcript_list"
|
48
48
|
require_relative "assemblyai/transcripts/types/audio_intelligence_model_status"
|
49
|
-
require_relative "assemblyai/realtime/types/realtime_temporary_token_response"
|
50
|
-
require_relative "assemblyai/realtime/types/realtime_base_message"
|
51
49
|
require_relative "assemblyai/realtime/types/session_begins"
|
52
50
|
require_relative "assemblyai/realtime/types/partial_transcript"
|
53
51
|
require_relative "assemblyai/realtime/types/final_transcript"
|
54
52
|
require_relative "assemblyai/realtime/types/session_terminated"
|
55
53
|
require_relative "assemblyai/realtime/types/realtime_error"
|
54
|
+
require_relative "assemblyai/realtime/types/receive_message"
|
55
|
+
require_relative "assemblyai/realtime/types/audio_data"
|
56
|
+
require_relative "assemblyai/realtime/types/terminate_session"
|
57
|
+
require_relative "assemblyai/realtime/types/force_end_utterance"
|
58
|
+
require_relative "assemblyai/realtime/types/configure_end_utterance_silence_threshold"
|
59
|
+
require_relative "assemblyai/realtime/types/send_message"
|
60
|
+
require_relative "assemblyai/realtime/types/realtime_temporary_token_response"
|
61
|
+
require_relative "assemblyai/realtime/types/realtime_base_message"
|
56
62
|
require_relative "assemblyai/realtime/types/realtime_message"
|
57
63
|
require_relative "assemblyai/realtime/types/message_type"
|
58
64
|
require_relative "assemblyai/realtime/types/realtime_transcript_type"
|
59
65
|
require_relative "assemblyai/realtime/types/realtime_transcript"
|
60
66
|
require_relative "assemblyai/realtime/types/realtime_base_transcript"
|
61
67
|
require_relative "assemblyai/realtime/types/word"
|
62
|
-
require_relative "assemblyai/realtime/types/audio_data"
|
63
|
-
require_relative "assemblyai/realtime/types/force_end_utterance"
|
64
|
-
require_relative "assemblyai/realtime/types/configure_end_utterance_silence_threshold"
|
65
|
-
require_relative "assemblyai/realtime/types/terminate_session"
|
66
68
|
require_relative "assemblyai/realtime/types/audio_encoding"
|
67
69
|
require_relative "assemblyai/lemur/types/purge_lemur_request_data_response"
|
68
70
|
require_relative "assemblyai/lemur/types/lemur_base_response"
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -127,6 +127,8 @@ files:
|
|
127
127
|
- lib/assemblyai/realtime/types/realtime_temporary_token_response.rb
|
128
128
|
- lib/assemblyai/realtime/types/realtime_transcript.rb
|
129
129
|
- lib/assemblyai/realtime/types/realtime_transcript_type.rb
|
130
|
+
- lib/assemblyai/realtime/types/receive_message.rb
|
131
|
+
- lib/assemblyai/realtime/types/send_message.rb
|
130
132
|
- lib/assemblyai/realtime/types/session_begins.rb
|
131
133
|
- lib/assemblyai/realtime/types/session_terminated.rb
|
132
134
|
- lib/assemblyai/realtime/types/terminate_session.rb
|