client
client copied to clipboard
[file_search]: Do we have to wait for the v2 API to get file_search?
Description
When I test my assistant in the Playground, it gets my data from my files Vector Stores and can answer all of my questions related to people in my organization. When I ask the same question using my PHP script, it always says it has no info on this person. Does it means that "file_search" is not possible for the moment with the v1 API ?
I know, that's not a bug, more a question, sorry for that!
Steps To Reproduce
In my PHP:
- Create a thread
$response = $client->threads()->create([]);
- Create a message
$response = $client->threads()->messages()->create($threadId,
[
'role' => 'user',
'content' => $obj
]
);
- Run
$response = $client->threads()->runs()->create(
threadId: $threadId,
parameters: [
'assistant_id' => 'asst_xxxxxxxxxx',
],
);
- Retrieve my run
$response = $client->threads()->runs()->retrieve(
threadId: $threadId,
runId: $runId,
);
- get the answer
$response = $client->threads()->messages()->list($threadId, ['limit' => 1,]);
OpenAI PHP Client Version
v.0.8.5
PHP Version
8.1
Notes
Thanks!
Did you try to create assistant with tools
with 'type' => 'file_search'
?
I think vector store id defining in this method - https://platform.openai.com/docs/api-reference/assistants/createAssistant
only fyi - https://platform.openai.com/docs/api-reference/vector-stores/object
Hey @Damien514 ,
Since this SDK is only using V1 of the assistants API at the moment then you may need to attach the file to the assistant using the API rather than the OpenAI interface. Have you tried something along these lines?
$client->assistants()->modify('asst_xxxxxxxxxx', [
'file_ids' => ['file-xxx']
]);
Also interested. I am attaching files to the assistant for the time being, which works for the code interpreter, but the SDK throws an error trying to use "file_search" as a tool value in all contexts I've tried.
It seems to me that this is just a naming issue; file_search
was previously named retrieval
.
Try retrieval
when using v1 API
Release for assistants v2 has arrived (beta). 🚀
https://github.com/openai-php/client/releases/tag/v0.10.0-beta.1