mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-25 23:43:26 +00:00
20 lines
331 B
Ruby
20 lines
331 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module DiscourseAi
|
||
|
module Configuration
|
||
|
class EmbeddingDefsValidator
|
||
|
def initialize(opts = {})
|
||
|
@opts = opts
|
||
|
end
|
||
|
|
||
|
def valid_value?(val)
|
||
|
val.blank? || EmbeddingDefinition.exists?(id: val)
|
||
|
end
|
||
|
|
||
|
def error_message
|
||
|
""
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|