language-operator 0.1.41 → 0.1.42
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: 21f9d0f6d79748ca4d6770581a1dbe46e3abd8bfa176b358fc61d57681801b0d
|
|
4
|
+
data.tar.gz: 3751ffbd7c65cc31d1d3b4401ca2195119c4da16d499db50d118f8e219a2ce28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1787788a7491a65db181ec063bc1bcdd40773ee3b6aa0dca08329e26a03dd0780656a0f86f4fab3ba7c29e657f6a20a1d0b94f7c45462dd4a91d93ac0c2d1c4
|
|
7
|
+
data.tar.gz: 10b22cb56a7050a25786ef6c1abdf5c6e343069be5de49bfc9fb204575d02c9dbcd80a05403a6cf03bb31087b786f7ea7842aca7f82248b6a94045a9b024c563
|
data/Gemfile.lock
CHANGED
|
@@ -23,6 +23,7 @@ module LanguageOperator
|
|
|
23
23
|
# @example Creating a custom agent
|
|
24
24
|
# agent = LanguageOperator::Agent::Base.new(config)
|
|
25
25
|
# agent.execute_goal("Summarize daily news")
|
|
26
|
+
# rubocop:disable Metrics/ModuleLength
|
|
26
27
|
module Agent
|
|
27
28
|
# Module-level logger for Agent framework
|
|
28
29
|
@logger = LanguageOperator::Logger.new(component: 'Agent')
|
|
@@ -257,11 +258,34 @@ module LanguageOperator
|
|
|
257
258
|
config = {}
|
|
258
259
|
|
|
259
260
|
if agent_def.constraints
|
|
260
|
-
|
|
261
|
+
if agent_def.constraints[:timeout]
|
|
262
|
+
timeout = agent_def.constraints[:timeout]
|
|
263
|
+
config[:timeout] = timeout.is_a?(String) ? parse_duration(timeout) : timeout
|
|
264
|
+
end
|
|
261
265
|
config[:max_retries] = agent_def.constraints[:max_retries] if agent_def.constraints[:max_retries]
|
|
262
266
|
end
|
|
263
267
|
|
|
264
268
|
config
|
|
265
269
|
end
|
|
270
|
+
|
|
271
|
+
# Parse duration string to seconds
|
|
272
|
+
#
|
|
273
|
+
# @param duration [String] Duration string (e.g., "10m", "2h", "30s")
|
|
274
|
+
# @return [Numeric] Duration in seconds
|
|
275
|
+
def self.parse_duration(duration)
|
|
276
|
+
case duration
|
|
277
|
+
when /^(\d+)s$/
|
|
278
|
+
::Regexp.last_match(1).to_i
|
|
279
|
+
when /^(\d+)m$/
|
|
280
|
+
::Regexp.last_match(1).to_i * 60
|
|
281
|
+
when /^(\d+)h$/
|
|
282
|
+
::Regexp.last_match(1).to_i * 3600
|
|
283
|
+
when Numeric
|
|
284
|
+
duration
|
|
285
|
+
else
|
|
286
|
+
raise ArgumentError, "Invalid duration format: #{duration}. Use format like '10m', '2h', '30s'"
|
|
287
|
+
end
|
|
288
|
+
end
|
|
266
289
|
end
|
|
290
|
+
# rubocop:enable Metrics/ModuleLength
|
|
267
291
|
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.42",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|