Class: MeetingBuddy::Configuration
- Inherits:
-
Object
- Object
- MeetingBuddy::Configuration
- Defined in:
- lib/meeting_buddy/configuration.rb
Overview
Manages configuration for MeetingBuddy
Instance Attribute Summary collapse
- #logger ⇒ Object
- #openai_client ⇒ OpenAI::Client
- #whisper_logger ⇒ Object
-
#whisper_model ⇒ Object
Returns the value of attribute whisper_model.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #whisper_command ⇒ String
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 |
# File 'lib/meeting_buddy/configuration.rb', line 9 def initialize @logger = Logger.new($stdout, level: Logger::INFO) @whisper_model = "small.en-q5_1" end |
Instance Attribute Details
#logger ⇒ Object
14 15 16 |
# File 'lib/meeting_buddy/configuration.rb', line 14 def logger @logger ||= Logger.new($stdout, level: Logger::INFO) end |
#openai_client ⇒ OpenAI::Client
23 24 25 26 27 |
# File 'lib/meeting_buddy/configuration.rb', line 23 def openai_client raise Error, "Please set an OPENAI_ACCESS_TOKEN environment variable." if ENV["OPENAI_ACCESS_TOKEN"].to_s.strip.empty? @openai_client ||= OpenAI::Client.new(access_token: ENV["OPENAI_ACCESS_TOKEN"], log_errors: true) end |
#whisper_logger ⇒ Object
18 19 20 |
# File 'lib/meeting_buddy/configuration.rb', line 18 def whisper_logger @whisper_logger ||= Logger.new(MeetingBuddy.session.whisper_log, level: Logger::INFO) end |
#whisper_model ⇒ Object
Returns the value of attribute whisper_model.
6 7 8 |
# File 'lib/meeting_buddy/configuration.rb', line 6 def whisper_model @whisper_model end |
Instance Method Details
#whisper_command ⇒ String
30 31 32 |
# File 'lib/meeting_buddy/configuration.rb', line 30 def whisper_command "#{MeetingBuddy.cache_dir}/whisper.cpp/build/bin/stream -m #{MeetingBuddy.cache_dir}/whisper.cpp/models/ggml-#{whisper_model}.bin -t 8 --step 0 --length 5000 --keep 500 --vad-thold 0.75 --audio-ctx 0 --keep-context -c 1 -l en" end |