-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from AssemblyAI/fern-bot/02-16-2024-0351AM
🌿 Fern Regeneration -- February 16, 2024
- Loading branch information
Showing
7 changed files
with
127 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
name: Publish Ruby Gem | ||
name: Publish | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and publish Gem to RubyGems | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
publish: | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
|
||
- name: Build and Push Gem | ||
env: | ||
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }} | ||
run: | | ||
gem build assemblyai.gemspec | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
|
||
- name: Build and Push Gem | ||
env: | ||
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||
run: | | ||
gem build assemblyai.gemspec | ||
gem push assemblyai-*.gem --host https://rubygems.org | ||
gem push assemblyai-*.gem --host https://rubygems.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
lib/assemblyai/realtime/types/configure_end_utterance_silence_threshold.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# frozen_string_literal: true | ||
|
||
require "json" | ||
|
||
module AssemblyAI | ||
class Realtime | ||
# Configure the threshold for how long to wait before ending an utterance. Default is 700ms. | ||
class ConfigureEndUtteranceSilenceThreshold | ||
attr_reader :end_utterance_silence_threshold, :additional_properties | ||
|
||
# @param end_utterance_silence_threshold [Integer] The duration threshold in milliseconds | ||
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition | ||
# @return [Realtime::ConfigureEndUtteranceSilenceThreshold] | ||
def initialize(end_utterance_silence_threshold:, additional_properties: nil) | ||
# @type [Integer] The duration threshold in milliseconds | ||
@end_utterance_silence_threshold = end_utterance_silence_threshold | ||
# @type [OpenStruct] Additional properties unmapped to the current class definition | ||
@additional_properties = additional_properties | ||
end | ||
|
||
# Deserialize a JSON object to an instance of ConfigureEndUtteranceSilenceThreshold | ||
# | ||
# @param json_object [JSON] | ||
# @return [Realtime::ConfigureEndUtteranceSilenceThreshold] | ||
def self.from_json(json_object:) | ||
struct = JSON.parse(json_object, object_class: OpenStruct) | ||
JSON.parse(json_object) | ||
end_utterance_silence_threshold = struct.end_utterance_silence_threshold | ||
new(end_utterance_silence_threshold: end_utterance_silence_threshold, additional_properties: struct) | ||
end | ||
|
||
# Serialize an instance of ConfigureEndUtteranceSilenceThreshold to a JSON object | ||
# | ||
# @return [JSON] | ||
def to_json(*_args) | ||
{ "end_utterance_silence_threshold": @end_utterance_silence_threshold }.to_json | ||
end | ||
|
||
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. | ||
# | ||
# @param obj [Object] | ||
# @return [Void] | ||
def self.validate_raw(obj:) | ||
obj.end_utterance_silence_threshold.is_a?(Integer) != false || raise("Passed value for field obj.end_utterance_silence_threshold is not the expected type, validation failed.") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# frozen_string_literal: true | ||
|
||
require "json" | ||
|
||
module AssemblyAI | ||
class Realtime | ||
# Manually end an utterance | ||
class ForceEndUtterance | ||
attr_reader :force_end_utterance, :additional_properties | ||
|
||
# @param force_end_utterance [Boolean] A boolean value to communicate that you wish to force the end of the utterance | ||
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition | ||
# @return [Realtime::ForceEndUtterance] | ||
def initialize(force_end_utterance:, additional_properties: nil) | ||
# @type [Boolean] A boolean value to communicate that you wish to force the end of the utterance | ||
@force_end_utterance = force_end_utterance | ||
# @type [OpenStruct] Additional properties unmapped to the current class definition | ||
@additional_properties = additional_properties | ||
end | ||
|
||
# Deserialize a JSON object to an instance of ForceEndUtterance | ||
# | ||
# @param json_object [JSON] | ||
# @return [Realtime::ForceEndUtterance] | ||
def self.from_json(json_object:) | ||
struct = JSON.parse(json_object, object_class: OpenStruct) | ||
JSON.parse(json_object) | ||
force_end_utterance = struct.force_end_utterance | ||
new(force_end_utterance: force_end_utterance, additional_properties: struct) | ||
end | ||
|
||
# Serialize an instance of ForceEndUtterance to a JSON object | ||
# | ||
# @return [JSON] | ||
def to_json(*_args) | ||
{ "force_end_utterance": @force_end_utterance }.to_json | ||
end | ||
|
||
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions. | ||
# | ||
# @param obj [Object] | ||
# @return [Void] | ||
def self.validate_raw(obj:) | ||
obj.force_end_utterance.is_a?(Boolean) != false || raise("Passed value for field obj.force_end_utterance is not the expected type, validation failed.") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters