foobara-ai 0.0.5 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac867a51c46b2b89c3dc90dba0584d0c78d9a3aa480a249cd45828abb5baccc5
4
- data.tar.gz: c727dff343804bafbb0a300274a80780b4717e89e98441f77ba1aa3516c392fd
3
+ metadata.gz: 719ee8692eed22e62bd0e301ca5f1e4727589a1fd72e560d25426c690cb9f22d
4
+ data.tar.gz: 25e9e0949d1dc59756d91356a0d7ff5f1c82a16bb4e4103a16233dd53257af63
5
5
  SHA512:
6
- metadata.gz: 7f6af8aa55bcfdd3b289729e7c31dbb3e2fb5a35cb11d05c9cf633e9d985d015d0f8ae080deec313bdfc85fc1f33111de15052e1175bb6f09922e6b734474be7
7
- data.tar.gz: e3034cc9ff62eaafe2d12a9ce7a148e1389d001363c3050937f656b2d8720c4492a48e2d36df10a001a3ad2003948cbb301fd06707f798090af2f81dfb56142a
6
+ metadata.gz: 59d758c93295a8b88a27cbb53c3b2931b2e4aa5dc6dc6d697a8d08f4f0a351619a37cb341ab082db4e670a760d479e30cdc10ee4e09cd45e2799404cc4d89d44
7
+ data.tar.gz: 99ebe34989602702326edb2680fa7b1755d2092ca6be63b2b2e35bec9739634aefafb8e574f8cc832f3590a2b92444902b7d3aff5525e45fc16744779703909d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## [0.0.5] - 2025-03-04
1
+ ## [0.0.6] - 2025-03-04
2
2
 
3
3
  - Do not require all 3 services to function. Let user require which services they want to use.
4
4
 
data/lib/foobara/ai.rb CHANGED
@@ -7,10 +7,7 @@ module Foobara
7
7
  module AnswerBot
8
8
  foobara_domain!
9
9
 
10
- base_dir = "#{__dir__}/../../src/foobara/ai/answer_bot"
11
- Util.require_directory "#{base_dir}/types"
12
- Dir["#{base_dir}/domain_mappers/*.rb"].each { |f| require f }
13
- Dir["#{base_dir}/*.rb"].each { |f| require f }
10
+ require_relative "../../src/foobara/ai/answer_bot/types/service_enum"
14
11
 
15
12
  ai_services = {}
16
13
 
@@ -26,12 +23,19 @@ module Foobara
26
23
 
27
24
  ai_services[service] = domain
28
25
  foobara_depends_on domain
29
-
30
- path = Util.underscore(domain.foobara_domain_name)
31
- Util.require_directory "#{__dir__}/../../src/foobara/ai/answer_bot/domain_mappers/#{path}"
32
26
  end
33
27
 
34
28
  AI_SERVICES = ai_services
29
+
30
+ base_dir = "#{__dir__}/../../src/foobara/ai/answer_bot"
31
+ Util.require_directory "#{base_dir}/types"
32
+ Dir["#{base_dir}/domain_mappers/*.rb"].each { |f| require f }
33
+ Dir["#{base_dir}/*.rb"].each { |f| require f }
34
+
35
+ AI_SERVICES.each_value do |domain|
36
+ path = Util.underscore(domain.foobara_domain_name)
37
+ Util.require_directory "#{base_dir}/domain_mappers/#{path}"
38
+ end
35
39
  end
36
40
  end
37
41
  end
@@ -1,3 +1,4 @@
1
+ require_relative "types/service_enum"
1
2
  require_relative "types/model"
2
3
 
3
4
  module Foobara
@@ -8,11 +9,13 @@ module Foobara
8
9
 
9
10
  result [Types::Model]
10
11
 
11
- LIST_COMMANDS = [
12
- OpenAiApi::ListModels,
13
- AnthropicApi::ListModels,
14
- OllamaApi::ListLocalModels
15
- ].freeze
12
+ LIST_COMMANDS = AI_SERVICES.values.map do |domain|
13
+ if domain == OllamaApi
14
+ OllamaApi::ListLocalModels
15
+ else
16
+ domain::ListModels
17
+ end
18
+ end
16
19
 
17
20
  depends_on(*LIST_COMMANDS)
18
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi