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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/ai_client/config.yml +1 -1
- data/lib/ai_client/configuration.rb +5 -0
- data/lib/ai_client/llm.rb +10 -13
- data/lib/ai_client/models.yml +4839 -0
- data/lib/ai_client/open_router_extensions.rb +9 -2
- data/lib/ai_client/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b12150b0f3f29804d520aa319a99cc71adc96f023ec99bccc0a9a6682bdba6e
|
4
|
+
data.tar.gz: 59d811a6b9de974f76672a9a1386d6efd3e4547d53ae7b4d24c532a250c00c86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0beacebae38d5c2101498a59245c5112469ff8fddda2723b5d916ae6d5f731fa6e9e55de46422a6daf463242356e1575c0bbdf77612f9edf9fd05d6b4f885407
|
7
|
+
data.tar.gz: 36b2b5f5fd3d51577b31ac8cbcd57980cb7d0a912428f37e8f345764620aa02198a65b905505136ea40ea2866e274b1f8d6b9b1c9390ccd3608eaad138c37ebb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
3
|
## Released
|
4
|
+
### [0.2.4] - 2024-10-10
|
5
|
+
- constrained gem omniai-openai to version 1.8.3+ for access to open_router.ai
|
6
|
+
- caching models database from open_router.ai
|
7
|
+
- added class methods reset_default_config and reset_llm_data
|
8
|
+
- support for open_router.ai should be fully integrated now that omniai-openai is at version 1.8.3
|
9
|
+
|
10
|
+
|
4
11
|
### [0.2.3] - 2024-10-08
|
5
12
|
- refactored the OmniAI extensions for Ollama, LocalAI and OpenRouter
|
6
13
|
- added a file for OpenRouter extensions
|
data/lib/ai_client/config.yml
CHANGED
data/lib/ai_client/llm.rb
CHANGED
@@ -1,26 +1,23 @@
|
|
1
1
|
# lib/ai_client/llm.rb
|
2
2
|
|
3
3
|
require 'active_hash'
|
4
|
+
require 'yaml'
|
4
5
|
|
5
|
-
class AiClient
|
6
|
-
|
7
|
-
# TODO: Think about this for the OpenRouter modesl DB
|
8
|
-
# Might cahnge this to ActiveYaml
|
9
6
|
|
7
|
+
class AiClient
|
10
8
|
class LLM < ActiveHash::Base
|
11
|
-
|
9
|
+
DATA_PATH = Pathname.new( __dir__ + '/models.yml')
|
10
|
+
self.data = YAML.parse(DATA_PATH.read).to_ruby
|
12
11
|
|
13
12
|
def model = id.split('/')[1]
|
14
13
|
def provider = id.split('/')[0]
|
14
|
+
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
def export(path_to_uml_file) # TODO: Dump
|
22
|
-
raise "TODO: Not Implemented: #{path_to_yml_file}"
|
23
|
-
end
|
16
|
+
class << self
|
17
|
+
def reset_llm_data
|
18
|
+
orc_models = AiClient.orc_client.models
|
19
|
+
AiClient::LLM.data = orc_models
|
20
|
+
AiClient::LLM::DATA_PATH.write(orc_models.to_yaml)
|
24
21
|
end
|
25
22
|
end
|
26
23
|
end
|