Reviewed & tested by the community
Project:
OpenAI Provider
Version:
1.2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2025 at 19:28 UTC
Updated:
24 Mar 2026 at 23:47 UTC
Jump to comment: Most recent
Comments
Comment #2
b_sharpe commentedComment #4
b_sharpe commentedOk, this works now with the parent issue; however, I didn't know that openai base is in the main module. So until that changes it's likely better to move the trait there too?
Either way, I was able to do this:
Then later use that file in a chat message like so and it was able to read the file and tell me all about it:
Comment #5
marcus_johansson commentedYes, I think for 1.2.0, move the trait there. I think the methods names should be a little bit more specific, so there is no future collision with some other download, delete etc. So maybe FileDownload, FileDelete etc.
There is an Enum where we set model capabilities that we could use to set a new capability for file upload. From what I have seen not all OpenAI models supports it, so it should be on the model level.
That way we can have checks where the standard is that its not supported, and OpenAI for now supports it.
Comment #6
b_sharpe commentedOk, moving to main module, this MR now is just supporting it in chat.
Comment #7
marcus_johansson commentedComment #8
marcus_johansson commentedComment #9
marcus_johansson commentedComment #10
csakiistvan@b_sharpe please check the MR, for me the `FileApiTrait` class is not available on `drupal/ai` module (branch 1.2.x).
Comment #11
arianraeesi commentedComment #12
abhisekmazumdarHi @csakiistvan
As the issue mentioned, those classes or files are like:
Are dependent on the parent issue: #3546954: Normalize file api's to allow providers to use them Check the MR
Comment #13
jibranLet's add tests for this functionality.
Comment #14
abhisekmazumdarOK I will make it happen. Thank You
Comment #15
abhisekmazumdarI see this module doesn't have any tests. Although AI cooked a few tests for this specific MR changes / issue, I'm still testing them. Meanwhile, I would like to ask if we really need tests for this issue?
Comment #16
abhisekmazumdarBefore you start reviewing this, please take a look at #3546954-15: Normalize file api's to allow providers to use them. The pipeline error will only be resolved when that issue is merged and a stable release is made for ai module.
For testing, ensure you pull those changes into the AI module as well.
Comment #17
jibranThis looks good now.