Class: Cohere::Transcribe::PublicationOptions
- Inherits:
-
Data
- Object
- Data
- Cohere::Transcribe::PublicationOptions
- Defined in:
- lib/cohere/transcribe/types.rb,
sig/cohere/transcribe.rbs
Overview
Optional durable output settings for a transcription run.
Instance Attribute Summary collapse
-
#existing ⇒ Object
readonly
Returns the value of attribute existing.
-
#formats ⇒ Object
readonly
Returns the value of attribute formats.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#profile_json ⇒ Object
readonly
Returns the value of attribute profile_json.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(formats: nil, output_dir: nil, existing: "error", profile_json: nil) ⇒ PublicationOptions
constructor
A new instance of PublicationOptions.
Constructor Details
#initialize(formats: nil, output_dir: nil, existing: "error", profile_json: nil) ⇒ PublicationOptions
Returns a new instance of PublicationOptions.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/cohere/transcribe/types.rb', line 72 def initialize(formats: nil, output_dir: nil, existing: "error", profile_json: nil) unless formats.nil? formats = TypesSupport.tuple(formats, field: "formats").uniq.freeze raise ArgumentError, "formats must contain at least one output format" if formats.empty? unsupported = formats.reject { |format| TypesSupport::OUTPUT_FORMATS.include?(format) } unless unsupported.empty? rendered = unsupported.map(&:to_s).sort.join(", ") raise ArgumentError, "Unsupported output format(s): #{rendered}" end end raise ArgumentError, "existing must be 'error', 'overwrite', or 'skip'" unless TypesSupport::EXISTING_POLICIES.include?(existing) super( formats: formats, output_dir: output_dir.nil? ? nil : TypesSupport.path(output_dir), existing: TypesSupport.immutable(existing), profile_json: profile_json.nil? ? nil : TypesSupport.path(profile_json) ) end |
Instance Attribute Details
#existing ⇒ Object (readonly)
Returns the value of attribute existing
71 72 73 |
# File 'lib/cohere/transcribe/types.rb', line 71 def existing @existing end |
#formats ⇒ Object (readonly)
Returns the value of attribute formats
71 72 73 |
# File 'lib/cohere/transcribe/types.rb', line 71 def formats @formats end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir
71 72 73 |
# File 'lib/cohere/transcribe/types.rb', line 71 def output_dir @output_dir end |
#profile_json ⇒ Object (readonly)
Returns the value of attribute profile_json
71 72 73 |
# File 'lib/cohere/transcribe/types.rb', line 71 def profile_json @profile_json end |
Class Method Details
.new ⇒ Object
26 |
# File 'sig/cohere/transcribe.rbs', line 26
def self.new: (?formats: Array[output_format]?, ?output_dir: path_input?, ?existing: String,
|