assemblyai 1.0.0.pre.beta.7 → 1.0.0.pre.beta.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assemblyai/files/client.rb +4 -2
- data/lib/assemblyai/files/types/uploaded_file.rb +20 -11
- data/lib/assemblyai/lemur/client.rb +260 -150
- data/lib/assemblyai/lemur/types/lemur_action_items_response.rb +28 -14
- data/lib/assemblyai/lemur/types/lemur_base_params.rb +83 -55
- data/lib/assemblyai/lemur/types/lemur_base_params_context.rb +11 -5
- data/lib/assemblyai/lemur/types/lemur_base_response.rb +20 -11
- data/lib/assemblyai/lemur/types/lemur_question.rb +57 -32
- data/lib/assemblyai/lemur/types/lemur_question_answer.rb +28 -14
- data/lib/assemblyai/lemur/types/lemur_question_answer_response.rb +29 -15
- data/lib/assemblyai/lemur/types/lemur_question_context.rb +13 -6
- data/lib/assemblyai/lemur/types/lemur_summary_response.rb +28 -14
- data/lib/assemblyai/lemur/types/lemur_task_response.rb +28 -14
- data/lib/assemblyai/lemur/types/purge_lemur_request_data_response.rb +32 -17
- data/lib/assemblyai/realtime/client.rb +30 -14
- data/lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb +24 -13
- data/lib/assemblyai/realtime/types/final_transcript.rb +73 -42
- data/lib/assemblyai/realtime/types/force_end_utterance.rb +20 -11
- data/lib/assemblyai/realtime/types/message_type.rb +1 -0
- data/lib/assemblyai/realtime/types/partial_transcript.rb +63 -35
- data/lib/assemblyai/realtime/types/realtime_base_message.rb +22 -13
- data/lib/assemblyai/realtime/types/realtime_base_transcript.rb +57 -31
- data/lib/assemblyai/realtime/types/realtime_error.rb +20 -11
- data/lib/assemblyai/realtime/types/realtime_message.rb +44 -18
- data/lib/assemblyai/realtime/types/realtime_temporary_token_response.rb +20 -11
- data/lib/assemblyai/realtime/types/realtime_transcript.rb +15 -9
- data/lib/assemblyai/realtime/types/session_begins.rb +32 -15
- data/lib/assemblyai/realtime/types/session_information.rb +69 -0
- data/lib/assemblyai/realtime/types/session_terminated.rb +21 -12
- data/lib/assemblyai/realtime/types/terminate_session.rb +20 -11
- data/lib/assemblyai/realtime/types/word.rb +36 -18
- data/lib/assemblyai/streaming/types/receive_message.rb +113 -0
- data/lib/assemblyai/{realtime → streaming}/types/send_message.rb +26 -14
- data/lib/assemblyai/streaming/types/streaming.rb +11 -0
- data/lib/assemblyai/transcripts/client.rb +50 -18
- data/lib/assemblyai/transcripts/list_by_url_client.rb +6 -4
- data/lib/assemblyai/transcripts/polling_client.rb +12 -2
- data/lib/assemblyai/transcripts/types/auto_highlight_result.rb +40 -19
- data/lib/assemblyai/transcripts/types/auto_highlights_result.rb +38 -14
- data/lib/assemblyai/transcripts/types/chapter.rb +40 -20
- data/lib/assemblyai/transcripts/types/content_safety_label.rb +32 -16
- data/lib/assemblyai/transcripts/types/content_safety_label_result.rb +51 -29
- data/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +51 -29
- data/lib/assemblyai/transcripts/types/entity.rb +41 -21
- data/lib/assemblyai/transcripts/types/entity_type.rb +15 -0
- data/lib/assemblyai/transcripts/types/page_details.rb +62 -36
- data/lib/assemblyai/transcripts/types/paragraphs_response.rb +37 -19
- data/lib/assemblyai/transcripts/types/redact_pii_audio_quality.rb +4 -1
- data/lib/assemblyai/transcripts/types/redacted_audio_response.rb +29 -15
- data/lib/assemblyai/transcripts/types/sentences_response.rb +37 -19
- data/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb +63 -36
- data/lib/assemblyai/transcripts/types/severity_score_summary.rb +32 -16
- data/lib/assemblyai/transcripts/types/speech_model.rb +1 -0
- data/lib/assemblyai/transcripts/types/substitution_policy.rb +3 -1
- data/lib/assemblyai/transcripts/types/timestamp.rb +28 -14
- data/lib/assemblyai/transcripts/types/topic_detection_model_result.rb +39 -20
- data/lib/assemblyai/transcripts/types/topic_detection_result.rb +40 -21
- data/lib/assemblyai/transcripts/types/topic_detection_result_labels_item.rb +31 -15
- data/lib/assemblyai/transcripts/types/transcript.rb +513 -295
- data/lib/assemblyai/transcripts/types/transcript_custom_spelling.rb +30 -15
- data/lib/assemblyai/transcripts/types/transcript_language_code.rb +87 -4
- data/lib/assemblyai/transcripts/types/transcript_list.rb +33 -17
- data/lib/assemblyai/transcripts/types/transcript_list_item.rb +60 -35
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +338 -196
- data/lib/assemblyai/transcripts/types/transcript_paragraph.rb +61 -34
- data/lib/assemblyai/transcripts/types/transcript_ready_notification.rb +30 -16
- data/lib/assemblyai/transcripts/types/transcript_sentence.rb +61 -34
- data/lib/assemblyai/transcripts/types/transcript_status.rb +2 -1
- data/lib/assemblyai/transcripts/types/transcript_utterance.rb +55 -32
- data/lib/assemblyai/transcripts/types/transcript_word.rb +55 -24
- data/lib/assemblyai/transcripts/types/word_search_match.rb +40 -20
- data/lib/assemblyai/transcripts/types/word_search_response.rb +36 -17
- data/lib/assemblyai/types/error.rb +32 -16
- data/lib/requests.rb +80 -34
- data/lib/types_export.rb +4 -3
- metadata +6 -5
- data/lib/assemblyai/realtime/types/audio_data.rb +0 -7
- data/lib/assemblyai/realtime/types/receive_message.rb +0 -87
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8966cf8fd4bf25ddc706a276125abd055e0d959ab9a9e08a244cf62e673f5117
|
4
|
+
data.tar.gz: 49482eed13d7dbdd01846510dcfad1e9c22a910a79bf96f50c01932bb858a821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01705c2608ea28815a847e01bffb4f7224e050e6b61dd3692b1f44d16eeabf2e6561e93356331709b32a2702c3c1c3a75864a1659a75d48a354739d832f0853f
|
7
|
+
data.tar.gz: 2789963c8e6e1f1b39013d0c398eaad39b8bd05dd13af4b80389bddf1337101465804360e6585ca29ab44ded1a9580bed610e3fcc8405537414a2557b12bf819
|
@@ -21,7 +21,7 @@ module AssemblyAI
|
|
21
21
|
# @param request_options [RequestOptions]
|
22
22
|
# @return [Files::UploadedFile]
|
23
23
|
def upload(file:, request_options: nil)
|
24
|
-
response = @request_client.conn.post
|
24
|
+
response = @request_client.conn.post do |req|
|
25
25
|
if file.is_a? String
|
26
26
|
begin
|
27
27
|
path = Pathname.new(file)
|
@@ -50,6 +50,7 @@ module AssemblyAI
|
|
50
50
|
req.headers["Transfer-Encoding"] = "chunked"
|
51
51
|
end
|
52
52
|
req.body = file_data
|
53
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/v2/upload"
|
53
54
|
end
|
54
55
|
Files::UploadedFile.from_json(json_object: response.body)
|
55
56
|
end
|
@@ -72,7 +73,7 @@ module AssemblyAI
|
|
72
73
|
# @return [Files::UploadedFile]
|
73
74
|
def upload(file:, request_options: nil)
|
74
75
|
Async do
|
75
|
-
response = @request_client.conn.post
|
76
|
+
response = @request_client.conn.post do |req|
|
76
77
|
if file.is_a? String
|
77
78
|
begin
|
78
79
|
path = Pathname.new(file)
|
@@ -101,6 +102,7 @@ module AssemblyAI
|
|
101
102
|
req.headers["Transfer-Encoding"] = "chunked"
|
102
103
|
end
|
103
104
|
req.body = file_data
|
105
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/v2/upload"
|
104
106
|
end
|
105
107
|
Files::UploadedFile.from_json(json_object: response.body)
|
106
108
|
end
|
@@ -1,41 +1,50 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "ostruct"
|
3
4
|
require "json"
|
4
5
|
|
5
6
|
module AssemblyAI
|
6
7
|
class Files
|
7
8
|
class UploadedFile
|
8
|
-
|
9
|
+
# @return [String] A URL that points to your audio file, accessible only by AssemblyAI's servers
|
10
|
+
attr_reader :upload_url
|
11
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
+
attr_reader :additional_properties
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :_field_set
|
15
|
+
protected :_field_set
|
16
|
+
|
17
|
+
OMIT = Object.new
|
9
18
|
|
10
19
|
# @param upload_url [String] A URL that points to your audio file, accessible only by AssemblyAI's servers
|
11
20
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
-
# @return [Files::UploadedFile]
|
21
|
+
# @return [AssemblyAI::Files::UploadedFile]
|
13
22
|
def initialize(upload_url:, additional_properties: nil)
|
14
|
-
# @type [String] A URL that points to your audio file, accessible only by AssemblyAI's servers
|
15
23
|
@upload_url = upload_url
|
16
|
-
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
17
24
|
@additional_properties = additional_properties
|
25
|
+
@_field_set = { "upload_url": upload_url }
|
18
26
|
end
|
19
27
|
|
20
28
|
# Deserialize a JSON object to an instance of UploadedFile
|
21
29
|
#
|
22
|
-
# @param json_object [
|
23
|
-
# @return [Files::UploadedFile]
|
30
|
+
# @param json_object [String]
|
31
|
+
# @return [AssemblyAI::Files::UploadedFile]
|
24
32
|
def self.from_json(json_object:)
|
25
33
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
26
|
-
|
27
|
-
upload_url = struct.upload_url
|
34
|
+
upload_url = struct["upload_url"]
|
28
35
|
new(upload_url: upload_url, additional_properties: struct)
|
29
36
|
end
|
30
37
|
|
31
38
|
# Serialize an instance of UploadedFile to a JSON object
|
32
39
|
#
|
33
|
-
# @return [
|
40
|
+
# @return [String]
|
34
41
|
def to_json(*_args)
|
35
|
-
|
42
|
+
@_field_set&.to_json
|
36
43
|
end
|
37
44
|
|
38
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
45
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
46
|
+
# hash and check each fields type against the current object's property
|
47
|
+
# definitions.
|
39
48
|
#
|
40
49
|
# @param obj [Object]
|
41
50
|
# @return [Void]
|