lex-agentic-language 0.1.3 → 0.1.4
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: 5a8e53f1251cf8bf80bb1cd15d465923d843410d9c7742dfb9d727199fb98f89
|
|
4
|
+
data.tar.gz: 43e05a16dadde6863789657773adbbbe1fc5c7946ae90c103c94b01f6fbcacd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 925d680e3ae00bd3716659ff203eb0489fd4da0bae9706870fa2fd4893bcfee6205cecc27fa51749d8741fcd786d94e7638ce108aa3254291c0dfc9d62fd0db5
|
|
7
|
+
data.tar.gz: beef93b6265819ea221d2d59b9eef646a10ae6be5d1a2d27bcdd494a97641b61915eb57464609252f537f7d13cd35f54c1aeb67974577312e4b3da51048aa7cb
|
data/CHANGELOG.md
CHANGED
|
@@ -34,12 +34,31 @@ module Legion
|
|
|
34
34
|
# --- Private helpers ---
|
|
35
35
|
|
|
36
36
|
def llm_ask(prompt)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if pipeline_available?
|
|
38
|
+
response = Legion::LLM::Pipeline::GaiaCaller.chat(
|
|
39
|
+
message: prompt,
|
|
40
|
+
phase: 'narrator',
|
|
41
|
+
caller: { extension: 'lex-agentic-language', mode: :narrator }
|
|
42
|
+
)
|
|
43
|
+
content = response&.message&.dig(:content)
|
|
44
|
+
::Struct.new(:content).new(content) if content
|
|
45
|
+
else
|
|
46
|
+
chat = Legion::LLM.chat
|
|
47
|
+
chat.with_instructions(SYSTEM_PROMPT)
|
|
48
|
+
chat.ask(prompt)
|
|
49
|
+
end
|
|
40
50
|
end
|
|
41
51
|
private_class_method :llm_ask
|
|
42
52
|
|
|
53
|
+
def pipeline_available?
|
|
54
|
+
!!(defined?(Legion::LLM::Pipeline::GaiaCaller) &&
|
|
55
|
+
Legion::LLM.respond_to?(:pipeline_enabled?) &&
|
|
56
|
+
Legion::LLM.pipeline_enabled?)
|
|
57
|
+
rescue StandardError
|
|
58
|
+
false
|
|
59
|
+
end
|
|
60
|
+
private_class_method :pipeline_available?
|
|
61
|
+
|
|
43
62
|
def build_narrate_prompt(sections_data)
|
|
44
63
|
parts = [
|
|
45
64
|
'Generate a first-person internal monologue based on the following cognitive state:',
|