assemblyai 1.0.0.pre.beta.6 → 1.0.0.pre.beta.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '05358a3c10dddca139c259ed392c8488a6ba4ed4906e13f8d74e28e3d68cfebb'
4
- data.tar.gz: 982655216a96652f2cf985de884a68a1f881f5378baebd0c99f28cd6ee6bbe67
3
+ metadata.gz: 76ddcd8ef7bd03dab334e872387e6ea6f01d1c93d26ec1a1ffc57a29ec498f1a
4
+ data.tar.gz: 57abade0a92ef0dd0031f27098d9f7bdebfc17f7445776409af4b8627afe11a0
5
5
  SHA512:
6
- metadata.gz: 4b60a195c0ace12498524aa9bee83de6d8913d546797444f8774eac44c9aa92ca9651826d37215cc527f3aa4e17fbeaf09fef09375c82c8be735d62709e6823b
7
- data.tar.gz: f5d04c938bd2ada068afb6d1347578a074aa61a9b1a5dc481abb08d594a92d0a2db6025069d584d4dd9fb9280caf99e61b9eaa4b87e11b63fd5274a24508c270
6
+ metadata.gz: 17410d40ef0225953ff55910ad561334b7ef6a7cda2e9b190103885878c920b573abcffc9fddc904aefccf896e03629640e7884efde32e4df39e549e17847252
7
+ data.tar.gz: 1c4739c4fee6647ac9edffd00a1a84c7bd7b6fa0064e5126097e6194372a967a976acfecee128a5c7a08738f9864044278247574c91ddb5b40b0903197f49cbd
@@ -15,7 +15,7 @@ module AssemblyAI
15
15
  @request_client = request_client
16
16
  end
17
17
 
18
- # Create a temporary authentication token for real-time transcription
18
+ # Create a temporary authentication token for Streaming Speech-to-Text
19
19
  #
20
20
  # @param expires_in [Integer] The amount of time until the token expires in seconds
21
21
  # @param request_options [RequestOptions]
@@ -41,7 +41,7 @@ module AssemblyAI
41
41
  @request_client = request_client
42
42
  end
43
43
 
44
- # Create a temporary authentication token for real-time transcription
44
+ # Create a temporary authentication token for Streaming Speech-to-Text
45
45
  #
46
46
  # @param expires_in [Integer] The amount of time until the token expires in seconds
47
47
  # @param request_options [RequestOptions]
@@ -7,11 +7,11 @@ module AssemblyAI
7
7
  class RealtimeTemporaryTokenResponse
8
8
  attr_reader :token, :additional_properties
9
9
 
10
- # @param token [String] The temporary authentication token for real-time transcription
10
+ # @param token [String] The temporary authentication token for Streaming Speech-to-Text
11
11
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
12
  # @return [Realtime::RealtimeTemporaryTokenResponse]
13
13
  def initialize(token:, additional_properties: nil)
14
- # @type [String] The temporary authentication token for real-time transcription
14
+ # @type [String] The temporary authentication token for Streaming Speech-to-Text
15
15
  @token = token
16
16
  # @type [OpenStruct] Additional properties unmapped to the current class definition
17
17
  @additional_properties = additional_properties
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
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"
4
+ require_relative "../../realtime/types/session_begins"
5
+ require_relative "../../realtime/types/partial_transcript"
6
+ require_relative "../../realtime/types/final_transcript"
7
+ require_relative "../../realtime/types/session_terminated"
8
+ require_relative "../../realtime/types/realtime_error"
9
9
 
10
10
  module AssemblyAI
11
11
  class Realtime
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
- require_relative "terminate_session"
5
- require_relative "force_end_utterance"
6
- require_relative "configure_end_utterance_silence_threshold"
4
+ require_relative "../../realtime/types/terminate_session"
5
+ require_relative "../../realtime/types/force_end_utterance"
6
+ require_relative "../../realtime/types/configure_end_utterance_silence_threshold"
7
7
 
8
8
  module AssemblyAI
9
9
  class Realtime
@@ -7,11 +7,11 @@ module AssemblyAI
7
7
  class TerminateSession
8
8
  attr_reader :terminate_session, :additional_properties
9
9
 
10
- # @param terminate_session [Boolean] Set to true to end your real-time session forever
10
+ # @param terminate_session [Boolean] Set to true to end your streaming session forever
11
11
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
12
  # @return [Realtime::TerminateSession]
13
13
  def initialize(terminate_session:, additional_properties: nil)
14
- # @type [Boolean] Set to true to end your real-time session forever
14
+ # @type [Boolean] Set to true to end your streaming session forever
15
15
  @terminate_session = terminate_session
16
16
  # @type [OpenStruct] Additional properties unmapped to the current class definition
