Class: DSPy::Subscribers::LangfuseSubscriber::LangfuseConfig

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/subscribers/langfuse_subscriber.rb

Overview

Configuration for Langfuse integration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLangfuseConfig

Returns a new instance of LangfuseConfig.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 56

def initialize
  @enabled = !!(defined?(Langfuse) && ENV['LANGFUSE_SECRET_KEY'])
  @public_key = ENV['LANGFUSE_PUBLIC_KEY']
  @secret_key = ENV['LANGFUSE_SECRET_KEY']
  @host = ENV['LANGFUSE_HOST'] || 'https://cloud.langfuse.com'
  @trace_optimizations = true
  @trace_lm_calls = true
  @trace_evaluations = true
  @log_prompts = true
  @log_completions = true
  @calculate_costs = true
  @default_tags = { 'framework' => 'dspy-ruby' }
end

Instance Attribute Details

#calculate_costsObject

Returns the value of attribute calculate_costs.



50
51
52
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 50

def calculate_costs
  @calculate_costs
end

#default_tagsObject

Returns the value of attribute default_tags.



53
54
55
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 53

def default_tags
  @default_tags
end

#enabledObject

Returns the value of attribute enabled.



23
24
25
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 23

def enabled
  @enabled
end

#hostObject

Returns the value of attribute host.



32
33
34
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 32

def host
  @host
end

#log_completionsObject

Returns the value of attribute log_completions.



47
48
49
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 47

def log_completions
  @log_completions
end

#log_promptsObject

Returns the value of attribute log_prompts.



44
45
46
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 44

def log_prompts
  @log_prompts
end

#public_keyObject

Returns the value of attribute public_key.



26
27
28
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 26

def public_key
  @public_key
end

#secret_keyObject

Returns the value of attribute secret_key.



29
30
31
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 29

def secret_key
  @secret_key
end

#trace_evaluationsObject

Returns the value of attribute trace_evaluations.



41
42
43
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 41

def trace_evaluations
  @trace_evaluations
end

#trace_lm_callsObject

Returns the value of attribute trace_lm_calls.



38
39
40
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 38

def trace_lm_calls
  @trace_lm_calls
end

#trace_optimizationsObject

Returns the value of attribute trace_optimizations.



35
36
37
# File 'lib/dspy/subscribers/langfuse_subscriber.rb', line 35

def trace_optimizations
  @trace_optimizations
end