brainiac-discord 0.0.7 → 0.0.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ffe7aa25d1f9a232e356f5dc8781f96c7ec35527de9505650102260f0384664a
|
|
4
|
+
data.tar.gz: 0e4cb055a833dd4eeff966e215632266786b275b1d02135ba6e7afe9cfb016bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e4747823b694d2e96492090616339d58b6f388b6812df0abd0c88741bbaae1e1e5aba4118ed600d9cb8e7e750ca13669b6d3af4d2d249ad89ab6118bf7e4df2
|
|
7
|
+
data.tar.gz: 0df896adfa8ae958664f49ae3f54e0020c1ead26d42e657226e3ddefb9d4797b31fef357c45ccf7de278a181ac316dda559d82c29eff2a8a8959560b961bb5f1
|
|
@@ -531,7 +531,7 @@ module Brainiac
|
|
|
531
531
|
channel_id: channel_id, message_id: message_id, agent_key: agent_key,
|
|
532
532
|
agent_name: agent_name, is_dm: is_dm, is_thread: is_thread,
|
|
533
533
|
clean_content: clean_content,
|
|
534
|
-
explicit_model: explicit_model_tag?(clean_content, project_config) ? model : nil,
|
|
534
|
+
explicit_model: explicit_model_tag?(clean_content, project_config, cli_provider_override: cli_provider_override) ? model : nil,
|
|
535
535
|
explicit_effort: clean_content.match?(/\[effort:\w+\]/i) ? effort : nil)
|
|
536
536
|
|
|
537
537
|
spawn_agent(
|
|
@@ -575,23 +575,23 @@ module Brainiac
|
|
|
575
575
|
|
|
576
576
|
def resolve_overrides(clean_content, project_config, thread_model, thread_effort, thread_cli_provider)
|
|
577
577
|
cli_provider = detect_cli_provider(text: clean_content) || thread_cli_provider
|
|
578
|
-
has_explicit_model = explicit_model_tag?(clean_content, project_config)
|
|
578
|
+
has_explicit_model = explicit_model_tag?(clean_content, project_config, cli_provider_override: cli_provider)
|
|
579
579
|
has_explicit_effort = clean_content.match?(/\[effort:\w+\]/i)
|
|
580
580
|
|
|
581
581
|
model = if has_explicit_model
|
|
582
|
-
detect_model(project_config, text: clean_content)
|
|
582
|
+
detect_model(project_config, text: clean_content, cli_provider_override: cli_provider)
|
|
583
583
|
elsif thread_model
|
|
584
584
|
thread_model
|
|
585
585
|
else
|
|
586
|
-
project_config ? detect_model(project_config, text: clean_content) : nil
|
|
586
|
+
project_config ? detect_model(project_config, text: clean_content, cli_provider_override: cli_provider) : nil
|
|
587
587
|
end
|
|
588
588
|
|
|
589
589
|
effort = if has_explicit_effort
|
|
590
|
-
detect_effort(project_config, text: clean_content)
|
|
590
|
+
detect_effort(project_config, text: clean_content, cli_provider_override: cli_provider)
|
|
591
591
|
elsif thread_effort
|
|
592
592
|
thread_effort
|
|
593
593
|
else
|
|
594
|
-
project_config ? detect_effort(project_config, text: clean_content) : nil
|
|
594
|
+
project_config ? detect_effort(project_config, text: clean_content, cli_provider_override: cli_provider) : nil
|
|
595
595
|
end
|
|
596
596
|
|
|
597
597
|
[model, effort, cli_provider]
|
|
@@ -605,7 +605,7 @@ module Brainiac
|
|
|
605
605
|
return unless thread_map_key
|
|
606
606
|
|
|
607
607
|
inline_cli = detect_cli_provider(text: clean_content)
|
|
608
|
-
inline_model = explicit_model_tag?(clean_content, project_config) ? model : nil
|
|
608
|
+
inline_model = explicit_model_tag?(clean_content, project_config, cli_provider_override: cli_provider) ? model : nil
|
|
609
609
|
inline_effort = clean_content.match?(/\[effort:\w+\]/i) ? effort : nil
|
|
610
610
|
|
|
611
611
|
return unless inline_cli || inline_model || inline_effort
|
|
@@ -646,10 +646,10 @@ module Brainiac
|
|
|
646
646
|
"cli=#{cli_provider}, model=#{model}, effort=#{effort}"
|
|
647
647
|
end
|
|
648
648
|
|
|
649
|
-
def explicit_model_tag?(clean_content, project_config)
|
|
649
|
+
def explicit_model_tag?(clean_content, project_config, cli_provider_override: nil)
|
|
650
650
|
return false unless project_config
|
|
651
651
|
|
|
652
|
-
allowed_models = resolve_project_cli_config(project_config)["allowed_models"] || {}
|
|
652
|
+
allowed_models = resolve_project_cli_config(project_config, cli_provider_override: cli_provider_override)["allowed_models"] || {}
|
|
653
653
|
model_tag_match = clean_content.match(/\[(\w+)\]/i)
|
|
654
654
|
model_tag_match && allowed_models.key?(model_tag_match[1].downcase)
|
|
655
655
|
end
|