ollama_chat 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36395404aa00934bda9f2229306a374143c30046bf7439188d369b9fe167f649
4
- data.tar.gz: 2dc4c482a17e31a86c347d557475af52eccbe6638f2487abc564c11b5ef379b7
3
+ metadata.gz: c66eb0eb6290d5161516ac786036a66c381339db5ea9a91039efc0c26b069591
4
+ data.tar.gz: a762ad194903ce17b01d07fa44af1b2e2fc832049ae5ec665da0236291a58561
5
5
  SHA512:
6
- metadata.gz: ece58d0452a5695dc3fec1a1032a9e45a6e9400085e48f512c13b9473acd53596a55d69a7f9264689fdb0a3b3335b8223547efbc504c9a3052a85e5ef9a0cc89
7
- data.tar.gz: 11a052d21eed75504722adde01ff43c10213ba371887b7f376fdbe4b962cf3dd3bd550325341af16c2215101776ca14753cf353eec221f3f5e98fff386053f51
6
+ metadata.gz: b133ad766292019028dc584a6197d8cc84503e8260307a9fbf141a9635a1b798bffe5f24dbe2de88c6a62408b51fbed0a9826fa0a9716fafc22c0b3c63092a2a
7
+ data.tar.gz: d200903b0f20a6135c8603f831e454fdcdbc272bf646984ca733566e932fa2590fb89848d7776e1ae2ac7f37143966b18b489c73ec30c1b56e348dbf154435e7
data/CHANGES.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-05-26 v0.0.9
4
+
5
+ * Improved tag parsing in OllamaChat:
6
+ * Added regex validation for valid tags to `Documentrix::Utils::Tags`.
7
+ * Modified `parse_content` method in `OllamaChat::Parsing` to handle valid tag formats.
8
+ * Updated `scan` methods in `content` processing to more correctly identify tags.
9
+ * Added option to explicitly open socket for receiving input from `ollama_chat_send`:
10
+ * Added new command-line option `-S` to enable server socket functionality.
11
+ * Updated `OllamaChat::Chat` class to include server socket initialization based on the new option.
12
+ * Modified usage message in `README.md` and `information.rb` files.
13
+
3
14
  ## 2025-05-23 v0.0.8
4
15
 
5
16
  * Introduce `fix_config` method to rescue `ComplexConfig` exceptions and prompt
@@ -13,7 +24,7 @@
13
24
 
14
25
  ## 2025-05-22 v0.0.7
15
26
 
16
- * Added `ollama_chat_send` executable in `/bin`, required 'ollama_chat' gem,
27
+ * Added `ollama_chat_send` executable in `/bin`, required `ollama_chat` gem,
17
28
  sent user input to Ollama server via
18
29
  `OllamaChat::ServerSocket.send_to_server_socket` method and handled
19
30
  exceptions and exit with non-zero status code if an error occurs.
data/README.md CHANGED
@@ -31,6 +31,7 @@ Usage: ollama_chat [OPTIONS]
31
31
  -D DOCUMENT load document and add to embeddings collection (multiple)
32
32
  -M use (empty) MemoryCache for this chat session
33
33
  -E disable embeddings for this chat session
34
+ -S open a socket to receive input from ollama_chat_send
34
35
  -V display the current version number and quit
35
36
  -h this help
36
37
  ```
data/Rakefile CHANGED
@@ -31,7 +31,7 @@ GemHadar do
31
31
 
32
32
  dependency 'excon', '~> 1.0'
33
33
  dependency 'ollama-ruby', '~> 1.0'
34
- dependency 'documentrix', '~> 0.0'
34
+ dependency 'documentrix', '~> 0.0', '>= 0.0.2'
35
35
  dependency 'rss', '~> 0.3'
36
36
  dependency 'term-ansicolor', '~> 1.11'
37
37
  dependency 'redis', '~> 5.0'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -32,7 +32,7 @@ class OllamaChat::Chat
32
32
  include OllamaChat::ServerSocket
33
33
 
34
34
  def initialize(argv: ARGV.dup)
35
- @opts = go 'f:u:m:s:c:C:D:MEVh', argv
35
+ @opts = go 'f:u:m:s:c:C:D:MESVh', argv
36
36
  @opts[?h] and exit usage
37
37
  @opts[?V] and exit version
38
38
  @ollama_chat_config = OllamaChat::OllamaChatConfig.new(@opts[?f])
@@ -67,7 +67,7 @@ class OllamaChat::Chat
67
67
  @current_voice = config.voice.default
68
68
  @images = []
69
69
  init_chat_history
70
- init_server_socket
70
+ @opts[?S] and init_server_socket
71
71
  rescue ComplexConfig::AttributeMissing, ComplexConfig::ConfigurationSyntaxError => e
72
72
  fix_config(e)
73
73
  end
@@ -331,7 +331,7 @@ class OllamaChat::Chat
331
331
  content, tags = if parse_content
332
332
  parse_content(content, @images)
333
333
  else
334
- [ content, Documentrix::Utils::Tags.new ]
334
+ [ content, Documentrix::Utils::Tags.new(valid_tag: /\A#*([\w\]\[]+)/) ]
335
335
  end
336
336
 
337
337
  if embedding.on? && content
@@ -102,6 +102,7 @@ module OllamaChat::Information
102
102
  -D DOCUMENT load document and add to embeddings collection (multiple)
103
103
  -M use (empty) MemoryCache for this chat session
104
104
  -E disable embeddings for this chat session
105
+ -S open a socket to receive input from ollama_chat_send
105
106
  -V display the current version number and quit
106
107
  -h this help
107
108
 
@@ -113,10 +113,10 @@ module OllamaChat::Parsing
113
113
 
114
114
  def parse_content(content, images)
115
115
  images.clear
116
- tags = Documentrix::Utils::Tags.new
116
+ tags = Documentrix::Utils::Tags.new valid_tag: /\A#*([\w\]\[]+)/
117
117
 
118
118
  contents = [ content ]
119
- content.scan(%r((https?://\S+)|(#\S+)|(?:file://)?(\S*\/\S+))).each do |url, tag, file|
119
+ content.scan(%r((https?://\S+)|(?<![a-zA-Z\d])#+([\w\]\[]+)|(?:file://)?(\S*\/\S+))).each do |url, tag, file|
120
120
  case
121
121
  when tag
122
122
  tags.add(tag)
@@ -1,6 +1,6 @@
1
1
  module OllamaChat
2
2
  # OllamaChat version
3
- VERSION = '0.0.8'
3
+ VERSION = '0.0.9'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/ollama_chat.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama_chat 0.0.8 ruby lib
2
+ # stub: ollama_chat 0.0.9 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama_chat".freeze
6
- s.version = "0.0.8".freeze
6
+ s.version = "0.0.9".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
34
34
  s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
35
35
  s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.0".freeze])
36
- s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze])
36
+ s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze, ">= 0.0.2".freeze])
37
37
  s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
38
38
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
39
39
  s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ollama_chat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -142,6 +142,9 @@ dependencies:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0.0'
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: 0.0.2
145
148
  type: :runtime
146
149
  prerelease: false
147
150
  version_requirements: !ruby/object:Gem::Requirement
@@ -149,6 +152,9 @@ dependencies:
149
152
  - - "~>"
150
153
  - !ruby/object:Gem::Version
151
154
  version: '0.0'
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: 0.0.2
152
158
  - !ruby/object:Gem::Dependency
153
159
  name: rss
154
160
  requirement: !ruby/object:Gem::Requirement