foobara-ai 1.0.5 → 1.0.7
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 +8 -0
- data/src/foobara/ai/answer_bot/domain_mappers/anthropic_api/message_result_to_answer.rb +1 -1
- data/src/foobara/ai/answer_bot/domain_mappers/anthropic_api/message_result_to_message.rb +1 -1
- data/src/foobara/ai/answer_bot/generate_next_message.rb +14 -2
- data/src/foobara/ai/answer_bot/types/message.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1841b2a9e7f8e60452280abf0cbe46e592f47d1a238d913d329ab296d4b1f60
|
|
4
|
+
data.tar.gz: ae3fd75f6b91ba1a7ca34f47d19916d32a757dfb3e35666bf4afb6e39733cdad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4816140ce00364987d929f50675a17143913eb53c4bbb1c986ee62f32d40df60925635df4c483bdfc0b8fa5155f4e8cb99b1b537f26d86356ca3d19117609994
|
|
7
|
+
data.tar.gz: 3d50f0cfcd055ebcfb96ef25e3bfb09aa3c72e761218feabec61bff3fb3b7535829cabf2718dcd82177debefdff23d33c69c9d57a15920766840ed0afb395abd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.0.7] - 2026-10-20
|
|
2
|
+
|
|
3
|
+
- Handle situation where LLM replies but gives no text
|
|
4
|
+
|
|
5
|
+
## [1.0.6] - 2026-09-22
|
|
6
|
+
|
|
7
|
+
- Fetch Anthropic content from MessageResule#text just to be safe
|
|
8
|
+
|
|
1
9
|
## [1.0.5] - 2026-09-22
|
|
2
10
|
|
|
3
11
|
- Fix generate next message domain mapper selection problems using domain-specific model_enum
|
|
@@ -9,10 +9,13 @@ module Foobara
|
|
|
9
9
|
service :service_enum, "If two services expose the same model, you can specify which one to use."
|
|
10
10
|
model :model_enum, default: Ai.default_llm_model, description: "The model to use."
|
|
11
11
|
temperature :float, :allow_nil
|
|
12
|
+
# TODO: add fail_if_hitting_token_limit flag
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
result Types::Message
|
|
15
16
|
|
|
17
|
+
possible_error :message_response_was_blank, context: { service: :service_enum, model: :model_enum }
|
|
18
|
+
|
|
16
19
|
AI_SERVICES.each_key do |service|
|
|
17
20
|
command = Foobara::Ai::AnswerBot::DomainMappers::ServiceToChatCompletionCommand.map!(service)
|
|
18
21
|
depends_on command
|
|
@@ -39,9 +42,18 @@ module Foobara
|
|
|
39
42
|
def run_ai_service
|
|
40
43
|
inputs = { chat:, temperature:, model: }
|
|
41
44
|
inputs = domain_map!(inputs, to: ai_command)
|
|
42
|
-
|
|
45
|
+
message = run_subcommand!(ai_command, inputs)
|
|
46
|
+
|
|
47
|
+
self.next_message = domain_map!(message, to: Types::Message)
|
|
48
|
+
|
|
49
|
+
if next_message.content.nil?
|
|
50
|
+
context = { model: }
|
|
51
|
+
context[:service] = service if service
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
add_runtime_error :message_response_was_blank,
|
|
54
|
+
"#{ai_command} #{model} responded successfully but response contained no text.",
|
|
55
|
+
**context
|
|
56
|
+
end
|
|
45
57
|
end
|
|
46
58
|
end
|
|
47
59
|
end
|