jekyll-client-search 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module ClientSearch
5
+ # Validates semantic-engine index settings: which Ollama model's vectors
6
+ # are written into the search index and must match the browser query
7
+ # embedder's vector space.
8
+ class SemanticConfiguration
9
+ def initialize(config)
10
+ unless config.is_a?(Hash)
11
+ raise Jekyll::Errors::FatalException,
12
+ "client_search semantic configuration must be a mapping"
13
+ end
14
+
15
+ @values = config
16
+ validate!
17
+ end
18
+
19
+ # Ollama model embedded into the search index. nil means the site uses
20
+ # the general embedding.model.
21
+ def index_model
22
+ value = @values["index_model"]
23
+ value&.to_s
24
+ end
25
+
26
+ def document_prefix
27
+ value = @values["document_prefix"]
28
+ value&.to_s
29
+ end
30
+
31
+ def query_prefix
32
+ value = @values["query_prefix"]
33
+ value&.to_s
34
+ end
35
+
36
+ private
37
+
38
+ def validate!
39
+ return if index_model.nil? || !index_model.empty?
40
+
41
+ raise Jekyll::Errors::FatalException,
42
+ "client_search semantic index_model must not be empty"
43
+ end
44
+ end
45
+ end
46
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module ClientSearch
5
- VERSION = "0.3.4"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
@@ -9,6 +9,7 @@ require_relative "client_search/version"
9
9
  require_relative "client_search/embedding_configuration"
10
10
  require_relative "client_search/live_search_configuration"
11
11
  require_relative "client_search/related_configuration"
12
+ require_relative "client_search/semantic_configuration"
12
13
  require_relative "client_search/dropdown_configuration"
13
14
  require_relative "client_search/query_embedder_configuration"
14
15
  require_relative "client_search/configuration_accessors"
@@ -23,5 +24,6 @@ require_relative "client_search/index_cache"
23
24
  require_relative "client_search/ollama_embedding_adapter"
24
25
  require_relative "client_search/generator"
25
26
  require_relative "client_search/related_tag"
27
+ require_relative "client_search/script_tags"
26
28
  require_relative "client_search/dropdown_tag"
27
29
  require_relative "client_search/search_tag"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-client-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svend Gundestrup
@@ -75,8 +75,10 @@ files:
75
75
  - lib/jekyll/client_search/related_page.rb
76
76
  - lib/jekyll/client_search/related_tag.rb
77
77
  - lib/jekyll/client_search/runtime_config_page.rb
78
+ - lib/jekyll/client_search/script_tags.rb
78
79
  - lib/jekyll/client_search/search_index_page.rb
79
80
  - lib/jekyll/client_search/search_tag.rb
81
+ - lib/jekyll/client_search/semantic_configuration.rb
80
82
  - lib/jekyll/client_search/tasks.rb
81
83
  - lib/jekyll/client_search/version.rb
82
84
  homepage: https://github.com/gundestrup/jekyll-client-search
@@ -95,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
97
  requirements:
96
98
  - - ">="
97
99
  - !ruby/object:Gem::Version
98
- version: 3.2.0
100
+ version: 3.3.0
99
101
  required_rubygems_version: !ruby/object:Gem::Requirement
100
102
  requirements:
101
103
  - - ">="