Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Nov 30, 2025

Allows PNG and other image formats to be processed by the AI invoice analysis by sending them as image_url content instead of file uploads.


PR created automatically by Jules for task 1418713396572574347 started by @kellertobias


Note

OpenAI requests now embed image attachments as data-URI image_url and upload non-image files, with tests covering both paths.

  • Backend:
    • LLMService (src/backend/services/llm.service.ts):
      • OpenAI: detect attachment type; images are sent as image_url (data URI), non-images are uploaded via files.create (using toFile) and referenced as file with file_id.
      • Import toFile from openai to support file uploads.
  • Tests:
    • src/backend/services/llm.service.spec.ts:
      • Add test verifying images are sent via image_url and no file upload occurs.
      • Add test verifying PDFs trigger file upload and are referenced by file_id.

Written by Cursor Bugbot for commit 37d5521. This will update automatically on new commits. Configure here.

Modified `LLMService` to detect image attachments (PNG, JPEG, etc.) and send them as base64-encoded `image_url` content to OpenAI, instead of uploading them as files. This resolves the 400 error for unsupported MIME types when uploading PNGs.

Maintained existing behavior for PDF files.

Added unit tests to cover both image and PDF scenarios.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@kellertobias kellertobias marked this pull request as ready for review December 6, 2025 17:16
@kellertobias kellertobias merged commit 0a4386b into main Dec 6, 2025
2 checks passed
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