Merged
Conversation
- Support text files - Support xlsx files - Throw an UnsupportedAttachmentError instead of attaching a pointless empty attachment - Reuse the format_attachment logic from Media in Chat like ruby_llm does
Owner
|
Thanks @molily for this clean improvement! Merged. I've verified all three scenarios work end-to-end with the live API (text files, images, unsupported type rejection). As a follow-up, I'll remove the dead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, first of all, thank you for this gem!
In the standard OpenAI provider (old API), ruby_llm …
This gem in contrast …
{ type: 'input_text', text: "[Attachment: #{attachment.type}]" }for any unsupported attachment.=> According to our tests, this only confuses the LLM since it does not have access to the file content. It's better to refuse or ignore the attachment at all.
=> We'd like to send .text, .csv, .html etc. to the LLM, so the standard ruby_llm behavior makes sense to us.
format_attachmentmethods).So my proposal is that this provider should behave the same as the ruby_llm standard OpenAI provider regarding these three points.
What do you think? Thanks for considering this!
Regarding the files in fixtures: They are taken from the ruby_llm gem.
Another related question: Is
Media#format_contentcalled anywhere? As far as I can see, not from within this gem, also not from ruby_llm if I'm not mistaken. Then we could remove this method since it is very similar toChat#format_content.