robot_lab-audit 0.2.8 → 0.3.0

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: ef178bcab0fa1ddd03a137fb4c2bb97032d66e3e78120a171970c87bcc5ca6af
4
- data.tar.gz: 0eeb18834c2ef6a1355e528308ef31805d86c48e1557359b75d1372d8ef5e52f
3
+ metadata.gz: 69728f6acae0f6fc5e2ed44978b92987e4259909c9ca2331d09a6ecd0363ea88
4
+ data.tar.gz: 81c533106e0cbdda74cefe354d90e7c1374f97c5cdfe30e5a51aed1397853b84
5
5
  SHA512:
6
- metadata.gz: 77e6579549b5b4d05cc34162cdae304cd1fa1c38ce6d5257cb3c4344f62bef4fa6adaaa6bd2afddbecaf6dd7b953048c44229e8b3841ff6bb601c7c3fbb11097
7
- data.tar.gz: 0d1b28b9d41dc6d312f2777752664b91f5f197d765c26bf17d3ca84a42f09cb25e049e4ddad141ced0f6ae2d18e9c687d5e4160a0945ad08f9f83ead419520f2
6
+ metadata.gz: 03b2c5ac748d6bfcca5e6755342ede0ed38a3a19b9f6d53f6824936963559dcf7655b623eef1bb913758735e3a6387e3eb262e4b845e552944be7620e1b18447
7
+ data.tar.gz: 85126e3cd486cde65d207d599bec314fc9285255cfd19fa008558993152d89e3eeeb2aaf3d0ce5afcc095d8796f4212937a34c435c15a4f0371a3af5eb5ca212
data/.envrc CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  source_up
4
4
 
5
- export RR=`pwd`
6
- export BUNDLE_GEMFILE=Gemfile
5
+ export RR=$(pwd)
6
+ # BUNDLE_GEMFILE is inherited from the project root .envrc (asgard dev|prod)
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  class WordCountTool < RobotLab::Tool
35
35
  description 'Counts words in a text string'
36
- param :text, type: 'string', desc: 'The text to analyse'
36
+ parameter :text, type: 'string', description: 'The text to analyse'
37
37
 
38
38
  def execute(text:)
39
39
  { word_count: text.split.size, status: 'ok' }
@@ -43,7 +43,7 @@ end
43
43
 
44
44
  class SentimentTool < RobotLab::Tool
45
45
  description 'Returns a sentiment score for a text string'
46
- param :text, type: 'string', desc: 'The text to score'
46
+ parameter :text, type: 'string', description: 'The text to score'
47
47
 
48
48
  def execute(text:)
49
49
  score = text.downcase.include?('great') ? 0.9 : 0.5
@@ -54,7 +54,7 @@ end
54
54
 
55
55
  class FailingTool < RobotLab::Tool
56
56
  description 'Always raises a ToolError (for error logging demo)'
57
- param :reason, type: 'string', desc: 'Failure reason'
57
+ parameter :reason, type: 'string', description: 'Failure reason'
58
58
 
59
59
  def execute(reason:)
60
60
  raise RobotLab::ToolError, "Simulated failure: #{reason}"
@@ -198,8 +198,8 @@ word_count.instance_variable_set(:@robot, analyst)
198
198
  sentiment = SentimentTool.new
199
199
  sentiment.instance_variable_set(:@robot, analyst)
200
200
 
201
- word_count.call({ 'text' => input })
202
- sentiment.call({ 'text' => input })
201
+ word_count.call(**{ 'text' => input })
202
+ sentiment.call(**{ 'text' => input })
203
203
 
204
204
  all_tool_events = log.instance_variable_get(:@db)
205
205
  .execute("SELECT * FROM audit_events WHERE event_type = 'tool_call'")
@@ -224,7 +224,7 @@ TEXT
224
224
 
225
225
  failing = FailingTool.new
226
226
  failing.instance_variable_set(:@robot, analyst)
227
- failing.call({ 'reason' => 'network timeout' })
227
+ failing.call(**{ 'reason' => 'network timeout' })
228
228
 
229
229
  print_events(log.recent_errors, label: 'recent_errors (newest first):')
230
230
 
data/examples/common.rb CHANGED
@@ -7,6 +7,9 @@ require_relative '../lib/robot_lab/audit'
7
7
 
8
8
  RubyLLM.configure do |c|
9
9
  c.logger = Logger.new(File::NULL)
10
+ # The demo robots stub out chat.ask, so no request ever reaches a provider —
11
+ # but ruby_llm 2.0 validates provider configuration when the chat is built.
12
+ c.anthropic_api_key = ENV.fetch("ANTHROPIC_API_KEY", "stub-key-never-used")
10
13
  end
11
14
 
12
15
  RobotLab.configure do |c|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RobotLab
4
4
  module Audit
5
- VERSION = '0.2.8'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot_lab-audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: robot_lab
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0.1'
18
+ version: 0.3.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ">="
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '0.1'
25
+ version: 0.3.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sqlite3
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 4.0.20
93
+ rubygems_version: 4.0.21
94
94
  specification_version: 4
95
95
  summary: SQLite-backed execution audit log for RobotLab via the Hook system.
96
96
  test_files: []