language-operator 0.1.38 → 0.1.39
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 +11 -4
- data/lib/language_operator/agent.rb +34 -0
- data/lib/language_operator/kubernetes/client.rb +8 -1
- 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: a3674b7904fe01e280096b7e7c37ce8be922379d75a194e31ffd5239b082e7b8
|
|
4
|
+
data.tar.gz: 61cd4ab21b5495b537cb4babbe5e0a14c4890a93b9b1f2a1d4d4069c53c3ddc1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33714e1bd58eb58d54101a038954a1fbd425ffa34904fdfc8cb3dcb9ba83b0090d445343071190b7bb48e599d8691d99b4918f8a9eab2ecf135634f92c7825ac
|
|
7
|
+
data.tar.gz: 235149dfa2f126e31b8450426d70ebb25f39badb30b343e274c7b50ab0d7b3674f224ffae251589967c4ea47022b171af3f0212cd466bc6c994171534e0b48ef
|
data/Gemfile.lock
CHANGED
|
@@ -445,15 +445,16 @@ module LanguageOperator
|
|
|
445
445
|
|
|
446
446
|
# Execute the actual task implementation (neural or symbolic)
|
|
447
447
|
#
|
|
448
|
+
# For hybrid tasks (both neural and symbolic), prefer symbolic execution
|
|
449
|
+
# as it's more efficient and deterministic.
|
|
450
|
+
#
|
|
448
451
|
# @param task [TaskDefinition] The task definition
|
|
449
452
|
# @param inputs [Hash] Input parameters
|
|
450
453
|
# @return [Hash] Task outputs
|
|
451
454
|
def execute_task_implementation(task, inputs)
|
|
452
|
-
if task.
|
|
453
|
-
# Neural execution: LLM with tool access
|
|
454
|
-
execute_neural(task, inputs)
|
|
455
|
-
else
|
|
455
|
+
if task.symbolic?
|
|
456
456
|
# Symbolic execution: Direct Ruby code within traced span
|
|
457
|
+
# This takes precedence over neural for hybrid tasks
|
|
457
458
|
tracer.in_span('task_executor.symbolic', attributes: symbolic_task_attributes(task)) do |span|
|
|
458
459
|
validated_inputs = task.validate_inputs(inputs)
|
|
459
460
|
span.set_attribute('task.input.keys', validated_inputs.keys.map(&:to_s).join(','))
|
|
@@ -465,6 +466,12 @@ module LanguageOperator
|
|
|
465
466
|
record_output_metadata(outputs, span) if outputs.is_a?(Hash)
|
|
466
467
|
outputs
|
|
467
468
|
end
|
|
469
|
+
elsif task.neural?
|
|
470
|
+
# Neural execution: LLM with tool access
|
|
471
|
+
# Only used for pure neural tasks (no symbolic implementation)
|
|
472
|
+
execute_neural(task, inputs)
|
|
473
|
+
else
|
|
474
|
+
raise ArgumentError, "Task '#{task.name}' has neither neural nor symbolic implementation"
|
|
468
475
|
end
|
|
469
476
|
end
|
|
470
477
|
|
|
@@ -191,9 +191,43 @@ module LanguageOperator
|
|
|
191
191
|
logger.info('Main block execution completed',
|
|
192
192
|
result: result)
|
|
193
193
|
|
|
194
|
+
# Call output handler if defined
|
|
195
|
+
if agent_def.output
|
|
196
|
+
logger.debug('Executing output handler', outputs: result)
|
|
197
|
+
execute_output_handler(agent_def, result, task_executor)
|
|
198
|
+
end
|
|
199
|
+
|
|
194
200
|
result
|
|
195
201
|
end
|
|
196
202
|
|
|
203
|
+
# Execute the output handler (neural or symbolic)
|
|
204
|
+
#
|
|
205
|
+
# @param agent_def [LanguageOperator::Dsl::AgentDefinition] The agent definition
|
|
206
|
+
# @param outputs [Hash] The outputs from main execution
|
|
207
|
+
# @param task_executor [LanguageOperator::Agent::TaskExecutor] Task executor for context
|
|
208
|
+
# @return [void]
|
|
209
|
+
def self.execute_output_handler(agent_def, outputs, task_executor)
|
|
210
|
+
output_config = agent_def.output
|
|
211
|
+
|
|
212
|
+
# If symbolic implementation exists, use it
|
|
213
|
+
if output_config.symbolic?
|
|
214
|
+
logger.debug('Executing symbolic output handler')
|
|
215
|
+
# execute_symbolic takes (inputs, context) - outputs are the inputs, task_executor is context
|
|
216
|
+
output_config.execute_symbolic(outputs, task_executor)
|
|
217
|
+
elsif output_config.neural?
|
|
218
|
+
# Neural output - would need LLM access to execute
|
|
219
|
+
# For now, just log the instruction
|
|
220
|
+
logger.info('Neural output handler',
|
|
221
|
+
instruction: output_config.instructions_text,
|
|
222
|
+
outputs: outputs)
|
|
223
|
+
logger.warn('Neural output execution not yet implemented - instruction logged only')
|
|
224
|
+
end
|
|
225
|
+
rescue StandardError => e
|
|
226
|
+
logger.error('Output handler failed',
|
|
227
|
+
error: e.message,
|
|
228
|
+
backtrace: e.backtrace[0..5])
|
|
229
|
+
end
|
|
230
|
+
|
|
197
231
|
# Build executor configuration from agent definition constraints
|
|
198
232
|
#
|
|
199
233
|
# @param agent_def [LanguageOperator::Dsl::AgentDefinition] The agent definition
|
|
@@ -97,7 +97,14 @@ module LanguageOperator
|
|
|
97
97
|
def create_resource(resource)
|
|
98
98
|
resource_client = resource_client_for_resource(resource)
|
|
99
99
|
# Convert hash to K8s::Resource if needed
|
|
100
|
-
k8s_resource = resource.is_a?(K8s::Resource)
|
|
100
|
+
k8s_resource = if resource.is_a?(K8s::Resource)
|
|
101
|
+
resource
|
|
102
|
+
else
|
|
103
|
+
# Remove resourceVersion if present - it should not be set on new resources
|
|
104
|
+
resource_hash = resource.dup
|
|
105
|
+
resource_hash['metadata']&.delete('resourceVersion')
|
|
106
|
+
K8s::Resource.new(resource_hash)
|
|
107
|
+
end
|
|
101
108
|
resource_client.create_resource(k8s_resource)
|
|
102
109
|
end
|
|
103
110
|
|
|
@@ -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.39",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|