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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/foobara/ai.rb +7 -0
- data/src/foobara/ai/answer_bot/ask.rb +1 -1
- data/src/foobara/ai/answer_bot/list_models.rb +1 -1
- data/src/foobara/ai/answer_bot/types/model_enum.rb +18 -7
- data/src/foobara/ai/answer_bot/types/service_enum.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a43321389b2cc813a204d4f7340b75c8a7c7bdd131220fae16682602258caab9
|
4
|
+
data.tar.gz: f5cf356dc3f0411bf0e2ffb50772828ed3cd8f729552ca16d385c55f01a00e83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: "
|
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::
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
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:
|
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.
|
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:
|
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.
|
65
|
+
rubygems_version: 3.6.7
|
66
66
|
specification_version: 4
|
67
67
|
summary: No description. Add one.
|
68
68
|
test_files: []
|