mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-08 18:29:32 +00:00
* 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
23 lines
465 B
Ruby
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
|