17
17
  @additional_properties = additional_properties
@@ -31,7 +31,8 @@ module AssemblyAI
31
31
  @request_client = request_client
32
32
  end
33
33
 
34
- # Retrieve a list of transcripts you created
34
+ # Retrieve a list of transcripts you created.
35
+ # Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
35
36
  #
36
37
  # @param limit [Integer] Maximum amount of transcripts to retrieve
37
38
  # @param status [Transcripts::TranscriptStatus] Filter by transcript status
@@ -273,7 +274,8 @@ module AssemblyAI
273
274
  @request_client = request_client
274
275
  end
275
276
 
276
- # Retrieve a list of transcripts you created
277
+ # Retrieve a list of transcripts you created.
278
+ # Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
277
279
  #
278
280
  # @param limit [Integer] Maximum amount of transcripts to retrieve
279
281
  # @param status [Transcripts::TranscriptStatus] Filter by transcript status
@@ -4,26 +4,27 @@ require "json"
4
4
 
5
5
  module AssemblyAI
6
6
  class Transcripts
7
+ # Details of the transcript page. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
7
8
  class PageDetails
8
9
  attr_reader :limit, :result_count, :current_url, :prev_url, :next_url, :additional_properties
9
10
 
10
11
  # @param limit [Integer]
11
12
  # @param result_count [Integer]
12
13
  # @param current_url [String]
13
- # @param prev_url [String]
14
- # @param next_url [String]
14
+ # @param prev_url [String] The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
15
+ # @param next_url [String] The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
15
16
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
16
17
  # @return [Transcripts::PageDetails]
17
- def initialize(limit:, result_count:, current_url:, prev_url:, next_url: nil, additional_properties: nil)
18
+ def initialize(limit:, result_count:, current_url:, prev_url: nil, next_url: nil, additional_properties: nil)
18
19
  # @type [Integer]
19
20
  @limit = limit
20
21
  # @type [Integer]
21
22
  @result_count = result_count
22
23
  # @type [String]
23
24
  @current_url = current_url
24
- # @type [String]
25
+ # @type [String] The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
25
26
  @prev_url = prev_url
26
- # @type [String]
27
+ # @type [String] The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
27
28
  @next_url = next_url
28
29
  # @type [OpenStruct] Additional properties unmapped to the current class definition
29
30
  @additional_properties = additional_properties
@@ -66,7 +67,7 @@ module AssemblyAI
66
67
  obj.limit.is_a?(Integer) != false || raise("Passed value for field obj.limit is not the expected type, validation failed.")
67
68
  obj.result_count.is_a?(Integer) != false || raise("Passed value for field obj.result_count is not the expected type, validation failed.")
68
69
  obj.current_url.is_a?(String) != false || raise("Passed value for field obj.current_url is not the expected type, validation failed.")
69
- obj.prev_url.is_a?(String) != false || raise("Passed value for field obj.prev_url is not the expected type, validation failed.")
70
+ obj.prev_url&.is_a?(String) != false || raise("Passed value for field obj.prev_url is not the expected type, validation failed.")
70
71
  obj.next_url&.is_a?(String) != false || raise("Passed value for field obj.next_url is not the expected type, validation failed.")
71
72
  end
72
73
  end
@@ -4,6 +4,7 @@ module AssemblyAI
4
4
  class Transcripts
5
5
  # The speech model to use for the transcription.
6
6
  class SpeechModel
7
+ BEST = "best"
7
8
  NANO = "nano"
8
9
  CONFORMER2 = "conformer-2"
9
10
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  module AssemblyAI
4
4
  class Transcripts
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.
5
+ # The replacement logic for detected PII, can be "entity_name" or "hash". See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
6
6
  class SubstitutionPolicy
7
- ENTITY_TYPE = "entity_type"
7
+ ENTITY_NAME = "entity_name"
8
8
  HASH = "hash"
9
9
  end
10
10
  end
@@ -6,6 +6,7 @@ require "json"
6
6
 
7
7
  module AssemblyAI
8
8
  class Transcripts
9
+ # A list of transcripts. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
9
10
  class TranscriptList
10
11
  attr_reader :page_details, :transcripts, :additional_properties
11
12
 
@@ -7,7 +7,7 @@ require "json"
7
7
  module AssemblyAI
8
8
  class Transcripts
9
9
  class TranscriptListItem
10
- attr_reader :id, :resource_url, :status, :created, :completed, :audio_url, :additional_properties
10
+ attr_reader :id, :resource_url, :status, :created, :completed, :audio_url, :error, :additional_properties
11
11
 
12
12
  # @param id [String]
13
13
  # @param resource_url [String]
@@ -15,9 +15,11 @@ module AssemblyAI
15
15
  # @param created [DateTime]
16
16
  # @param completed [DateTime]
17
17
  # @param audio_url [String]
18
+ # @param error [String] Error message of why the transcript failed
18
19
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
19
20
  # @return [Transcripts::TranscriptListItem]
20
- def initialize(id:, resource_url:, status:, created:, completed:, audio_url:, additional_properties: nil)
21
+ def initialize(id:, resource_url:, status:, created:, completed:, audio_url:, error: nil,
22
+ additional_properties: nil)
21
23
  # @type [String]
22
24
  @id = id
23
25
  # @type [String]
@@ -30,6 +32,8 @@ module AssemblyAI
30
32
  @completed = completed
31
33
  # @type [String]
32
34
  @audio_url = audio_url
35
+ # @type [String] Error message of why the transcript failed
36
+ @error = error
33
37
  # @type [OpenStruct] Additional properties unmapped to the current class definition
34
38
  @additional_properties = additional_properties
35
39
  end
@@ -47,8 +51,9 @@ module AssemblyAI
47
51
  created = (DateTime.parse(parsed_json["created"]) unless parsed_json["created"].nil?)
48
52
  completed = (DateTime.parse(parsed_json["completed"]) unless parsed_json["completed"].nil?)
49
53
  audio_url = struct.audio_url
54
+ error = struct.error
50
55
  new(id: id, resource_url: resource_url, status: status, created: created, completed: completed,
51
- audio_url: audio_url, additional_properties: struct)
56
+ audio_url: audio_url, error: error, additional_properties: struct)
52
57
  end
53
58
 
54
59
  # Serialize an instance of TranscriptListItem to a JSON object
@@ -61,7 +66,8 @@ module AssemblyAI
61
66
  "status": @status,
62
67
  "created": @created,
63
68
  "completed": @completed,
64
- "audio_url": @audio_url
69
+ "audio_url": @audio_url,
70
+ "error": @error
65
71
  }.to_json
66
72
  end
67
73
 
@@ -76,6 +82,7 @@ module AssemblyAI
76
82
  obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
77
83
  obj.completed.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
78
84
  obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
85
+ obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
79
86
  end
80
87
  end
81
88
  end
data/lib/requests.rb CHANGED
@@ -20,7 +20,7 @@ module AssemblyAI
20
20
  @headers = {
21
21
  "X-Fern-Language": "Ruby",
22
22
  "X-Fern-SDK-Name": "assemblyai",
23
- "X-Fern-SDK-Version": "1.0.0-beta.6",
23
+ "X-Fern-SDK-Version": "1.0.0-beta.7",
24
24
  "Authorization": api_key.to_s
25
25
  }
26
26
  @conn = Faraday.new(@base_url, headers: @headers) do |faraday|
@@ -46,7 +46,7 @@ module AssemblyAI
46
46
  @headers = {
47
47
  "X-Fern-Language": "Ruby",
48
48
  "X-Fern-SDK-Name": "assemblyai",
49
- "X-Fern-SDK-Version": "1.0.0-beta.6",
49
+ "X-Fern-SDK-Version": "1.0.0-beta.7",
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,26 +46,26 @@ 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_base_message"
49
50
  require_relative "assemblyai/realtime/types/session_begins"
50
51
  require_relative "assemblyai/realtime/types/partial_transcript"
51
52
  require_relative "assemblyai/realtime/types/final_transcript"
52
53
  require_relative "assemblyai/realtime/types/session_terminated"
53
54
  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"
62
55
  require_relative "assemblyai/realtime/types/realtime_message"
63
56
  require_relative "assemblyai/realtime/types/message_type"
64
57
  require_relative "assemblyai/realtime/types/realtime_transcript_type"
65
58
  require_relative "assemblyai/realtime/types/realtime_transcript"
66
59
  require_relative "assemblyai/realtime/types/realtime_base_transcript"
67
60
  require_relative "assemblyai/realtime/types/word"
61
+ require_relative "assemblyai/realtime/types/audio_data"
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"
68
65
  require_relative "assemblyai/realtime/types/audio_encoding"
66
+ require_relative "assemblyai/realtime/types/realtime_temporary_token_response"
67
+ require_relative "assemblyai/realtime/types/receive_message"
68
+ require_relative "assemblyai/realtime/types/send_message"
69
69
  require_relative "assemblyai/lemur/types/purge_lemur_request_data_response"
70
70
  require_relative "assemblyai/lemur/types/lemur_base_response"
71
71
  require_relative "assemblyai/lemur/types/lemur_summary_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.6
4
+ version: 1.0.0.pre.beta.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-21 00:00:00.000000000 Z
11
+ date: 2024-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday