Class: Langfuse::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/langfuse/configuration.rb', line 7

def initialize
  # Default configuration with environment variable fallbacks
  @public_key = ENV['LANGFUSE_PUBLIC_KEY']
  @secret_key = ENV['LANGFUSE_SECRET_KEY']
  @host = ENV.fetch('LANGFUSE_HOST', 'https://us.cloud.langfuse.com')
  @batch_size = ENV.fetch('LANGFUSE_BATCH_SIZE', '10').to_i
  @flush_interval = ENV.fetch('LANGFUSE_FLUSH_INTERVAL', '60').to_i
  @debug = ENV.fetch('LANGFUSE_DEBUG', 'false') == 'true'
  @disable_at_exit_hook = false
  @shutdown_timeout = ENV.fetch('LANGFUSE_SHUTDOWN_TIMEOUT', '5').to_i
  @logger = Logger.new(STDOUT)
end

Instance Attribute Details

#batch_sizeObject

Returns the value of attribute batch_size.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def batch_size
  @batch_size
end

#debugObject

Returns the value of attribute debug.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def debug
  @debug
end

#disable_at_exit_hookObject

Returns the value of attribute disable_at_exit_hook.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def disable_at_exit_hook
  @disable_at_exit_hook
end

#flush_intervalObject

Returns the value of attribute flush_interval.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def flush_interval
  @flush_interval
end

#hostObject

Returns the value of attribute host.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def host
  @host
end

#loggerObject

Returns the value of attribute logger.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def logger
  @logger
end

#public_keyObject

Returns the value of attribute public_key.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def public_key
  @public_key
end

#secret_keyObject

Returns the value of attribute secret_key.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def secret_key
  @secret_key
end

#shutdown_timeoutObject

Returns the value of attribute shutdown_timeout.



3
4
5
# File 'lib/langfuse/configuration.rb', line 3

def shutdown_timeout
  @shutdown_timeout
end