assemblyai 1.0.0.pre.beta.9 → 1.0.0.pre.beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8966cf8fd4bf25ddc706a276125abd055e0d959ab9a9e08a244cf62e673f5117
4
- data.tar.gz: 49482eed13d7dbdd01846510dcfad1e9c22a910a79bf96f50c01932bb858a821
3
+ metadata.gz: 267dae8c6c4c9cd73c6b547bb0aaf560f283a7f483437f5edddbfc8fc091edde
4
+ data.tar.gz: 6a8b1f420988acbce05a04d78e5114241a6fc5abef6c6ed0b3549979c868b9ec
5
5
  SHA512:
6
- metadata.gz: 01705c2608ea28815a847e01bffb4f7224e050e6b61dd3692b1f44d16eeabf2e6561e93356331709b32a2702c3c1c3a75864a1659a75d48a354739d832f0853f
7
- data.tar.gz: 2789963c8e6e1f1b39013d0c398eaad39b8bd05dd13af4b80389bddf1337101465804360e6585ca29ab44ded1a9580bed610e3fcc8405537414a2557b12bf819
6
+ metadata.gz: b25c9bc1531c0c97c5bef27c5067575afb3722d6aa826024e5e3d2b9cae03f24902a1787977436a3cd19cb9f1edcea51de42c656eb939b817b8e4aacb63c364e
7
+ data.tar.gz: edef4f4676465a37222e4c559b2179cfecd3a479c0181b3b947539fd1aef5e04d457b5ff7fd92fefb20d34ba57874ff34db87b9ca416c1faf0222501a5f56b16
@@ -44,11 +44,11 @@ module AssemblyAI
44
44
  # @return [AssemblyAI::Lemur::LemurTaskResponse]
45
45
  # @example
46
46
  # api = AssemblyAI::Client.new(
47
- # environment: Environment::DEFAULT,
47
+ # environment: AssemblyAI::Environment::DEFAULT,
48
48
  # base_url: "https://api.example.com",
49
49
  # api_key: "YOUR_API_KEY"
50
50
  # )
51
- # api.task(prompt: "List all the locations affected by wildfires.")
51
+ # api.lemur.task(prompt: "List all the locations affected by wildfires.")
52
52
  def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
53
53
  temperature: nil, request_options: nil)
54
54
  response = @request_client.conn.post do |req|
@@ -95,11 +95,11 @@ module AssemblyAI
95
95
  # @return [AssemblyAI::Lemur::LemurSummaryResponse]
96
96
  # @example
97
97
  # api = AssemblyAI::Client.new(
98
- # environment: Environment::DEFAULT,
98
+ # environment: AssemblyAI::Environment::DEFAULT,
99
99
  # base_url: "https://api.example.com",
100
100
  # api_key: "YOUR_API_KEY"
101
101
  # )
102
- # api.summary
102
+ # api.lemur.summary
103
103
  def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
104
104
  temperature: nil, answer_format: nil, request_options: nil)
105
105
  response = @request_client.conn.post do |req|
@@ -150,11 +150,11 @@ module AssemblyAI
150
150
  # @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
151
151
  # @example
152
152
  # api = AssemblyAI::Client.new(
153
- # environment: Environment::DEFAULT,
153
+ # environment: AssemblyAI::Environment::DEFAULT,
154
154
  # base_url: "https://api.example.com",
155
155
  # api_key: "YOUR_API_KEY"
156
156
  # )
157
- # api.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
157
+ # api.lemur.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
158
158
  def question_answer(questions:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
159
159
  temperature: nil, request_options: nil)
160
160
  response = @request_client.conn.post do |req|
@@ -198,11 +198,11 @@ module AssemblyAI
198
198
  # @return [AssemblyAI::Lemur::LemurActionItemsResponse]
199
199
  # @example
200
200
  # api = AssemblyAI::Client.new(
201
- # environment: Environment::DEFAULT,
201
+ # environment: AssemblyAI::Environment::DEFAULT,
202
202
  # base_url: "https://api.example.com",
