llm_specs 0.1.4 → 0.1.6
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/lib/llm_specs/cache.rb +2 -4
- data/lib/llm_specs/catalog.rb +7 -3
- data/lib/llm_specs/errors.rb +0 -8
- data/lib/llm_specs/version.rb +1 -1
- data/lib/llm_specs.rb +0 -1
- metadata +1 -2
- data/models.json +0 -4031
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df786191fe1da5692c4400ec79daea67b246421a0644ffefd4da3d74922ddc9b
|
4
|
+
data.tar.gz: 3b94ed5743d47eefc64ca36588de03aa2b74b20ecbb2cad711d47ef145d010d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1b0d63b025a623332540715e48ea5abe9afd5d522146c622f5721b13ee5dfa27aae060a2025136a303f50311894a3c8ed6467eca8128353f3ff3afd3d7c95ae
|
7
|
+
data.tar.gz: 2407bcb8f920e87a6376558e95c2e8235248df624b7f4ae0abc7220aed342c1dfd3376166b5b4e24503ba2a66ec968ea03230be38674e656d398b563dab328dd
|
data/lib/llm_specs/cache.rb
CHANGED
@@ -8,9 +8,7 @@ module LLMSpecs
|
|
8
8
|
|
9
9
|
def fetch
|
10
10
|
return read if valid?
|
11
|
-
|
12
|
-
write(data)
|
13
|
-
data
|
11
|
+
yield.tap { write(it) }
|
14
12
|
end
|
15
13
|
|
16
14
|
def valid?
|
@@ -22,7 +20,7 @@ module LLMSpecs
|
|
22
20
|
end
|
23
21
|
|
24
22
|
def write(data)
|
25
|
-
File.write(@file, JSON.pretty_generate(data))
|
23
|
+
File.write(@file, JSON.pretty_generate(data)) if data
|
26
24
|
end
|
27
25
|
end
|
28
26
|
end
|
data/lib/llm_specs/catalog.rb
CHANGED
@@ -14,10 +14,14 @@ module LLMSpecs
|
|
14
14
|
|
15
15
|
def fetch
|
16
16
|
@cache.fetch do
|
17
|
-
|
18
|
-
raise FetchError.new(response) unless response.is_a? Net::HTTPSuccess
|
19
|
-
JSON.parse(response.body, symbolize_names: true)
|
17
|
+
parse Net::HTTP.get_response(@uri).tap(&:value) # raises Net::HTTPError if not 2xx
|
20
18
|
end
|
21
19
|
end
|
20
|
+
|
21
|
+
def parse(response)
|
22
|
+
JSON.parse(response.body, symbolize_names: true)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
26
|
+
|
27
|
+
|
data/lib/llm_specs/errors.rb
CHANGED
@@ -5,12 +5,4 @@ module LLMSpecs
|
|
5
5
|
super("Couldn't find model with id='#{id}'")
|
6
6
|
end
|
7
7
|
end
|
8
|
-
|
9
|
-
class FetchError < StandardError
|
10
|
-
attr_reader :response
|
11
|
-
def initialize(response)
|
12
|
-
@response = response
|
13
|
-
super("HTTP fetch failed (status: #{response.status})")
|
14
|
-
end
|
15
|
-
end
|
16
8
|
end
|
data/lib/llm_specs/version.rb
CHANGED
data/lib/llm_specs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llm_specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Power
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/llm_specs/errors.rb
|
44
44
|
- lib/llm_specs/model.rb
|
45
45
|
- lib/llm_specs/version.rb
|
46
|
-
- models.json
|
47
46
|
- sig/llm_specs.rbs
|
48
47
|
homepage: https://github.com/max-power/llm_specs
|
49
48
|
licenses:
|