ask-agent 0.40.0 → 0.40.1
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/lib/ask/agent/tool_call_repair.rb +17 -11
- data/lib/ask/agent/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc746aec7332db80fcb221115ccfd9500e08732e06c3f259a03071f3205acec7
|
|
4
|
+
data.tar.gz: f8df48168f2c426e33a4aa551c42f6873ca8b8c1be71e068f92dc52ef57fd71f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69ece3fa1915a561bf49e9f02add16f3ed3213891b0278b43a6e30637993b7a9a55bef076a21ba6ff70b31a58d96a2f60af17f2838a7c0cded0f6cbe0838834c
|
|
7
|
+
data.tar.gz: 52b2e66cfa2f1fbf7f21028fdb82d38555668e9e4f0517d84884943d304fc7bf0622f4117853e6bed8d7191a98a86c272540a6bfab2883a4c5424d4ba370c267
|
|
@@ -32,18 +32,24 @@ module Ask
|
|
|
32
32
|
# @param tools [Array<Object>]
|
|
33
33
|
# @return [String, nil] why the call is repairable, or nil when it is
|
|
34
34
|
# well-formed and executable
|
|
35
|
+
# Why a call is invalid, in a form the model can act on. This is
|
|
36
|
+
# schema-aware: the tool's own validation names what was expected
|
|
37
|
+
# ("unknown parameters: :titile — expected: :project_id, :title"),
|
|
38
|
+
# so the model corrects the call instead of guessing.
|
|
35
39
|
def self.repair_info(tool_call, tools)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
tool = tools.find { |t| t.respond_to?(:name) && t.name == tool_call.name }
|
|
41
|
+
return "unknown tool '#{tool_call.name}'" unless tool
|
|
42
|
+
|
|
43
|
+
parsed =
|
|
44
|
+
if tool_call.arguments.is_a?(Hash)
|
|
45
|
+
tool_call.arguments
|
|
46
|
+
else
|
|
47
|
+
JSON.parse(tool_call.arguments.to_s)
|
|
48
|
+
end
|
|
49
|
+
return "arguments must be a JSON object, got #{parsed.class}" unless parsed.is_a?(Hash)
|
|
50
|
+
return nil unless tool.respond_to?(:validate)
|
|
51
|
+
|
|
52
|
+
tool.validate(parsed.transform_keys(&:to_sym))
|
|
47
53
|
rescue JSON::ParserError => e
|
|
48
54
|
"arguments are not valid JSON: #{e.message}"
|
|
49
55
|
end
|
data/lib/ask/agent/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.40.
|
|
4
|
+
version: 0.40.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -57,14 +57,14 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version:
|
|
60
|
+
version: 0.6.1
|
|
61
61
|
type: :runtime
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
67
|
+
version: 0.6.1
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: ask-skills
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
240
240
|
- !ruby/object:Gem::Version
|
|
241
241
|
version: '0'
|
|
242
242
|
requirements: []
|
|
243
|
-
rubygems_version: 4.0.
|
|
243
|
+
rubygems_version: 4.0.18
|
|
244
244
|
specification_version: 4
|
|
245
245
|
summary: Agent runtime for the ask-rb ecosystem
|
|
246
246
|
test_files: []
|