203
203
  # api_key: "YOUR_API_KEY"
204
204
  # )
205
- # api.action_items(answer_format: "Bullet Points")
205
+ # api.lemur.action_items(answer_format: "Bullet Points")
206
206
  def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
207
207
  temperature: nil, answer_format: nil, request_options: nil)
208
208
  response = @request_client.conn.post do |req|
@@ -234,11 +234,11 @@ module AssemblyAI
234
234
  # @return [AssemblyAI::Lemur::PurgeLemurRequestDataResponse]
235
235
  # @example
236
236
  # api = AssemblyAI::Client.new(
237
- # environment: Environment::DEFAULT,
237
+ # environment: AssemblyAI::Environment::DEFAULT,
238
238
  # base_url: "https://api.example.com",
239
239
  # api_key: "YOUR_API_KEY"
240
240
  # )
241
- # api.purge_request_data(request_id: "request_id")
241
+ # api.lemur.purge_request_data(request_id: "request_id")
242
242
  def purge_request_data(request_id:, request_options: nil)
243
243
  response = @request_client.conn.delete do |req|
244
244
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -282,11 +282,11 @@ module AssemblyAI
282
282
  # @return [AssemblyAI::Lemur::LemurTaskResponse]
283
283
  # @example
284
284
  # api = AssemblyAI::Client.new(
285
- # environment: Environment::DEFAULT,
285
+ # environment: AssemblyAI::Environment::DEFAULT,
286
286
  # base_url: "https://api.example.com",
287
287
  # api_key: "YOUR_API_KEY"
288
288
  # )
289
- # api.task(prompt: "List all the locations affected by wildfires.")
289
+ # api.lemur.task(prompt: "List all the locations affected by wildfires.")
290
290
  def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
291
291
  temperature: nil, request_options: nil)
292
292
  Async do
@@ -335,11 +335,11 @@ module AssemblyAI
335
335
  # @return [AssemblyAI::Lemur::LemurSummaryResponse]
336
336
  # @example
337
337
  # api = AssemblyAI::Client.new(
338
- # environment: Environment::DEFAULT,
338
+ # environment: AssemblyAI::Environment::DEFAULT,
339
339
  # base_url: "https://api.example.com",
340
340
  # api_key: "YOUR_API_KEY"
341
341
  # )
342
- # api.summary
342
+ # api.lemur.summary
343
343
  def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
344
344
  temperature: nil, answer_format: nil, request_options: nil)
345
345
  Async do
@@ -392,11 +392,11 @@ module AssemblyAI
392
392
  # @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
393
393
  # @example
394
394
  # api = AssemblyAI::Client.new(
395
- # environment: Environment::DEFAULT,
395
+ # environment: AssemblyAI::Environment::DEFAULT,
396
396
  # base_url: "https://api.example.com",
397
397
  # api_key: "YOUR_API_KEY"
398
398
  # )
399
- # api.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
399
+ # api.lemur.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
400
400
  def question_answer(questions:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
401
401
  temperature: nil, request_options: nil)
402
402
  Async do
@@ -442,11 +442,11 @@ module AssemblyAI
442
442
  # @return [AssemblyAI::Lemur::LemurActionItemsResponse]
443
443
  # @example
444
444
  # api = AssemblyAI::Client.new(
445
- # environment: Environment::DEFAULT,
445
+ # environment: AssemblyAI::Environment::DEFAULT,
446
446
  # base_url: "https://api.example.com",
447
447
  # api_key: "YOUR_API_KEY"
448
448
  # )
449
- # api.action_items(answer_format: "Bullet Points")
449
+ # api.lemur.action_items(answer_format: "Bullet Points")
450
450
  def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
451
451
  temperature: nil, answer_format: nil, request_options: nil)
452
452
  Async do
@@ -480,11 +480,11 @@ module AssemblyAI
480
480
  # @return [AssemblyAI::Lemur::PurgeLemurRequestDataResponse]
481
481
  # @example
482
482
  # api = AssemblyAI::Client.new(
