mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 11:53:31 +08:00
20 lines
415 B
Ruby
Vendored
20 lines
415 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
require "enum_site_setting"
|
|
|
|
module DiscourseAi
|
|
module Configuration
|
|
class EmbeddingDefsEnumerator < ::EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
true
|
|
end
|
|
|
|
def self.values
|
|
DB.query_hash(<<~SQL).map(&:symbolize_keys)
|
|
SELECT display_name AS name, id AS value
|
|
FROM embedding_definitions
|
|
SQL
|
|
end
|
|
end
|
|
end
|
|
end
|