-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Implement vector store endpoints and add assistants API v2 support #405
Conversation
Co-authored-by: Kyle Nash <kylenash94@gmail.com>
Hey @gehrisandro - When do you think you'll have the PR for the v2 assistants, threads and threads run resources ready? Thanks for you work on this. |
The commit for v2 is in progress. Probably it will ready to try it out, later today. |
v2 support committed. Some further testing needed before release. If one has some time to test and give feedback, any help is highly appreciated. |
Am coming from a temporary #389 (comment) hack that was working. The code: try {
$client->threads()->messages()->create($threadId, [
'role' => 'user',
'content' => $message,
]);
} catch (\Exception $e) {
return $e->getMessage();
} Errors: PHP Warning: Undefined array key "status" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 77
Warning: Undefined array key "status" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 77
PHP Warning: Undefined array key "incomplete_details" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 78
Warning: Undefined array key "incomplete_details" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 78
PHP Warning: Undefined array key "completed_at" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 79
Warning: Undefined array key "completed_at" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 79
PHP Warning: Undefined array key "incomplete_at" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 80
Warning: Undefined array key "incomplete_at" in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 80
PHP Fatal error: Uncaught TypeError: OpenAI\Responses\Threads\Messages\ThreadMessageResponse::__construct(): Argument #5 ($status) must be of type string, null given, called in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 72 and defined in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php:32
Stack trace:
#0 /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php(72): OpenAI\Responses\Threads\Messages\ThreadMessageResponse->__construct()
#1 /home/ubuntu/openai-php/src/Resources/ThreadsMessages.php(31): OpenAI\Responses\Threads\Messages\ThreadMessageResponse::from()
#2 /home/ubuntu/openai-php/test.php(21): OpenAI\Resources\ThreadsMessages->create()
#3 {main}
thrown in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 32
Fatal error: Uncaught TypeError: OpenAI\Responses\Threads\Messages\ThreadMessageResponse::__construct(): Argument #5 ($status) must be of type string, null given, called in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 72 and defined in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php:32
Stack trace:
#0 /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php(72): OpenAI\Responses\Threads\Messages\ThreadMessageResponse->__construct()
#1 /home/ubuntu/openai-php/src/Resources/ThreadsMessages.php(31): OpenAI\Responses\Threads\Messages\ThreadMessageResponse::from()
#2 /home/ubuntu/openai-php/test.php(21): OpenAI\Resources\ThreadsMessages->create()
#3 {main}
thrown in /home/ubuntu/openai-php/src/Responses/Threads/Messages/ThreadMessageResponse.php on line 32 Additional Context:
|
Hi @DevJedis Thanks for your comment. I have removed the fields, because they do not exist. This is an error in the OpenAI API documentation. |
Hi, thanks for working on this. I'm getting the following error when using file search with the assistants v2 api. "message": "Undefined array key "quote"", |
Hi @julescole According to the docs, the "quote" field is required and not nullable: https://github.com/openai/openai-openapi/blob/master/openapi.yaml#L11380 But sadly, often the docs are not accurate. Could you please provide a dump of the plain JSON response? |
@julescole I made the change, but would still like to see the raw JSON. |
Great, that's fixed it thanks. None of my citations seem to have the quote set. Here's a list from my most recent request, sorry, i wasn't sure how to output the raw json easily.
|
How to implement the vector store with the wizard so that it can read it? |
This PR implements all changes for the assistants v2 API.
I started this PR as a fresh base to start with the v2 API, because reviewing a combination of 2 PRs seems too hard: