language-operator 0.1.47 → 0.1.48
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/Gemfile.lock +1 -1
- data/lib/language_operator/agent/task_executor.rb +10 -4
- data/lib/language_operator/cli/commands/agent.rb +3 -3
- data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +1 -1
- data/lib/language_operator/templates/schema/agent_dsl_schema.json +1 -1
- data/lib/language_operator/version.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: e9abeed9980c39ca3748905b04a564cc331a31d51e2c7ea7cec64af9e706ebae
|
|
4
|
+
data.tar.gz: d8a0fcb4f2091819e58cd5f15963ed06f2282af03ed739eeba98584bacc0dd38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4771c989514116d9ea6b9910e603a8c803ca0ff7fbc6df08989ce5074962bb91204aaab20040a8dba27eb317be2edbb4ffd7296e7f77d4375321faccedf56e94
|
|
7
|
+
data.tar.gz: e12b6e974277518cae6a338920ece81506c9181d055462ccd97c56521e91a76130bdfec95e9ff0fe16ccaeef84cd9befbb95405019d749eb5874f659d2fdbce4
|
data/Gemfile.lock
CHANGED
|
@@ -288,7 +288,10 @@ module LanguageOperator
|
|
|
288
288
|
end
|
|
289
289
|
prompt += "\n"
|
|
290
290
|
|
|
291
|
-
prompt +=
|
|
291
|
+
prompt += "## Response Format\n"
|
|
292
|
+
prompt += "Return ONLY valid JSON matching the output schema above.\n"
|
|
293
|
+
prompt += "Do NOT include any explanations, thinking, or text before or after the JSON.\n"
|
|
294
|
+
prompt += "Do NOT use [THINK] tags or any other markup.\n"
|
|
292
295
|
prompt += "Use available tools as needed to complete the task.\n"
|
|
293
296
|
|
|
294
297
|
prompt
|
|
@@ -301,15 +304,18 @@ module LanguageOperator
|
|
|
301
304
|
# @return [Hash] Parsed outputs
|
|
302
305
|
# @raise [RuntimeError] If parsing fails
|
|
303
306
|
def parse_neural_response(response_text, task)
|
|
307
|
+
# Strip thinking tags that some models add (e.g., [THINK]...[/THINK])
|
|
308
|
+
cleaned_text = response_text.gsub(%r{\[THINK\].*?\[/THINK\]}m, '').strip
|
|
309
|
+
|
|
304
310
|
# Try to extract JSON from response
|
|
305
311
|
# Look for JSON code blocks first
|
|
306
|
-
json_match =
|
|
312
|
+
json_match = cleaned_text.match(/```json\s*\n(.*?)\n```/m)
|
|
307
313
|
json_text = if json_match
|
|
308
314
|
json_match[1]
|
|
309
315
|
else
|
|
310
316
|
# Try to find raw JSON object
|
|
311
|
-
json_object_match =
|
|
312
|
-
json_object_match ? json_object_match[0] :
|
|
317
|
+
json_object_match = cleaned_text.match(/\{.*\}/m)
|
|
318
|
+
json_object_match ? json_object_match[0] : cleaned_text
|
|
313
319
|
end
|
|
314
320
|
|
|
315
321
|
# Parse JSON
|
|
@@ -292,18 +292,18 @@ module LanguageOperator
|
|
|
292
292
|
label_selector = "app.kubernetes.io/name=#{name}"
|
|
293
293
|
|
|
294
294
|
# Use kubectl logs with label selector
|
|
295
|
-
cmd = "#{ctx.kubectl_prefix} logs -l #{label_selector} #{tail_arg} #{follow_arg} --
|
|
295
|
+
cmd = "#{ctx.kubectl_prefix} logs -l #{label_selector} #{tail_arg} #{follow_arg} --all-containers"
|
|
296
296
|
|
|
297
297
|
Formatters::ProgressFormatter.info("Streaming logs for agent '#{name}'...")
|
|
298
298
|
puts
|
|
299
299
|
|
|
300
|
-
# Stream
|
|
300
|
+
# Stream raw logs in real-time without formatting
|
|
301
301
|
require 'open3'
|
|
302
302
|
Open3.popen3(cmd) do |_stdin, stdout, stderr, wait_thr|
|
|
303
303
|
# Handle stdout (logs)
|
|
304
304
|
stdout_thread = Thread.new do
|
|
305
305
|
stdout.each_line do |line|
|
|
306
|
-
puts
|
|
306
|
+
puts line
|
|
307
307
|
$stdout.flush
|
|
308
308
|
end
|
|
309
309
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"$id": "https://github.com/language-operator/language-operator-gem/schema/agent-dsl.json",
|
|
4
4
|
"title": "Language Operator Agent DSL",
|
|
5
5
|
"description": "Schema for defining autonomous AI agents using the Language Operator DSL",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.48",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|