Module: Legion::Data::Models
- Extended by:
- Logging::Helper
- Defined in:
- lib/legion/data/model.rb,
lib/legion/data/models/llm/message.rb,
lib/legion/data/models/llm/tool_call.rb,
lib/legion/data/models/llm/conversation.rb,
lib/legion/data/models/llm/model_helpers.rb,
lib/legion/data/models/llm/route_attempt.rb,
lib/legion/data/models/llm/registry_event.rb,
lib/legion/data/models/llm/security_event.rb,
lib/legion/data/models/llm/policy_evaluation.rb,
lib/legion/data/models/llm/tool_call_attempt.rb,
lib/legion/data/models/llm/conversation_compaction.rb,
lib/legion/data/models/llm/message_inference_metric.rb,
lib/legion/data/models/llm/message_inference_request.rb,
lib/legion/data/models/llm/message_inference_response.rb
Defined Under Namespace
Modules: LLM
Class Attribute Summary collapse
-
.loaded_models ⇒ Object
readonly
Returns the value of attribute loaded_models.
Class Method Summary collapse
- .load ⇒ Object
- .load_sequel_model(model) ⇒ Object
- .models ⇒ Object
- .require_sequel_models(files = models) ⇒ Object
Methods included from Logging::Helper
Class Attribute Details
.loaded_models ⇒ Object (readonly)
Returns the value of attribute loaded_models.
11 12 13 |
# File 'lib/legion/data/model.rb', line 11 def loaded_models @loaded_models end |
Class Method Details
.load ⇒ Object
30 31 32 33 34 35 |
# File 'lib/legion/data/model.rb', line 30 def load log.info 'Loading Legion::Data::Models' @loaded_models ||= [] require_sequel_models(models) Legion::Settings[:data][:models][:loaded] = true end |
.load_sequel_model(model) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/legion/data/model.rb', line 42 def load_sequel_model(model) log.debug("Trying to load #{model}.rb") require_relative "models/#{model}" @loaded_models << model log.debug("Successfully loaded #{model}") model rescue LoadError => e handle_exception(e, level: :fatal, operation: :load_sequel_model, model: model) raise e unless Legion::Settings[:data][:models][:continue_on_load_fail] end |
.models ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/legion/data/model.rb', line 13 def models %w[extension function relationship chain task runner node setting digital_worker apollo_entry apollo_relation apollo_expertise apollo_access_log audit_log audit_record identity_provider principal identity identity_group identity_group_membership identity_audit_log extract_step_timing identity/identity identity/principal identity/providers identity/group identity/group_memberships identity/audit_log apollo/entries apollo/relation apollo/access_log apollo/expertise apollo/operation rbac/role_assignments rbac/runner_grants rbac/cross_team_grants llm/conversation llm/message llm/message_inference_request llm/message_inference_response llm/route_attempt llm/message_inference_metric llm/tool_call llm/tool_call_attempt llm/conversation_compaction llm/policy_evaluation llm/security_event llm/registry_event] end |
.require_sequel_models(files = models) ⇒ Object
37 38 39 40 |
# File 'lib/legion/data/model.rb', line 37 def require_sequel_models(files = models) # Dir["#{File.dirname(__FILE__)}models/*.rb"].each { |file| puts file } files.each { |file| load_sequel_model(file) } end |