Class: Langfuse::Configuration

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/langfuse/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/langfuse/configuration.rb', line 26

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

Instance Attribute Details

#batch_sizeObject

Returns the value of attribute batch_size.



17
18
19
# File 'lib/langfuse/configuration.rb', line 17

def batch_size
  @batch_size
end

#debugObject

Returns the value of attribute debug.



20
21
22
# File 'lib/langfuse/configuration.rb', line 20

def debug
  @debug
end

#disable_at_exit_hookObject

Returns the value of attribute disable_at_exit_hook.



20
21
22
# File 'lib/langfuse/configuration.rb', line 20

def disable_at_exit_hook
  @disable_at_exit_hook
end

#flush_intervalObject

Returns the value of attribute flush_interval.



17
18
19
# File 'lib/langfuse/configuration.rb', line 17

def flush_interval
  @flush_interval
end

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#loggerObject

Returns the value of attribute logger.



23
24
25
# File 'lib/langfuse/configuration.rb', line 23

def logger
  @logger
end

#public_keyObject

Returns the value of attribute public_key.



11
12
13
# File 'lib/langfuse/configuration.rb', line 11

def public_key
  @public_key
end

#secret_keyObject

Returns the value of attribute secret_key.



11
12
13
# File 'lib/langfuse/configuration.rb', line 11

def secret_key
  @secret_key
end

#shutdown_timeoutObject

Returns the value of attribute shutdown_timeout.



17
18
19
# File 'lib/langfuse/configuration.rb', line 17

def shutdown_timeout
  @shutdown_timeout
end