ai_client 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@
5
5
  # a valid API Key for the open_router.ai web-service
6
6
 
7
7
  require 'open_router'
8
+ require 'yaml'
8
9
 
9
10
  class AiClient
10
11
 
@@ -28,8 +29,8 @@ class AiClient
28
29
  @orc_client ||= add_open_router_extensions || raise("OpenRouter extensions are not available")
29
30
  end
30
31
 
31
- def models
32
- @models ||= orc_client.models
32
+ def orc_models
33
+ @orc_models ||= orc_client.models
33
34
  end
34
35
 
35
36
  # TODO: Refactor these DB like methods to take
@@ -55,6 +56,12 @@ class AiClient
55
56
  model_names.select{ _1.include?(a_model_substring) }
56
57
  end
57
58
 
59
+ def reset_llm_data
60
+ LLM.data = orc_models
61
+ LLM::DATA_PATH.write(orc_models.to_yaml)
62
+ end
63
+
64
+
58
65
  private
59
66
 
60
67
  # Similar to fetch_api_key but for the class_config
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AiClient
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.8.3
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 1.8.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: open_router
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -228,6 +228,7 @@ files:
228
228
  - lib/ai_client/llm.rb
229
229
  - lib/ai_client/logger_middleware.rb
230
230
  - lib/ai_client/middleware.rb
231
+ - lib/ai_client/models.yml
231
232
  - lib/ai_client/open_router_extensions.rb
232
233
  - lib/ai_client/retry_middleware.rb
233
234
  - lib/ai_client/speak.rb