ollama-ai 1.2.0 → 1.2.1
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
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -7
- data/README.md +5 -4
- data/controllers/client.rb +9 -3
- data/static/gem.rb +1 -1
- data/template.md +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b2cbe0dd2d75850aea0dddf66463e295dc3941205d66bbd5abbb1c8590fc8a7
|
4
|
+
data.tar.gz: 802c5423e24119488d9112726704e056bbed29c70c0c98247dd89a757fdefaaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acaa09929dfd956842f026ff504cfc6cc3213c7ae829a39a901a6302b9a45694e23795698375e25f0773780275811575dc5f6eef8b22d940849d9fdf855c4bf2
|
7
|
+
data.tar.gz: bd2758a1306d2a1a44b67c4662cb029f403100b3c2a34f44925d1d6b1bb514b2015154b004035927a5320ef9e137959d872d2f5361e13e6d8fd5767182ced122
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ollama-ai (1.2.
|
4
|
+
ollama-ai (1.2.1)
|
5
5
|
faraday (~> 2.9)
|
6
6
|
faraday-typhoeus (~> 1.1)
|
7
7
|
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
faraday (~> 2.0)
|
22
22
|
typhoeus (~> 1.4)
|
23
23
|
ffi (1.16.3)
|
24
|
-
json (2.7.
|
24
|
+
json (2.7.2)
|
25
25
|
language_server-protocol (3.17.0.3)
|
26
26
|
method_source (1.0.0)
|
27
27
|
net-http (0.4.1)
|
@@ -40,7 +40,7 @@ GEM
|
|
40
40
|
rainbow (3.1.1)
|
41
41
|
regexp_parser (2.9.0)
|
42
42
|
rexml (3.2.6)
|
43
|
-
rubocop (1.
|
43
|
+
rubocop (1.63.1)
|
44
44
|
json (~> 2.3)
|
45
45
|
language_server-protocol (>= 3.17.0)
|
46
46
|
parallel (~> 1.10)
|
@@ -48,11 +48,11 @@ GEM
|
|
48
48
|
rainbow (>= 2.2.2, < 4.0)
|
49
49
|
regexp_parser (>= 1.8, < 3.0)
|
50
50
|
rexml (>= 3.2.5, < 4.0)
|
51
|
-
rubocop-ast (>= 1.
|
51
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
52
52
|
ruby-progressbar (~> 1.7)
|
53
53
|
unicode-display_width (>= 2.4.0, < 3.0)
|
54
|
-
rubocop-ast (1.
|
55
|
-
parser (>= 3.
|
54
|
+
rubocop-ast (1.31.2)
|
55
|
+
parser (>= 3.3.0.4)
|
56
56
|
ruby-progressbar (1.13.0)
|
57
57
|
typhoeus (1.4.1)
|
58
58
|
ethon (>= 0.9.0)
|
@@ -65,7 +65,7 @@ PLATFORMS
|
|
65
65
|
DEPENDENCIES
|
66
66
|
ollama-ai!
|
67
67
|
pry-byebug (~> 3.10, >= 3.10.1)
|
68
|
-
rubocop (~> 1.
|
68
|
+
rubocop (~> 1.63, >= 1.63.1)
|
69
69
|
|
70
70
|
BUNDLED WITH
|
71
71
|
2.4.22
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ A Ruby gem for interacting with [Ollama](https://ollama.ai)'s API that allows yo
|
|
9
9
|
## TL;DR and Quick Start
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'ollama-ai', '~> 1.2.
|
12
|
+
gem 'ollama-ai', '~> 1.2.1'
|
13
13
|
```
|
14
14
|
|
15
15
|
```ruby
|
@@ -105,11 +105,11 @@ Result:
|
|
105
105
|
### Installing
|
106
106
|
|
107
107
|
```sh
|
108
|
-
gem install ollama-ai -v 1.2.
|
108
|
+
gem install ollama-ai -v 1.2.1
|
109
109
|
```
|
110
110
|
|
111
111
|
```sh
|
112
|
-
gem 'ollama-ai', '~> 1.2.
|
112
|
+
gem 'ollama-ai', '~> 1.2.1'
|
113
113
|
```
|
114
114
|
|
115
115
|
## Usage
|
@@ -871,6 +871,7 @@ bundle
|
|
871
871
|
rubocop -A
|
872
872
|
|
873
873
|
bundle exec ruby spec/tasks/run-client.rb
|
874
|
+
bundle exec ruby spec/tasks/test-encoding.rb
|
874
875
|
```
|
875
876
|
|
876
877
|
### Purpose
|
@@ -884,7 +885,7 @@ gem build ollama-ai.gemspec
|
|
884
885
|
|
885
886
|
gem signin
|
886
887
|
|
887
|
-
gem push ollama-ai-1.2.
|
888
|
+
gem push ollama-ai-1.2.1.gem
|
888
889
|
```
|
889
890
|
|
890
891
|
### Updating the README
|
data/controllers/client.rb
CHANGED
@@ -92,7 +92,7 @@ module Ollama
|
|
92
92
|
|
93
93
|
method_to_call = request_method.to_s.strip.downcase.to_sym
|
94
94
|
|
95
|
-
partial_json = ''
|
95
|
+
partial_json = String.new.force_encoding('UTF-8')
|
96
96
|
|
97
97
|
response = Faraday.new(request: @request_options) do |faraday|
|
98
98
|
faraday.adapter @faraday_adapter
|
@@ -110,7 +110,13 @@ module Ollama
|
|
110
110
|
raise_error.on_complete(env.merge(body: chunk))
|
111
111
|
end
|
112
112
|
|
113
|
-
|
113
|
+
utf8_chunk = chunk.force_encoding('UTF-8')
|
114
|
+
|
115
|
+
partial_json += if utf8_chunk.valid_encoding?
|
116
|
+
utf8_chunk
|
117
|
+
else
|
118
|
+
utf8_chunk.encode('UTF-8', invalid: :replace, undef: :replace)
|
119
|
+
end
|
114
120
|
|
115
121
|
parsed_json = safe_parse_json(partial_json)
|
116
122
|
|
@@ -121,7 +127,7 @@ module Ollama
|
|
121
127
|
|
122
128
|
results << result
|
123
129
|
|
124
|
-
partial_json = ''
|
130
|
+
partial_json = String.new.force_encoding('UTF-8')
|
125
131
|
end
|
126
132
|
end
|
127
133
|
end
|
data/static/gem.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Ollama
|
4
4
|
GEM = {
|
5
5
|
name: 'ollama-ai',
|
6
|
-
version: '1.2.
|
6
|
+
version: '1.2.1',
|
7
7
|
author: 'gbaptista',
|
8
8
|
summary: 'Interact with Ollama API to run open source AI models locally.',
|
9
9
|
description: "A Ruby gem for interacting with Ollama's API that allows you to run open source AI LLMs (Large Language Models) locally.",
|
data/template.md
CHANGED
@@ -9,7 +9,7 @@ A Ruby gem for interacting with [Ollama](https://ollama.ai)'s API that allows yo
|
|
9
9
|
## TL;DR and Quick Start
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'ollama-ai', '~> 1.2.
|
12
|
+
gem 'ollama-ai', '~> 1.2.1'
|
13
13
|
```
|
14
14
|
|
15
15
|
```ruby
|
@@ -66,11 +66,11 @@ Result:
|
|
66
66
|
### Installing
|
67
67
|
|
68
68
|
```sh
|
69
|
-
gem install ollama-ai -v 1.2.
|
69
|
+
gem install ollama-ai -v 1.2.1
|
70
70
|
```
|
71
71
|
|
72
72
|
```sh
|
73
|
-
gem 'ollama-ai', '~> 1.2.
|
73
|
+
gem 'ollama-ai', '~> 1.2.1'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Usage
|
@@ -832,6 +832,7 @@ bundle
|
|
832
832
|
rubocop -A
|
833
833
|
|
834
834
|
bundle exec ruby spec/tasks/run-client.rb
|
835
|
+
bundle exec ruby spec/tasks/test-encoding.rb
|
835
836
|
```
|
836
837
|
|
837
838
|
### Purpose
|
@@ -845,7 +846,7 @@ gem build ollama-ai.gemspec
|
|
845
846
|
|
846
847
|
gem signin
|
847
848
|
|
848
|
-
gem push ollama-ai-1.2.
|
849
|
+
gem push ollama-ai-1.2.1.gem
|
849
850
|
```
|
850
851
|
|
851
852
|
### Updating the README
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ollama-ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gbaptista
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|