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: fea8c58125ee47fd7ab9b975a69c4baf42e1724c351c556d2276ea754d98d366
4
- data.tar.gz: ca7a2dd8d74dd64e94a9e4f0ea52693ca12190f49eeb77baba0643b3e13352a5
3
+ metadata.gz: 5697e725733d706e2b69cd199a9e0273701f0f59dd0a6a1c0e8f2c40c39d172f
4
+ data.tar.gz: c361f2c7a29468c82d9802fa4c2f61e24f9ab4b1d9da7f6897088801d2ff8760
5
5
  SHA512:
6
- metadata.gz: e2ad3f1f5a4329f7bd4c4185bb25dd028b17ea93a09a4399f415788b210a311f68b8c82f733762aaf8ef709b5e4eff2f35c366b00a86c91cdc65798160acf4bf
7
- data.tar.gz: 4582a5327cf187c45e7b03bb7873776d4873a9d4a0b537e2aa09b76c2cef23a79189d3c6f705d11262f5863a2a38ae2fb2d9abdd3d57867f36d8b74d57b0ee8f
6
+ metadata.gz: 5dee7abcb56cafcd0800d40e486f71a9ccd4325addd41802db7f6681aae6f9edb4c9bd5ab8ef54aff88782881d708c77725e101f82dd94ff8a30e86c3fda79d8
7
+ data.tar.gz: 4632fc3115f9227dcd7875e377cf65ecb99e4ffcad5763daa8f84bb46cf3905019213ecf6daa429a9d7e8b385d47d2ecde198752ef91bcfb9a99010a75dfecf6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.3] - 2026-03-23
6
+
7
+ ### Changed
8
+ - route llm calls through pipeline when available, add caller identity for attribution
9
+
5
10
  ## [0.1.2] - 2026-03-22
6
11
 
7
12
  ### Changed
@@ -48,12 +48,31 @@ module Legion
48
48
  # --- Private helpers ---
49
49
 
50
50
  def llm_ask(prompt)
51
- chat = Legion::LLM.chat
52
- chat.with_instructions(SYSTEM_PROMPT)
53
- chat.ask(prompt)
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
- chat = Legion::LLM.chat
45
- chat.with_instructions(SYSTEM_PROMPT)
46
- chat.ask(prompt)
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
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Social
7
- VERSION = '0.1.2'
7
+ VERSION = '0.1.3'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-social
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity