Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

agarcher
Copy link
Contributor

@agarcher agarcher commented Aug 1, 2025

What this does

An on_tool_call callback was added in 1.4.0 via #299, but it doens't work with a model using the rails integration via acts_as_chat.

This PR wires up the missing method so it works with the integration.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Quality check

  • I ran overcommit --install and all hooks pass
    • When I tried to commit the hooks generated a bunch of changes to models.json and aliases.json and broke a bunch of the specs, so I removed the hooks and ran specs and rubocop manually
  • I tested my changes thoroughly
  • I updated documentation if needed
    • No need
  • I didn't modify auto-generated files manually (models.json, aliases.json)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

Related issues

Copy link
Owner

@crmne crmne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple. Thank you for this.

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.44%. Comparing base (1213612) to head (82341c4).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
lib/ruby_llm/active_record/acts_as.rb 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #318      +/-   ##
==========================================
- Coverage   87.49%   87.44%   -0.05%     
==========================================
  Files          88       88              
  Lines        3422     3425       +3     
  Branches      717      717              
==========================================
+ Hits         2994     2995       +1     
- Misses        428      430       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@crmne crmne merged commit f24cef4 into crmne:main Aug 1, 2025
14 checks passed
@agarcher agarcher deleted the aa-on-tool-call-rails branch August 1, 2025 15:19
tpaulshippy pushed a commit to tpaulshippy/ruby_llm that referenced this pull request Aug 3, 2025
…#318)

## What this does

An `on_tool_call` callback was added in `1.4.0` via
crmne#299, but it doens't work with a
model using the rails integration via `acts_as_chat`.

This PR wires up the missing method so it works with the integration.

## Type of change

- [x] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
- [ ] Performance improvement

## Scope check

- [x] I read the [Contributing
Guide](https://github.com/crmne/ruby_llm/blob/main/CONTRIBUTING.md)
- [x] This aligns with RubyLLM's focus on **LLM communication**
- [x] This isn't application-specific logic that belongs in user code
- [x] This benefits most users, not just my specific use case

## Quality check

- [ ] ~I ran `overcommit --install` and all hooks pass~
- When I tried to commit the hooks generated a bunch of changes to
`models.json` and `aliases.json` and broke a bunch of the specs, so I
removed the hooks and ran specs and rubocop manually
- [x] I tested my changes thoroughly
- [x] I updated documentation if needed
  - No need
- [x] I didn't modify auto-generated files manually (`models.json`,
`aliases.json`)

## API changes

- [ ] Breaking change
- [ ] New public methods/classes
- [ ] Changed method signatures
- [x] No API changes

## Related issues

<!-- Link issues: "Fixes crmne#123" or "Related to crmne#123" -->
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