Assistants v2 and Vector Store API support #411
gehrisandro
announced in
Announcements
Replies: 5 comments 8 replies
|
Thank you @gehrisandro! I just tested streaming using public function getAssistantResponse()
{
$user_question = collect($this->messages)->where('role', 'user')->toArray();
$stream = app('openai')->threads()->createAndRunStreamed([
'assistant_id' => 'asst_XXXXXXXXXXXXXXXX',
'thread' => [
'messages' => $user_question,
],
]);
foreach ($stream as $response) {
if ($response->event === 'thread.message.delta') {
$content = Arr::get($response->response->delta->content[0]->toArray(), 'text.value');
$this->response .= $content;
$this->stream(
to: 'stream-'.$this->getId(),
content: $content,
replace: false
);
}
if ($response->event === 'thread.message.completed') {
$content = Arr::get($response->response->content[0]->toArray(), 'text.value');
$this->response = $content;
$this->stream(
to: 'stream-'.$this->getId(),
content: Str::markdown($content),
replace: true
);
}
}
} |
1 reply
|
I've just switched to the beta tag release and everything is working as it was on my branch. Thanks for getting this into the main repo @gehrisandro 🎉 |
1 reply
|
New API update on this today with some new features - @gehrisandro can we get these in? https://twitter.com/OpenAIDevs/status/1798037560905855186 |
5 replies
|
Support is here: https://github.com/openai-php/client/releases/tag/v0.10.1 🚀 |
0 replies
|
I just dropped you some support :-) appreciate your work on the project.
I'll keep an eye out for this update, as it's one we're waiting for. Cheers.
…On Fri, Jun 7, 2024 at 12:05 PM Sandro Gehri ***@***.***> wrote:
No problem, I can do it, but not right now, as I am busy and this is just
a side project of mine.
In the meantime, you may consider supporting me
<https://github.com/sponsors/gehrisandro> 🙏🏼
—
Reply to this email directly, view it on GitHub
<#411 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBPJXCLRKPV3DMOLAY3IQTZGGHWJAVCNFSM6AAAAABILWGA6OVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TOMBQG44TG>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Support for the Assistants API v2 and the Vector Stores API as finally 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 to @knash94 for his valuable help on this one!
All reactions