lex-agentic-social 0.1.2 → 0.1.3
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: 5697e725733d706e2b69cd199a9e0273701f0f59dd0a6a1c0e8f2c40c39d172f
|
|
4
|
+
data.tar.gz: c361f2c7a29468c82d9802fa4c2f61e24f9ab4b1d9da7f6897088801d2ff8760
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5dee7abcb56cafcd0800d40e486f71a9ccd4325addd41802db7f6681aae6f9edb4c9bd5ab8ef54aff88782881d708c77725e101f82dd94ff8a30e86c3fda79d8
|
|
7
|
+
data.tar.gz: 4632fc3115f9227dcd7875e377cf65ecb99e4ffcad5763daa8f84bb46cf3905019213ecf6daa429a9d7e8b385d47d2ecde198752ef91bcfb9a99010a75dfecf6
|
data/CHANGELOG.md
CHANGED
|
@@ -48,12 +48,31 @@ module Legion
|
|
|
48
48
|
# --- Private helpers ---
|
|
49
49
|
|
|
50
50
|
def llm_ask(prompt)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
if pipeline_available?
|
|
52
|
+
response = Legion::LLM::Pipeline::GaiaCaller.chat(
|
|
53
|
+
message: prompt,
|
|
54
|
+
phase: 'conflict',
|
|
55
|
+
caller: { extension: 'lex-agentic-social', mode: :conflict }
|
|
56
|
+
)
|
|
57
|
+
content = response&.message&.dig(:content)
|
|
58
|
+
::Struct.new(:content).new(content) if content
|
|
59
|
+
else
|
|
60
|
+
chat = Legion::LLM.chat
|
|
61
|
+
chat.with_instructions(SYSTEM_PROMPT)
|
|
62
|
+
chat.ask(prompt)
|
|
63
|
+
end
|
|
54
64
|
end
|
|
55
65
|
private_class_method :llm_ask
|
|
56
66
|
|
|
67
|
+
def pipeline_available?
|
|
68
|
+
!!(defined?(Legion::LLM::Pipeline::GaiaCaller) &&
|
|
69
|
+
Legion::LLM.respond_to?(:pipeline_enabled?) &&
|
|
70
|
+
Legion::LLM.pipeline_enabled?)
|
|
71
|
+
rescue StandardError
|
|
72
|
+
false
|
|
73
|
+
end
|
|
74
|
+
private_class_method :pipeline_available?
|
|
75
|
+
|
|
57
76
|
def build_suggest_resolution_prompt(description:, severity:, exchanges:)
|
|
58
77
|
exchange_lines = exchanges.map { |e| "[#{e[:speaker]}]: #{e[:message]}" }.join("\n")
|
|
59
78
|
|
|
@@ -41,12 +41,31 @@ module Legion
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def llm_ask(prompt)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if pipeline_available?
|
|
45
|
+
response = Legion::LLM::Pipeline::GaiaCaller.chat(
|
|
46
|
+
message: prompt,
|
|
47
|
+
phase: 'moral_reasoning',
|
|
48
|
+
caller: { extension: 'lex-agentic-social', mode: :moral_reasoning }
|
|
49
|
+
)
|
|
50
|
+
content = response&.message&.dig(:content)
|
|
51
|
+
::Struct.new(:content).new(content) if content
|
|
52
|
+
else
|
|
53
|
+
chat = Legion::LLM.chat
|
|
54
|
+
chat.with_instructions(SYSTEM_PROMPT)
|
|
55
|
+
chat.ask(prompt)
|
|
56
|
+
end
|
|
47
57
|
end
|
|
48
58
|
private_class_method :llm_ask
|
|
49
59
|
|
|
60
|
+
def pipeline_available?
|
|
61
|
+
!!(defined?(Legion::LLM::Pipeline::GaiaCaller) &&
|
|
62
|
+
Legion::LLM.respond_to?(:pipeline_enabled?) &&
|
|
63
|
+
Legion::LLM.pipeline_enabled?)
|
|
64
|
+
rescue StandardError
|
|
65
|
+
false
|
|
66
|
+
end
|
|
67
|
+
private_class_method :pipeline_available?
|
|
68
|
+
|
|
50
69
|
def build_evaluate_action_prompt(action:, description:, foundations:)
|
|
51
70
|
foundation_lines = foundations.map { |name, strength| " #{name}: #{strength.round(3)}" }.join("\n")
|
|
52
71
|
desc = description.to_s.empty? ? 'no description' : description
|