discourse-ai/lib/configuration/embeddings_module_validator.rb
Roman Rizzi f5cf1019fb
FEATURE: configurable embeddings (#1049)
* Use AR model for embeddings features

* endpoints

* Embeddings CRUD UI

* Add presets. Hide a couple more settings

* system specs

* Seed embedding definition from old settings

* Generate search bit index on the fly. cleanup orphaned data

* support for seeded models

* Fix run test for new embedding

* fix selected model not set correctly
2025-01-21 12:23:19 -03:00

23 lines
465 B
Ruby

# frozen_string_literal: true
module DiscourseAi
module Configuration
class EmbeddingsModuleValidator
def initialize(opts = {})
@opts = opts
end
def valid_value?(val)
return true if val == "f"
return true if Rails.env.test?
SiteSetting.ai_embeddings_selected_model.present?
end
def error_message
I18n.t("discourse_ai.embeddings.configuration.choose_model")
end
end
end
end