Skip to content

Adding images requires file extensions #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tpaulshippy opened this issue May 15, 2025 · 7 comments
Closed

Adding images requires file extensions #175

tpaulshippy opened this issue May 15, 2025 · 7 comments

Comments

@tpaulshippy
Copy link
Contributor

tpaulshippy commented May 15, 2025

When I run this:

response = chat.ask "What kind of architecture is shown here?", with: { image: "https://example.com/eiffel_tower" }

if my URL does not end in .jpg I am unable to make it work. I was able to workaround this by saving the image to a temp file and naming it with the .jpg extension.

It seems like if I know the image type, I should be able to provide it to the library and skip the detect_from_path method entirely.

@crmne
Copy link
Owner

crmne commented May 15, 2025

Unfortunately the APIs require a MIME type to work properly, and we're inferring that from the extension.

We could expose the a way to set the MIME type manually, wdyt?

@tpaulshippy
Copy link
Contributor Author

Yeah that would be sufficient for my needs.

@crmne
Copy link
Owner

crmne commented May 19, 2025

@tpaulshippy do you have an example URL for me? I'm implementing the tests

@tpaulshippy
Copy link
Contributor Author

@crmne crmne closed this as completed in ab32412 May 19, 2025
@crmne
Copy link
Owner

crmne commented May 20, 2025

@tpaulshippy just rewrote the whole content and attachment system to be a lot simpler and not needing to specify mime types manually: fb5e4e4

will work on the rails integration tomorrow

@tpaulshippy
Copy link
Contributor Author

And I just got it working haha. It's ok - should be easy to switch. Thanks!

@crmne
Copy link
Owner

crmne commented May 21, 2025

Pushed 53fca94

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

No branches or pull requests

2 participants