Class: MeetingBuddy::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/meeting_buddy/configuration.rb

Overview

Manages configuration for MeetingBuddy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#loggerObject



14
15
16
# File 'lib/meeting_buddy/configuration.rb', line 14

def logger
  @logger ||= Logger.new($stdout, level: Logger::INFO)
end

#openai_clientOpenAI::Client

Returns:

  • (OpenAI::Client)

Raises:



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_loggerObject



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_modelObject

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_commandString

Returns:

  • (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