smart_agent 0.2.2 → 0.2.3
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/smart_agent/agent.rb +10 -0
- data/lib/smart_agent/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: d6400f1562f197a6506e7d11644b703dba1a247f72b264bc0d4fdf20fbda9156
|
|
4
|
+
data.tar.gz: 19057cba182dcd003525eb44abc98f3e445e40749f0df8a584054ec3ec24a022
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4476b0feeac3175ed2ff681ab41731f4b3c0f590b9318a193836b646b4028564c99791a38181e8021ec67d4986ec024355f9d15121ab239cf2fff4174c71be75
|
|
7
|
+
data.tar.gz: a29fdfeee975a91f7b58ee96552d92d80040c3aa0829f16022ce604f5d7e81f60ed14704aedc192d2c0b977cbc81889ec290580ea251ba9d02a774d11e73ae60
|
data/lib/smart_agent/agent.rb
CHANGED
|
@@ -26,6 +26,10 @@ module SmartAgent
|
|
|
26
26
|
@tool_call_proc = block
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
def on_logging(&block)
|
|
30
|
+
@log_proc = block
|
|
31
|
+
end
|
|
32
|
+
|
|
29
33
|
def on_event
|
|
30
34
|
if @reasoning_event_proc || @content_event_proc
|
|
31
35
|
return true
|
|
@@ -42,6 +46,8 @@ module SmartAgent
|
|
|
42
46
|
return @content_event_proc
|
|
43
47
|
when :tool
|
|
44
48
|
return @tool_call_proc
|
|
49
|
+
when :logging
|
|
50
|
+
return @log_proc
|
|
45
51
|
else
|
|
46
52
|
return nil
|
|
47
53
|
end
|
|
@@ -69,6 +75,10 @@ module SmartAgent
|
|
|
69
75
|
@agent = agent
|
|
70
76
|
end
|
|
71
77
|
|
|
78
|
+
def show_log(msg)
|
|
79
|
+
@agent.processor(:logging).call(msg) if @agent.processor(:logging)
|
|
80
|
+
end
|
|
81
|
+
|
|
72
82
|
def call_worker(name, params, with_tools: true, with_history: false)
|
|
73
83
|
SmartAgent.logger.info("Call Worker name is: #{name}")
|
|
74
84
|
SmartAgent.logger.info("Call Worker params is: #{params}")
|
data/lib/smart_agent/version.rb
CHANGED