Commit 03fa049
Fix compatibility issue with URL attachments wrong number of arguments (crmne#250)
- Fix ArgumentError: wrong number of arguments (given 2, expected 0..1)
that occurs when Marcel processes URI objects
- Use filename-based MIME detection for URLs instead of passing URI
objects to Marcel
- Add test that reproduces the issue and validates the fix
- Maintains backward compatibility and improves performance by avoiding
network calls
<img width="1316" alt="Screenshot 2025-06-16 at 9 34 13 AM"
src="https://github.com/user-attachments/assets/b0d29eeb-66aa-45b5-aed9-5c33adf0c0b7"
/>
## What this does
<!-- Clear description of what this PR does and why -->
## 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
- [x] I ran `overcommit --install` and all hooks pass
- [x] I tested my changes thoroughly
- [ ] I updated documentation if needed
- [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
Fixes crmne#247
---------
Co-authored-by: Carmine Paolino <carmine@paolino.me>1 parent 63cdb30 commit 03fa049
File tree
2 files changed
+27
-1
lines changed- lib/ruby_llm
- spec/ruby_llm
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
159 | 185 | | |
0 commit comments