Skip to content

Add tool_call and tool_response rails to regex library#58

Open
kpunwatk wants to merge 1 commit into
trustyai-explainability:developfrom
kpunwatk:add-regex-tool-rails
Open

Add tool_call and tool_response rails to regex library#58
kpunwatk wants to merge 1 commit into
trustyai-explainability:developfrom
kpunwatk:add-regex-tool-rails

Conversation

@kpunwatk

Copy link
Copy Markdown

This commit adds the missing rail types to ensure comprehensive coverage:

  • regex check tool call
  • regex check tool response

Changes:

  • Updated flows.co (Colang v2) with TOOL OUTPUT and TOOL INPUT rails
  • Updated flows.v1.co (Colang v1) with corresponding subflows
  • Modified actions.py to accept "tool_call" and "tool_response" sources
  • Tool call/response sources map to output options for validation

All flows now support the five standard rail types: ✅ input
✅ output
✅ retrieval
✅ tool_call (tool output)
✅ tool_response (tool input)

Description

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

This commit adds the missing rail types to ensure comprehensive coverage:
- regex check tool call
- regex check tool response

Changes:
- Updated flows.co (Colang v2) with TOOL OUTPUT and TOOL INPUT rails
- Updated flows.v1.co (Colang v1) with corresponding subflows
- Modified actions.py to accept "tool_call" and "tool_response" sources
- Tool call/response sources map to output options for validation

All flows now support the five standard rail types:
✅ input
✅ output
✅ retrieval
✅ tool_call (tool output)
✅ tool_response (tool input)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@kpunwatk kpunwatk self-assigned this Jun 25, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@6a3cfd1). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #58   +/-   ##
==========================================
  Coverage           ?   79.80%           
==========================================
  Files              ?      236           
  Lines              ?    23872           
  Branches           ?        0           
==========================================
  Hits               ?    19051           
  Misses             ?     4821           
  Partials           ?        0           
Flag Coverage Δ
python 79.80% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
nemoguardrails/library/regex/actions.py 82.05% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants