Class: Observ::Configuration
- Inherits:
-
Object
- Object
- Observ::Configuration
- Defined in:
- lib/observ/configuration.rb
Instance Attribute Summary collapse
-
#agent_path ⇒ Object
Returns the value of attribute agent_path.
-
#back_to_app_path ⇒ Object
Returns the value of attribute back_to_app_path.
-
#chat_ui_enabled ⇒ Object
Returns the value of attribute chat_ui_enabled.
-
#pagination_per_page ⇒ Object
Returns the value of attribute pagination_per_page.
-
#prompt_allow_production_deletion ⇒ Object
Returns the value of attribute prompt_allow_production_deletion.
-
#prompt_cache_critical_prompts ⇒ Object
Returns the value of attribute prompt_cache_critical_prompts.
-
#prompt_cache_monitoring_enabled ⇒ Object
Returns the value of attribute prompt_cache_monitoring_enabled.
-
#prompt_cache_namespace ⇒ Object
Returns the value of attribute prompt_cache_namespace.
-
#prompt_cache_prefix ⇒ Object
Returns the value of attribute prompt_cache_prefix.
-
#prompt_cache_store ⇒ Object
Returns the value of attribute prompt_cache_store.
-
#prompt_cache_ttl ⇒ Object
Returns the value of attribute prompt_cache_ttl.
-
#prompt_cache_warming_enabled ⇒ Object
Returns the value of attribute prompt_cache_warming_enabled.
-
#prompt_config_schema ⇒ Object
Returns the value of attribute prompt_config_schema.
-
#prompt_config_schema_strict ⇒ Object
Returns the value of attribute prompt_config_schema_strict.
-
#prompt_default_state ⇒ Object
Returns the value of attribute prompt_default_state.
-
#prompt_fallback_behavior ⇒ Object
Returns the value of attribute prompt_fallback_behavior.
-
#prompt_management_enabled ⇒ Object
Returns the value of attribute prompt_management_enabled.
-
#prompt_max_versions ⇒ Object
Returns the value of attribute prompt_max_versions.
Instance Method Summary collapse
-
#chat_ui_enabled? ⇒ Boolean
Check if chat UI is enabled.
-
#default_prompt_config_schema ⇒ Hash
Default schema for prompt configuration validation.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/observ/configuration.rb', line 24 def initialize @prompt_management_enabled = true @prompt_cache_ttl = 300 # 5 minutes @prompt_fallback_behavior = :raise # or :return_nil, :use_fallback @prompt_cache_store = :redis_cache_store @prompt_cache_prefix = "observ:prompt" @prompt_cache_namespace = "observ:prompt" @prompt_max_versions = 100 @prompt_default_state = :production @prompt_allow_production_deletion = false @prompt_cache_warming_enabled = true @prompt_cache_critical_prompts = [] @prompt_cache_monitoring_enabled = true @prompt_config_schema = default_prompt_config_schema @prompt_config_schema_strict = false @back_to_app_path = -> { "/" } @chat_ui_enabled = -> { defined?(::Chat) && ::Chat.respond_to?(:acts_as_chat) } @agent_path = nil # Defaults to Rails.root.join("app", "agents") @pagination_per_page = 25 end |
Instance Attribute Details
#agent_path ⇒ Object
Returns the value of attribute agent_path.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def agent_path @agent_path end |
#back_to_app_path ⇒ Object
Returns the value of attribute back_to_app_path.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def back_to_app_path @back_to_app_path end |
#chat_ui_enabled ⇒ Object
Returns the value of attribute chat_ui_enabled.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def chat_ui_enabled @chat_ui_enabled end |
#pagination_per_page ⇒ Object
Returns the value of attribute pagination_per_page.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def pagination_per_page @pagination_per_page end |
#prompt_allow_production_deletion ⇒ Object
Returns the value of attribute prompt_allow_production_deletion.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_allow_production_deletion @prompt_allow_production_deletion end |
#prompt_cache_critical_prompts ⇒ Object
Returns the value of attribute prompt_cache_critical_prompts.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_critical_prompts @prompt_cache_critical_prompts end |
#prompt_cache_monitoring_enabled ⇒ Object
Returns the value of attribute prompt_cache_monitoring_enabled.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_monitoring_enabled @prompt_cache_monitoring_enabled end |
#prompt_cache_namespace ⇒ Object
Returns the value of attribute prompt_cache_namespace.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_namespace @prompt_cache_namespace end |
#prompt_cache_prefix ⇒ Object
Returns the value of attribute prompt_cache_prefix.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_prefix @prompt_cache_prefix end |
#prompt_cache_store ⇒ Object
Returns the value of attribute prompt_cache_store.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_store @prompt_cache_store end |
#prompt_cache_ttl ⇒ Object
Returns the value of attribute prompt_cache_ttl.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_ttl @prompt_cache_ttl end |
#prompt_cache_warming_enabled ⇒ Object
Returns the value of attribute prompt_cache_warming_enabled.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_cache_warming_enabled @prompt_cache_warming_enabled end |
#prompt_config_schema ⇒ Object
Returns the value of attribute prompt_config_schema.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_config_schema @prompt_config_schema end |
#prompt_config_schema_strict ⇒ Object
Returns the value of attribute prompt_config_schema_strict.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_config_schema_strict @prompt_config_schema_strict end |
#prompt_default_state ⇒ Object
Returns the value of attribute prompt_default_state.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_default_state @prompt_default_state end |
#prompt_fallback_behavior ⇒ Object
Returns the value of attribute prompt_fallback_behavior.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_fallback_behavior @prompt_fallback_behavior end |
#prompt_management_enabled ⇒ Object
Returns the value of attribute prompt_management_enabled.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_management_enabled @prompt_management_enabled end |
#prompt_max_versions ⇒ Object
Returns the value of attribute prompt_max_versions.
5 6 7 |
# File 'lib/observ/configuration.rb', line 5 def prompt_max_versions @prompt_max_versions end |
Instance Method Details
#chat_ui_enabled? ⇒ Boolean
Check if chat UI is enabled
47 48 49 50 |
# File 'lib/observ/configuration.rb', line 47 def chat_ui_enabled? return @chat_ui_enabled.call if @chat_ui_enabled.respond_to?(:call) @chat_ui_enabled end |
#default_prompt_config_schema ⇒ Hash
Default schema for prompt configuration validation
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/observ/configuration.rb', line 54 def default_prompt_config_schema { temperature: { type: :float, required: false, range: 0.0..2.0, default: 0.7 }, max_tokens: { type: :integer, required: false, range: 1..100000 }, top_p: { type: :float, required: false, range: 0.0..1.0 }, frequency_penalty: { type: :float, required: false, range: -2.0..2.0 }, presence_penalty: { type: :float, required: false, range: -2.0..2.0 }, stop_sequences: { type: :array, required: false, item_type: :string }, model: { type: :string, required: false }, response_format: { type: :hash, required: false }, seed: { type: :integer, required: false }, stream: { type: :boolean, required: false } } end |