assemblyai 1.0.0.pre.beta.7 → 1.0.0.pre.beta.8
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 +256 -150
- data/lib/assemblyai/lemur/types/lemur_action_items_response.rb +28 -14
- data/lib/assemblyai/lemur/types/lemur_base_params.rb +83 -54
- 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 -31
- data/lib/assemblyai/lemur/types/lemur_question_answer.rb +28 -14
- data/lib/assemblyai/lemur/types/lemur_question_answer_response.rb +29 -14
- 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 +72 -41
- 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 +62 -34
- 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 +31 -14
- data/lib/assemblyai/realtime/types/session_information.rb +69 -0
- data/lib/assemblyai/realtime/types/session_terminated.rb +20 -11
- 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/page_details.rb +59 -33
- 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 +62 -35
- 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 -19
- 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 +512 -293
- data/lib/assemblyai/transcripts/types/transcript_custom_spelling.rb +30 -15
- data/lib/assemblyai/transcripts/types/transcript_language_code.rb +3 -2
- data/lib/assemblyai/transcripts/types/transcript_list.rb +33 -17
- data/lib/assemblyai/transcripts/types/transcript_list_item.rb +60 -34
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +334 -191
- data/lib/assemblyai/transcripts/types/transcript_paragraph.rb +61 -33
- data/lib/assemblyai/transcripts/types/transcript_ready_notification.rb +30 -16
- data/lib/assemblyai/transcripts/types/transcript_sentence.rb +61 -33
- data/lib/assemblyai/transcripts/types/transcript_status.rb +2 -1
- data/lib/assemblyai/transcripts/types/transcript_utterance.rb +55 -31
- 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: cedba6b77334fee0b4e76497e5167d00faa461b8dab2fcfdd9a5b9856f520435
|
4
|
+
data.tar.gz: bcde98892738adf28fa44e6d8f1236249b66b66eb8b486b858e8cdf03da2a978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a236f3e4b78caf66246e6b6c70f6288420e65875573829e77a5198b0fa9f566cb517de9cc7b19e6eaa5fc6143df4bff5d794d2176094a35d0df8b3409d4db2c0
|
7
|
+
data.tar.gz: 3c563c6da42cf7d41b70bfbae5f10eb8cd2e637ac878dae7d78bf826c64810001ffe5a158456104b02b6b94fb2b250648ec4796ad94661c5262100331780d3fa
|
@@ -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]
|