async-ollama 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/ollama/client.rb +6 -0
- data/lib/async/ollama/models.rb +17 -0
- data/lib/async/ollama/version.rb +1 -1
- data/lib/async/ollama/wrapper.rb +4 -1
- data.tar.gz.sig +0 -0
- metadata +4 -3
- 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: b063f95dd3bfc375203e52136932e15e7fdb060c5e8c2c88714285679d4ed535
|
4
|
+
data.tar.gz: a431d19a4817acf9d77ab225f22dfe523d0e04826f4ad87e615bd7c6d22d20f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac83698f0c120ede1b595509da72e83ab81faffe50bed02e3aebf01e5b66579699d2329fbdaff0e0f087813677fc6f338029bccda9d62d0ed6726c26586e9973
|
7
|
+
data.tar.gz: 148408b29f5aafd3ce3d71c5ecd3f2eadbd496736893049e01701e52e214188912725a3ba13245b261d5c02e159725a29998493e7739aed6f8e0e0a08db0ad4b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/ollama/client.rb
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
# Copyright, 2024, by Samuel Williams.
|
5
5
|
|
6
6
|
require "async/rest/resource"
|
7
|
+
|
7
8
|
require_relative "generate"
|
9
|
+
require_relative "models"
|
8
10
|
|
9
11
|
module Async
|
10
12
|
module Ollama
|
@@ -27,6 +29,10 @@ module Async
|
|
27
29
|
Generate.new(resource, value: response.read, metadata: response.headers)
|
28
30
|
end
|
29
31
|
end
|
32
|
+
|
33
|
+
def models
|
34
|
+
Models.get(self.with(path: "/api/tags"))
|
35
|
+
end
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2024, by Samuel Williams.
|
5
|
+
|
6
|
+
require "async/rest/representation"
|
7
|
+
require_relative "wrapper"
|
8
|
+
|
9
|
+
module Async
|
10
|
+
module Ollama
|
11
|
+
class Models < Async::REST::Representation[Wrapper]
|
12
|
+
def names
|
13
|
+
self.value[:models].map{|model| model[:name]}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/async/ollama/version.rb
CHANGED
data/lib/async/ollama/wrapper.rb
CHANGED
@@ -85,7 +85,10 @@ module Async
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def parser_for(response)
|
88
|
-
|
88
|
+
content_type = response.headers["content-type"]
|
89
|
+
media_type = content_type.split(";").first
|
90
|
+
|
91
|
+
case media_type
|
89
92
|
when APPLICATION_JSON
|
90
93
|
return Async::REST::Wrapper::JSON::Parser
|
91
94
|
when APPLICATION_JSON_STREAM
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-
|
40
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/async/ollama.rb
|
77
77
|
- lib/async/ollama/client.rb
|
78
78
|
- lib/async/ollama/generate.rb
|
79
|
+
- lib/async/ollama/models.rb
|
79
80
|
- lib/async/ollama/version.rb
|
80
81
|
- lib/async/ollama/wrapper.rb
|
81
82
|
- license.md
|
@@ -101,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
102
|
- !ruby/object:Gem::Version
|
102
103
|
version: '0'
|
103
104
|
requirements: []
|
104
|
-
rubygems_version: 3.5.
|
105
|
+
rubygems_version: 3.5.22
|
105
106
|
signing_key:
|
106
107
|
specification_version: 4
|
107
108
|
summary: A asynchronous interface to the ollama chat service
|
metadata.gz.sig
CHANGED
Binary file
|