Assistants v2 and Vector Store API support #411
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
);
}
}
} |
Beta Was this translation helpful? Give feedback.
-
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 🎉 |
Beta Was this translation helpful? Give feedback.
-
New API update on this today with some new features - @gehrisandro can we get these in? https://twitter.com/OpenAIDevs/status/1798037560905855186 |
Beta Was this translation helpful? Give feedback.
-
Support is here: https://github.com/openai-php/client/releases/tag/v0.10.1 🚀 |
Beta Was this translation helpful? Give feedback.
-
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:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
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!
Beta Was this translation helpful? Give feedback.
All reactions