foobara-ai 0.0.10 → 0.0.12

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: c4bf17d2f511bc0aece906ac724c2a9e11d4f103891e845474caa8f5ee865cde
4
- data.tar.gz: 0f82b4935e9b7a8ce9f666503dd185cc9bac822b1672e320a6ffae8642ec40be
3
+ metadata.gz: a43321389b2cc813a204d4f7340b75c8a7c7bdd131220fae16682602258caab9
4
+ data.tar.gz: f5cf356dc3f0411bf0e2ffb50772828ed3cd8f729552ca16d385c55f01a00e83
5
5
  SHA512:
6
- metadata.gz: 0efa6dc579de37f2a4ee9cdd396e9f0c3e3157293b7464ca279ad754ce990cdf1b240cd5ae2cb95389fdfdc094c32af0e417cdd23d1667bf41459f7ee3c833d9
7
- data.tar.gz: b0ac2c1ac18eae8c25b406d7ffe734c67cfd945bec1f76b2223595d57d81ce94976116c921526938749e39ecd15223a0b0c837679ca7fafc65a322b48ca6f2cc
6
+ metadata.gz: 672cac03fe0c5b0ac8f2dfa2182f37ebdd1399a71721994f2699a9f54cc3a75522cfa8dcdea03442569fdecd4df7cc6b1e040fda1d62720ddd8c8fd1ccfa2c19
7
+ data.tar.gz: 16364632be158b69c7ae22d48b0d98b1bd1c3c88aad2e2b57a648b2bd5d2b8185fe866302280c769bfee0fb20bebe3edb0c25fc7ec6c9c1dba6da504e5a00f08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.0.12] - 2025-05-27
2
+
3
+ - Do not load service models in parallel due to undiagnosed race condition somewhere
4
+
5
+ ## [0.0.11] - 2025-03-06
6
+
7
+ - Fix bug that broke ListModels
8
+ - Change default model to Claude 3.7
9
+
1
10
  ## [0.0.10] - 2025-03-05
2
11
 
3
12
  - Do not require all 3 services to function. Let user require which services they want to use.
data/lib/foobara/ai.rb CHANGED
@@ -21,6 +21,13 @@ module Foobara
21
21
  ai_services[Types::ServiceEnum::OLLAMA] = OllamaApi
22
22
  end
23
23
 
24
+ if ai_services.empty?
25
+ # :nocov:
26
+ require "foobara/anthropic_api"
27
+ ai_services = { Types::ServiceEnum::ANTHROPIC => AnthropicApi }
28
+ # :nocov:
29
+ end
30
+
24
31
  ai_services.each_value do |domain|
25
32
  foobara_depends_on domain
26
33
  end
@@ -8,7 +8,7 @@ module Foobara
8
8
  question :string, :required, "whatever you want to know!"
9
9
  instructions :string, "Results in a system prompt. You can specify how you want the LLM to behave."
10
10
  service :service_enum, "If two services expose the same model, you can specify which one to use."
11
- model :model_enum, default: "gpt-3.5-turbo", description: "The model to use."
11
+ model :model_enum, default: "claude-3-7-sonnet-20250219", description: "The model to use."
12
12
  end
13
13
 
14
14
  result :string
@@ -10,7 +10,7 @@ module Foobara
10
10
  result [Types::Model]
11
11
 
12
12
  LIST_COMMANDS = AI_SERVICES.keys.map do |service|
13
- Foobara::Ai::AnswerBot::DomainMappers::ServiceToChatCompletionCommand.map!(service)
13
+ Foobara::Ai::AnswerBot::DomainMappers::ServiceToListModelsCommand.map!(service)
14
14
  end
15
15
 
16
16
  depends_on(*LIST_COMMANDS)
@@ -5,16 +5,27 @@ module Foobara
5
5
  module Ai
6
6
  module AnswerBot
7
7
  module Types
8
- threads = AI_SERVICES.keys.map do |service|
9
- Thread.new do
10
- service_models = AnswerBot.foobara_domain_map!(service).run!
11
- service_models.map do |model|
12
- AnswerBot.foobara_domain_map!(model, to: :string)
13
- end
8
+ models = []
9
+ AI_SERVICES.each_key do |service|
10
+ service_models = AnswerBot.foobara_domain_map!(service).run!
11
+ service_models.map do |model|
12
+ models << AnswerBot.foobara_domain_map!(model, to: :string)
14
13
  end
15
14
  end
16
15
 
17
- models = threads.each(&:join).map(&:value).flatten
16
+ # Doing this in a threaded fashion creates a race condition somewhere for some unidentified reason
17
+ # so commenting this all out for now.
18
+ #
19
+ # threads = AI_SERVICES.keys.map do |service|
20
+ # Thread.new do
21
+ # service_models = AnswerBot.foobara_domain_map!(service).run!
22
+ # service_models.map do |model|
23
+ # AnswerBot.foobara_domain_map!(model, to: :string)
24
+ # end
25
+ # end
26
+ # end
27
+ #
28
+ # models = threads.each(&:join).map(&:value).flatten
18
29
 
19
30
  unless models.uniq == models
20
31
  # :nocov:
@@ -2,10 +2,10 @@ module Foobara
2
2
  module Ai
3
3
  module AnswerBot
4
4
  module Types
5
- services = %w[
6
- open-ai
7
- anthropic
8
- ollama
5
+ services = [
6
+ "open-ai",
7
+ "anthropic",
8
+ "ollama"
9
9
  ]
10
10
 
11
11
  ServiceEnum = Foobara::Enumerated.make_module(services)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email:
13
13
  - azimux@gmail.com
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.6.5
65
+ rubygems_version: 3.6.7
66
66
  specification_version: 4
67
67
  summary: No description. Add one.
68
68
  test_files: []