483
- # environment: Environment::DEFAULT,
483
+ # environment: AssemblyAI::Environment::DEFAULT,
484
484
  # base_url: "https://api.example.com",
485
485
  # api_key: "YOUR_API_KEY"
486
486
  # )
487
- # api.purge_request_data(request_id: "request_id")
487
+ # api.lemur.purge_request_data(request_id: "request_id")
488
488
  def purge_request_data(request_id:, request_options: nil)
489
489
  Async do
490
490
  response = @request_client.conn.delete do |req|
@@ -79,6 +79,7 @@ module AssemblyAI
79
79
  # @return [AssemblyAI::Lemur::LemurBaseParams]
80
80
  def self.from_json(json_object:)
81
81
  struct = JSON.parse(json_object, object_class: OpenStruct)
82
+ parsed_json = JSON.parse(json_object)
82
83
  transcript_ids = struct["transcript_ids"]
83
84
  input_text = struct["input_text"]
84
85
  if parsed_json["context"].nil?
@@ -57,6 +57,7 @@ module AssemblyAI
57
57
  # @return [AssemblyAI::Lemur::LemurQuestion]
58
58
  def self.from_json(json_object:)
59
59
  struct = JSON.parse(json_object, object_class: OpenStruct)
60
+ parsed_json = JSON.parse(json_object)
60
61
  question = struct["question"]
61
62
  if parsed_json["context"].nil?
62
63
  context = nil
@@ -36,6 +36,7 @@ module AssemblyAI
36
36
  # @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
37
37
  def self.from_json(json_object:)
38
38
  struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
39
40
  response = parsed_json["response"]&.map do |v|
40
41
  v = v.to_json
41
42
  AssemblyAI::Lemur::LemurQuestionAnswer.from_json(json_object: v)
@@ -22,11 +22,11 @@ module AssemblyAI
22
22
  # @return [AssemblyAI::Realtime::RealtimeTemporaryTokenResponse]
23
23
  # @example
24
24
  # api = AssemblyAI::Client.new(
25
- # environment: Environment::DEFAULT,
25
+ # environment: AssemblyAI::Environment::DEFAULT,
26
26
  # base_url: "https://api.example.com",
27
27
  # api_key: "YOUR_API_KEY"
28
28
  # )
29
- # api.create_temporary_token(expires_in: 480)
29
+ # api.realtime.create_temporary_token(expires_in: 480)
30
30
  def create_temporary_token(expires_in:, request_options: nil)
31
31
  response = @request_client.conn.post do |req|
32
32
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -56,11 +56,11 @@ module AssemblyAI
56
56
  # @return [AssemblyAI::Realtime::RealtimeTemporaryTokenResponse]
57
57
  # @example
58
58
  # api = AssemblyAI::Client.new(
59
- # environment: Environment::DEFAULT,
59
+ # environment: AssemblyAI::Environment::DEFAULT,
60
60
  # base_url: "https://api.example.com",
61
61
  # api_key: "YOUR_API_KEY"
62
62
  # )
63
- # api.create_temporary_token(expires_in: 480)
63
+ # api.realtime.create_temporary_token(expires_in: 480)
64
64
  def create_temporary_token(expires_in:, request_options: nil)
65
65
  Async do
66
66
  response = @request_client.conn.post do |req|
@@ -2,34 +2,52 @@
2
2
 
3
3
  module AssemblyAI
4
4
  class Transcripts
5
+ # The type of PII to redact
5
6
  class PiiPolicy
6
- MEDICAL_PROCESS = "medical_process"
7
- MEDICAL_CONDITION = "medical_condition"
7
+ ACCOUNT_NUMBER = "account_number"
8
+ BANKING_INFORMATION = "banking_information"
8
9
  BLOOD_TYPE = "blood_type"
9
- DRUG = "drug"
10
- INJURY = "injury"
11
- NUMBER_SEQUENCE = "number_sequence"
12
- EMAIL_ADDRESS = "email_address"
13
- DATE_OF_BIRTH = "date_of_birth"
14
- PHONE_NUMBER = "phone_number"
15
- US_SOCIAL_SECURITY_NUMBER = "us_social_security_number"
16
- CREDIT_CARD_NUMBER = "credit_card_number"
17
- CREDIT_CARD_EXPIRATION = "credit_card_expiration"
18
10
  CREDIT_CARD_CVV = "credit_card_cvv"
11
+ CREDIT_CARD_EXPIRATION = "credit_card_expiration"
12
+ CREDIT_CARD_NUMBER = "credit_card_number"
19
13
  DATE = "date"
20
- NATIONALITY = "nationality"
14
+ DATE_INTERVAL = "date_interval"
15
+ DATE_OF_BIRTH = "date_of_birth"
16
+ DRIVERS_LICENSE = "drivers_license"
17
+ DRUG = "drug"
18
+ DURATION = "duration"
19
+ EMAIL_ADDRESS = "email_address"
21
20
  EVENT = "event"
21
+ FILENAME = "filename"
22
+ GENDER_SEXUALITY = "gender_sexuality"
23
+ HEALTHCARE_NUMBER = "healthcare_number"
24
+ INJURY = "injury"
25
+ IP_ADDRESS = "ip_address"
22
26
  LANGUAGE = "language"
23
27
  LOCATION = "location"
28
+ MARITAL_STATUS = "marital_status"
29
+ MEDICAL_CONDITION = "medical_condition"
30
+ MEDICAL_PROCESS = "medical_process"
24
31
  MONEY_AMOUNT = "money_amount"
25
- PERSON_NAME = "person_name"
26
- PERSON_AGE = "person_age"
32
+ NATIONALITY = "nationality"
33
+ NUMBER_SEQUENCE = "number_sequence"
34
+ OCCUPATION = "occupation"
27
35
  ORGANIZATION = "organization"
36
+ PASSPORT_NUMBER = "passport_number"
37
+ PASSWORD = "password"
38
+ PERSON_AGE = "person_age"
39
+ PERSON_NAME = "person_name"
40
+ PHONE_NUMBER = "phone_number"
41
+ PHYSICAL_ATTRIBUTE = "physical_attribute"
28
42
  POLITICAL_AFFILIATION = "political_affiliation"
29
- OCCUPATION = "occupation"
30
43
  RELIGION = "religion"
31
- DRIVERS_LICENSE = "drivers_license"
32
- BANKING_INFORMATION = "banking_information"
44
+ STATISTICS = "statistics"
45
+ TIME = "time"
46
+ URL = "url"
47
+ US_SOCIAL_SECURITY_NUMBER = "us_social_security_number"
48
+ USERNAME = "username"
49
+ VEHICLE_ID = "vehicle_id"
50
+ ZODIAC_SIGN = "zodiac_sign"
33
51
  end
34
52
  end
35
53
  end
@@ -46,6 +46,7 @@ module AssemblyAI
46
46
  # @return [AssemblyAI::Transcripts::TopicDetectionModelResult]
47
47
  def self.from_json(json_object:)
48
48
  struct = JSON.parse(json_object, object_class: OpenStruct)
49
+ parsed_json = JSON.parse(json_object)
49
50
  status = struct["status"]
50
51
  results = parsed_json["results"]&.map do |v|
51
52
  v = v.to_json
@@ -443,6 +443,7 @@ module AssemblyAI
443
443
  # @return [AssemblyAI::Transcripts::Transcript]
444
444
  def self.from_json(json_object:)
445
445
  struct = JSON.parse(json_object, object_class: OpenStruct)
446
+ parsed_json = JSON.parse(json_object)
446
447
  id = struct["id"]
447
448
  language_model = struct["language_model"]
448
449
  acoustic_model = struct["acoustic_model"]
@@ -68,6 +68,7 @@ module AssemblyAI
68
68
  # @return [AssemblyAI::Transcripts::TranscriptListItem]
69
69
  def self.from_json(json_object:)
70
70
  struct = JSON.parse(json_object, object_class: OpenStruct)
71
+ parsed_json = JSON.parse(json_object)
71
72
  id = struct["id"]
72
73
  resource_url = struct["resource_url"]
73
74
  status = struct["status"]
@@ -283,6 +283,7 @@ module AssemblyAI
283
283
  # @return [AssemblyAI::Transcripts::TranscriptOptionalParams]
284
284
  def self.from_json(json_object:)
285
285
  struct = JSON.parse(json_object, object_class: OpenStruct)
286
+ parsed_json = JSON.parse(json_object)
286
287
  language_code = struct["language_code"]
287
288
  punctuate = struct["punctuate"]
288
289
  format_text = struct["format_text"]
@@ -65,6 +65,7 @@ module AssemblyAI
65
65
  # @return [AssemblyAI::Transcripts::TranscriptParagraph]
66
66
  def self.from_json(json_object:)
67
67
  struct = JSON.parse(json_object, object_class: OpenStruct)
68
+ parsed_json = JSON.parse(json_object)
68
69
  text = struct["text"]
69
70
  start = struct["start"]
70
71
  end_ = struct["end"]
@@ -65,6 +65,7 @@ module AssemblyAI
65
65
  # @return [AssemblyAI::Transcripts::TranscriptSentence]
66
66
  def self.from_json(json_object:)
67
67
  struct = JSON.parse(json_object, object_class: OpenStruct)
68
+ parsed_json = JSON.parse(json_object)
68
69
  text = struct["text"]
69
70
  start = struct["start"]
70
71
  end_ = struct["end"]
@@ -61,6 +61,7 @@ module AssemblyAI
61
61
  # @return [AssemblyAI::Transcripts::TranscriptUtterance]
62
62
  def self.from_json(json_object:)
63
63
  struct = JSON.parse(json_object, object_class: OpenStruct)
64
+ parsed_json = JSON.parse(json_object)
64
65
  confidence = struct["confidence"]
65
66
  start = struct["start"]
66
67
  end_ = struct["end"]
data/lib/requests.rb CHANGED
@@ -22,14 +22,14 @@ module AssemblyAI
22
22
  # @param timeout_in_seconds [Long]
23
23
  # @param api_key [String]
24
24
  # @return [AssemblyAI::RequestClient]
25
- def initialize(api_key:, environment: Environment::DEFAULT, base_url: nil, max_retries: nil,
25
+ def initialize(api_key:, environment: AssemblyAI::Environment::DEFAULT, base_url: nil, max_retries: nil,
26
26
  timeout_in_seconds: nil)
27
27
  @default_environment = environment
28
28
  @base_url = environment || base_url
29
29
  @headers = {
30
30
  "X-Fern-Language": "Ruby",
31
31
  "X-Fern-SDK-Name": "assemblyai",
32
- "X-Fern-SDK-Version": "1.0.0-beta.9",
32
+ "X-Fern-SDK-Version": "1.0.0-beta.10",
33
33
  "Authorization": api_key.to_s
34
34
  }
35
35
  @conn = Faraday.new(headers: @headers) do |faraday|
@@ -63,14 +63,14 @@ module AssemblyAI
63
63
  # @param timeout_in_seconds [Long]
64
64
  # @param api_key [String]
65
65
  # @return [AssemblyAI::AsyncRequestClient]
66
- def initialize(api_key:, environment: Environment::DEFAULT, base_url: nil, max_retries: nil,
66
+ def initialize(api_key:, environment: AssemblyAI::Environment::DEFAULT, base_url: nil, max_retries: nil,
67
67
  timeout_in_seconds: nil)
68
68
  @default_environment = environment
69
69
  @base_url = environment || base_url
70
70
  @headers = {
71
71
  "X-Fern-Language": "Ruby",
72
72
  "X-Fern-SDK-Name": "assemblyai",
73
- "X-Fern-SDK-Version": "1.0.0-beta.9",
73
+ "X-Fern-SDK-Version": "1.0.0-beta.10",
74
74
  "Authorization": api_key.to_s
75
75
  }
76
76
  @conn = Faraday.new(headers: @headers) do |faraday|
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.9
4
+ version: 1.0.0.pre.beta.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-30 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday