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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/ollama/client.rb +1 -1
- data/lib/async/ollama/transform.rb +14 -6
- data/lib/async/ollama/version.rb +1 -1
- data/readme.md +16 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f16f64be2b118708e2f1808a37afcaa31ed2d7b95deb0e24f7580388cfb3624
|
|
4
|
+
data.tar.gz: 252a6cff80cbefc42d84c5c8f2280b56b301e70560075f76fd2a3fa9dd7b6d57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61d4eea73fcd4fd4b53d6d5566a38b6b0e8fcccfdb07936a807f1432b0947e537477c24861bdc08323e438181cc522222c39a460799465328147e291c981743a
|
|
7
|
+
data.tar.gz: 811fe2ac77bd17fd323192834f4a76d1f091aac8238d253d7268ee7b713482bd1e67172b51c74b85bc798c7588951e92ea7f72955efce6ef0fc85450044caebd
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/async/ollama/client.rb
CHANGED
|
@@ -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
|
-
|
|
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(
|
|
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
|
|
data/lib/async/ollama/version.rb
CHANGED
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.
|
|
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.
|
|
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
|