-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
[improvement]: No support for assistant version v2 #381
Comments
Going to add support for v2 asap. |
Can you also make sure to add 'attachments' to create messages endpoints? 🙏 |
Please hurry, I found some issues with v1 |
On line 18 of ](https://github.com/openai-php/client/blob/main/src/OpenAI.php line 18: ->withHttpHeader('OpenAI-Beta', 'assistants=v1') to ->withHttpHeader('OpenAI-Beta', 'assistants=v2') Just a quick fix and my code runs. but there still need to fix migration issues. |
You can create client manually with beta header: $client = OpenAI::factory()
->withApiKey($apiKey)
->withOrganization($organization)
->withHttpHeader('OpenAI-Beta', 'assistants=v2')
->make(); but it won't help because the class doesn't match the request/response |
@gehrisandro, we are looking forward to its completion :D Is there any platform where we can buy you a coffee? |
Do we have any kind of ETA on when these changes might be getting implemented? I'm in the middle of a big upgrade of our AI code and want to utilize this asap. I second @subet request too. |
Folks; be sure to sponsor Sandro's work here: gehrisandro. |
Thanks @nunomaduro ! We will... |
when i migrate to V2 by below way i'll get this error in each of request by Assistant at this code |
I'm getting the same thing as @ehsanwwe. Hope you can upgrade it :) |
getting the same ! Thanks for the effort guys |
in files: $attributes['file_ids'] with this one $attributes['file_ids'] ?? [] |
This works !!! Thank you so much @agmike77 !! |
I am also having issues when working with assistants configured for GPT 4. It doesn't seem to work with the assistants v1 API so need a work around. Also, I tried to just change the HTTP header so it uses assistants v2 but that resulted in some new errors. I think this upgrade would not be overly complex, although I am not sure if anyone is actively maintaining this project. That said, this fix would be largely helpful to me and any others looking to use the newer APIs. If theres anything I can do to make this happen let me know. I look forward to when you integrate this to the library. |
I have now resolved the file_ids issue, but a new issue has emerged: Unhandled match case '...' {"exception":"[object] (UnhandledMatchError(code: 0): Unhandled match case '...' at .../vendor/openai-php/client/src/Responses/Threads/Runs/ThreadRunResponse.php:64)"}, $tools = array_map( $attributes['quote'] ?? '' |
I've just created a $12,000 a month tier, on my sponsors page, in case there a company truly relying on this package and it needs this feature urgently: https://github.com/sponsors/nunomaduro. |
Is this feature being held hostage? |
There are companies that do rely on this package but for which 12k is impossible. No worries though, besides the fact that files attached to threads don't even work anyways (known bug OAI engineers are working on), you can get assistants v2 up and running just by writing your own single php page. Took a couple of hours, but it works quite well (difference is night and day with v1 assistant), so the rest of us will just have to patiently wait ... |
API v2 support comes in this PR: #405 Feel free to check it out and give feedback there (atm, only the vector stores API is implemented, the rest is coming the next days). |
Release for assistants v2 has arrived (beta). 🚀 Happy to hear your feedback before making it a stable release. https://github.com/openai-php/client/releases/tag/v0.10.0-beta.1 |
Thanks for the release @gehrisandro 🎉
|
Running into the same problem as you @arturspon Did you find any work around? |
Hi @arturspon, @Nerenso Looks like you both ran into the same issue, where the request still used the Fixed with the new release for the Laravel Client: https://github.com/openai-php/laravel/releases/tag/v0.10.0-beta.2 If the problem still persists, please let me know. |
@gehrisandro is the v2 feature coming to the next overall release? that will make a HUGE difference as it will allow us to the use the latest OpenAI GTP-4o model which is lightning fast in comparison. |
@gehrisandro Can we do the same for symfony client? openai-php/symfony#19 |
@gehrisandro I still see this issue intermittently, sometimes the Since OpenAI is moving quickly with their API (well, just about anything actually..) might it make sense to be a bit more lenient in processing responses? Null coalescing would indeed be a good way to prevent this issue from happening; judging from the number of open issues and PRs, the maintainers seem to be preoccupied with other projects right now, so being more liberal in response parsing might alleviate the support burden for this library a bit? |
You're better off just building your own...that's what I ended up doing. OpenAI changes things so much (and sometimes don't even put in the docs!) that you'll save yourself a ton of headaches building your own integration (that's what I ended up doing). |
Description
Hello,
Current library only support the lagacy (v1) version for assistant, threads, and messages.
So we can not used the latest supported request payload mention in open-ai documentation.
Thank you.
Steps To Reproduce
Can not use tool_resources field of the create thread api. click here
OpenAI PHP Client Version
latest
PHP Version
8.1.20
Notes
No response
The text was updated successfully, but these errors were encountered: