Class: Phronomy::Configuration
- Inherits:
-
Object
- Object
- Phronomy::Configuration
- Defined in:
- lib/phronomy/configuration.rb
Overview
Holds global configuration for the entire framework. Configure via the Phronomy.configure block.
Instance Attribute Summary collapse
-
#before_completion ⇒ Object
Global before_completion hook callable (Proc / lambda).
-
#default_embedding_model ⇒ Object
Default embedding model name.
-
#default_model ⇒ Object
Default LLM model name (nil delegates to RubyLLM default).
-
#event_loop ⇒ Object
When true, workflow execution is driven by EventLoop instead of a synchronous loop in the calling thread.
-
#event_loop_stop_grace_seconds ⇒ Object
Grace period (in seconds) before the EventLoop background thread is force-killed after a cooperative stop request.
-
#logger ⇒ Object
Optional logger for framework diagnostic messages (e.g. unreachable-state warnings).
-
#recursion_limit ⇒ Object
Recursion limit for graph execution (default: 25).
-
#state_store ⇒ Object
Global state store for workflow persistence.
-
#trace_pii ⇒ Object
When true, user input and LLM output are recorded in trace spans.
-
#tracer ⇒ Object
Tracer instance.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
64 65 66 67 68 69 70 |
# File 'lib/phronomy/configuration.rb', line 64 def initialize @recursion_limit = 25 @tracer = Phronomy::Tracing::NullTracer.new @trace_pii = false @event_loop = false @event_loop_stop_grace_seconds = 5 end |
Instance Attribute Details
#before_completion ⇒ Object
Global before_completion hook callable (Proc / lambda). Called before every LLM request across all agents. Receives a Agent::BeforeCompletionContext; must return a Hash of params to merge, or nil to pass through unchanged.
26 27 28 |
# File 'lib/phronomy/configuration.rb', line 26 def before_completion @before_completion end |
#default_embedding_model ⇒ Object
Default embedding model name
17 18 19 |
# File 'lib/phronomy/configuration.rb', line 17 def @default_embedding_model end |
#default_model ⇒ Object
Default LLM model name (nil delegates to RubyLLM default)
14 15 16 |
# File 'lib/phronomy/configuration.rb', line 14 def default_model @default_model end |
#event_loop ⇒ Object
When true, workflow execution is driven by EventLoop instead of a synchronous loop in the calling thread. Defaults to false (sync mode).
34 35 36 |
# File 'lib/phronomy/configuration.rb', line 34 def event_loop @event_loop end |
#event_loop_stop_grace_seconds ⇒ Object
Grace period (in seconds) before the EventLoop background thread is force-killed after a cooperative stop request. Applies both to the overall thread join and to the drain-and-cancel phase when +stop(drain: true)+ is used. Default: 5 seconds.
54 55 56 |
# File 'lib/phronomy/configuration.rb', line 54 def event_loop_stop_grace_seconds @event_loop_stop_grace_seconds end |
#logger ⇒ Object
Optional logger for framework diagnostic messages (e.g. unreachable-state warnings). Must respond to +#warn(message)+. When nil (default), messages are written to +$stderr+ via +Kernel#warn+.
47 48 49 |
# File 'lib/phronomy/configuration.rb', line 47 def logger @logger end |
#recursion_limit ⇒ Object
Recursion limit for graph execution (default: 25)
29 30 31 |
# File 'lib/phronomy/configuration.rb', line 29 def recursion_limit @recursion_limit end |
#state_store ⇒ Object
Global state store for workflow persistence. When set, WorkflowRunner routes all state reads and writes through this store. Must be an instance of a class that inherits from Phronomy::StateStore::Base. Defaults to +nil+ (no persistence — state lives only for the duration of invoke).
62 63 64 |
# File 'lib/phronomy/configuration.rb', line 62 def state_store @state_store end |
#trace_pii ⇒ Object
When true, user input and LLM output are recorded in trace spans. Defaults to false; set to true only in environments where PII capture is acceptable. Set to false in privacy-sensitive environments to prevent PII from reaching the tracing backend (OTel, Langfuse, etc.).
40 41 42 |
# File 'lib/phronomy/configuration.rb', line 40 def trace_pii @trace_pii end |
#tracer ⇒ Object
Tracer instance
20 21 22 |
# File 'lib/phronomy/configuration.rb', line 20 def tracer @tracer end |