async-ollama 0.10.0 → 0.10.2

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: b056f00255624f62489fbe6c06a2f2c9a5ec520293b647d0420cff3624b65249
4
- data.tar.gz: d3e1ab3b0e78a4c5886e039cc5f81c9e25a89a56f91125e169c9e3c9009187aa
3
+ metadata.gz: 0f16f64be2b118708e2f1808a37afcaa31ed2d7b95deb0e24f7580388cfb3624
4
+ data.tar.gz: 252a6cff80cbefc42d84c5c8f2280b56b301e70560075f76fd2a3fa9dd7b6d57
5
5
  SHA512:
6
- metadata.gz: 8f7fde1e4f5a3a8a6b5d7b39c494a58a97287fff397d909e3d87b2e77b6ef29f1f9a407ca20adfb480757cf08545360161e73fa86fd932b9cf62fdfd07c049ca
7
- data.tar.gz: '06974289477bb32e452b89c4ccdcb9122de141216c422c3139ec7402c31cbdd9c5d63aff6ba4d915bff81494dc56e984bc910cc1cb745890d8e8e0b51be6b08f'
6
+ metadata.gz: 61d4eea73fcd4fd4b53d6d5566a38b6b0e8fcccfdb07936a807f1432b0947e537477c24861bdc08323e438181cc522222c39a460799465328147e291c981743a
7
+ data.tar.gz: 811fe2ac77bd17fd323192834f4a76d1f091aac8238d253d7268ee7b713482bd1e67172b51c74b85bc798c7588951e92ea7f72955efce6ef0fc85450044caebd
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024-2025, by Samuel Williams.
4
+ # Copyright, 2024-2026, by Samuel Williams.
5
5
 
6
6
  require "async/rest/resource"
7
7
 
@@ -23,9 +23,8 @@ module Async
23
23
  SYSTEM_PROMPT = <<~PROMPT
24
24
  You are a precise file transformation tool.
25
25
  When given a file and instructions, you output ONLY the transformed file content.
26
- Do not add any explanation, preamble, summary of changes.
26
+ Do not add any explanation, preamble, summary of changes or code fences.
27
27
  Output the raw file content exactly as it should be executed.
28
- Do not include markdown code fences in your output.
29
28
  Preserve all existing content unless the instructions explicitly require removal.
30
29
  If a reference template is provided, use it as a structural guide for what to add or how to format new content — do not copy it verbatim or replace existing content with it.
31
30
  PROMPT
@@ -50,7 +49,7 @@ module Async
50
49
  Client.open do |client|
51
50
  reply = client.chat(messages, model: model)
52
51
 
53
- return strip_fences(reply.response)
52
+ self.strip_fences(content, reply.response)
54
53
  end
55
54
  end
56
55
 
@@ -65,15 +64,24 @@ module Async
65
64
 
66
65
  private
67
66
 
68
- def strip_fences(content)
67
+ def strip_fences(original, content)
69
68
  content = content.strip
70
69
 
71
70
  # Models frequently wrap output in code fences despite being instructed not to:
72
- if match = content.match(/\A```\w*\n(.*\n)```\z/m)
73
- Console.warn(self, "Stripping markdown code fences from model output.")
71
+ if match = content.match(/\A```\w*\n(.*?)\n```\z/m)
74
72
  content = match[1]
73
+ elsif match = content.match(/(.*?)\n```\z/m)
74
+ unless original.match(/```\s*\z/m)
75
+ content = match[1]
76
+ end
75
77
  end
76
78
 
79
+ unless content.end_with?("\n")
80
+ content += "\n"
81
+ end
82
+
83
+ puts content.inspect
84
+
77
85
  return content
78
86
  end
79
87
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Ollama
8
- VERSION = "0.10.0"
8
+ VERSION = "0.10.2"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -39,6 +39,22 @@ We welcome contributions to this project.
39
39
  4. Push to the branch (`git push origin my-new-feature`).
40
40
  5. Create new Pull Request.
41
41
 
42
+ ### Running Tests
43
+
44
+ To run the test suite:
45
+
46
+ ``` shell
47
+ bundle exec sus
48
+ ```
49
+
50
+ ### Making Releases
51
+
52
+ To make a new release:
53
+
54
+ ``` shell
55
+ bundle exec bake gem:release:patch # or minor or major
56
+ ```
57
+
42
58
  ### Developer Certificate of Origin
43
59
 
44
60
  In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-ollama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 4.0.3
108
+ rubygems_version: 4.0.6
109
109
  specification_version: 4
110
110
  summary: A asynchronous interface to the ollama chat service
111
111
  test_files: []
metadata.gz.sig CHANGED
Binary file