smart_agent 0.1.6 → 0.1.7

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: bc51f77bbfd49a0c1c2c151b020d2073f7997804e17d762a7be8ca36ad8e4ecb
4
- data.tar.gz: f50d74c5c9d6dcb998ecbe9832cb2cbc0631019b8fd980ba4d7ed90bef81f792
3
+ metadata.gz: a9d530838f77891b2da4815a2161d64bc6b56764366009cc1748830280701c82
4
+ data.tar.gz: '0738fd38b3b97eced4d41cf9120ebf4d2baa2f69cca2bf9587de1dc3b6d10388'
5
5
  SHA512:
6
- metadata.gz: 88727a08ccbf0215cfc43bbc1ce1bf73de0d740a6bdbdd97596f549af1c2586637d34735451320b7bb6846a15013fbe74d6293f0e11e12905b07a6b603a359ab
7
- data.tar.gz: ce309f0ebec190be1870aba2afdc3b22878d0e2872fdba5679248296c398e4cf20db8483773cb22e482258ea24e3373780f55a7d863b0477db20a09382e6b102
6
+ metadata.gz: c3e0feea6bc1a320c288112ed517d099e261d2a496a93b422b2e944e9ef35f894910df80e5dfa20e57a648f5fc4de6b6f30e774afc7c6e83428ca5f14bf5c0a0
7
+ data.tar.gz: 5b53a87c47b8bff04ae1178d59b67cba3baeee080d7284acfc4699986921504f37c03279002a1e471a0bff10aeffd842364271696e372fb02626580cefa7951a
@@ -19,7 +19,11 @@ module SmartAgent
19
19
  end
20
20
 
21
21
  def content
22
- @response.dig("choices", 0, "message", "content")
22
+ if @response.class == Hash
23
+ @response.dig("choices", 0, "message", "content")
24
+ else
25
+ @response
26
+ end
23
27
  end
24
28
 
25
29
  def response
@@ -41,18 +41,31 @@ module SmartAgent
41
41
  @tools ||= {}
42
42
  end
43
43
 
44
+ def tool_groups
45
+ @tool_groups ||= {}
46
+ end
47
+
44
48
  def define(name, &block)
45
49
  tool = Tool.new(name)
46
50
  tools[name] = tool
47
51
  tool.context.instance_eval(&block)
48
52
  end
49
53
 
54
+ def define_group(name, &block)
55
+ tool_group = ToolGroup.new(name)
56
+ tool_groups[name] = tool_group
57
+ tool_group.context.instance_eval(&block)
58
+ end
59
+
50
60
  def find_tool(name)
51
61
  tools[name]
52
62
  end
53
63
  end
54
64
  end
55
65
 
66
+ class ToolGroup
67
+ end
68
+
56
69
  class ToolContext
57
70
  attr_accessor :input_params, :description, :proc
58
71
 
@@ -1,3 +1,3 @@
1
1
  module SmartAgent
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name