llm_specs 0.2.3 → 0.2.5

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: d4126e322ed9ddf2308743fd52c9f7f89fbe0b8a10b6e0544239ae2d9263b09d
4
- data.tar.gz: 63f1ca60bc8b47b9f44e36f55c5a2689807f00be6b9fc10c2c660ea23c93faa1
3
+ metadata.gz: b6b6732cff5f8db0347ee4a2ed1bf43c4981c70c04f9a2ed9f5ff59ec4055685
4
+ data.tar.gz: bba0fdccda578ebd1cded497a4a083a5242c2d423896ee65a157f47599577178
5
5
  SHA512:
6
- metadata.gz: 688f25a8ac8e0b0ad898599c2c5828673f54adcec5e7a48218df64cda0a858d1c5b7607d06d13f3a27be10ae995f9d6e45df9ea5d0023d666870d9ffe09601aa
7
- data.tar.gz: 51b64c28c7a0df534a8fca27b98df54087b636f98d198d076f0ec2ef819872d4899dd050b7dfcd95b0998002be52ff5c88304e1936512b92d475a97ab9924ccd
6
+ metadata.gz: e2cfa31b8f64598e7137aaa755e124e7a6b451e2f7abc934eabece9ee68d72ca6af9c29f16aa0dff9ee65cd5bc17dc21482c88b93ae13c98ea1555d3bf511e94
7
+ data.tar.gz: fda0105ebf561c455d7ded186c8dab14bc2d8373a4a1eeb3e0e59ccd0bc0a31858dc86efebdb25052e65c3d0f5e479d2fb99e9ab4fe3e054abd8a1255a6cb8cb
data/README.md CHANGED
@@ -23,7 +23,7 @@ models = LLMSpecs.anthropic
23
23
  models = LLMSpecs.openai
24
24
  models = LLMSpecs.deepseek
25
25
 
26
- providers = LLMSpecs.providers # a list of all providers covers by Parsera API
26
+ providers = LLMSpecs.providers # a list of all providers covered by Parsera API
27
27
  ```
28
28
 
29
29
  ### Find a model by ID
@@ -0,0 +1,18 @@
1
+ #require "activesupport/lib/active_support/core_ext/class/attribute"
2
+ module LLMSpecs
3
+ def self.use_relative_model_naming? = true
4
+
5
+ class Model
6
+ module ActiveModelCompliance
7
+ def persisted? = true
8
+ def errors = Hash.new { |h,k| h[k] = [] }
9
+ def to_model = self
10
+ def to_key = [id]
11
+ def to_param = id
12
+ def to_partial_path = "models/model"
13
+ end
14
+
15
+ extend ActiveModel::Naming
16
+ include ActiveModelCompliance
17
+ end
18
+ end
@@ -12,11 +12,11 @@ module LLMSpecs
12
12
  end
13
13
 
14
14
  def read
15
- File.read(@file)
15
+ File.read(@file) if exist?
16
16
  end
17
17
 
18
18
  def write(data)
19
- File.write(@file, data)
19
+ File.write(@file, data, mode: "wb")
20
20
  end
21
21
 
22
22
  def valid?
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module LLMSpecs
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.5"
4
4
  end
data/lib/llm_specs.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
  require "json"
3
3
  require "net/http"
4
+ require_relative "llm_specs/version"
4
5
  require_relative "llm_specs/errors"
5
6
  require_relative "llm_specs/cache"
6
7
  require_relative "llm_specs/catalog"
7
8
  require_relative "llm_specs/collection"
8
9
  require_relative "llm_specs/model"
10
+ require_relative "llm_specs/active_model" if defined?(ActiveModel)
9
11
 
10
12
  module LLMSpecs
11
13
  API_URI = "https://api.parsera.org/v1/llm-specs"
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.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Power
@@ -37,6 +37,7 @@ files:
37
37
  - README.md
38
38
  - Rakefile
39
39
  - lib/llm_specs.rb
40
+ - lib/llm_specs/active_model.rb
40
41
  - lib/llm_specs/cache.rb
41
42
  - lib/llm_specs/catalog.rb
42
43
  - lib/llm_specs/collection.rb