Closed potatoqualitee closed 6 months ago
This as well
Start-VectorStoreFileBatch -VectorStore $vs -FileId $uploadedfiles2.id | Wait-VectorStoreFileBatch
Wait-VectorStoreFileBatch : Cannot validate argument on parameter 'InputObject'. The "
[bool](Get-VectorStoreIdFromInputObject $_) " validation script for the argument with
value "@{id=vsfb_53d4c9c984bc4056a60c54a0804b0988; object=vector_store.file_batch;
status=in_progress; vector_store_id=vs_B60tYk3Fm9LuylRAJ29TkNro; file_counts=;
created_at=5/2/2024 9:25:41 PM}" did not return a result of True. Determine why the
validation script failed, and then try the command again.
At line:1 char:74
+ ... ectorStore $vs -FileId $uploadedfiles2.id | Wait-VectorStoreFileBatch
I wish it would work too, but it doesn't, at least not right now, due to limitations in PowerShell's pipeline system. I'll see if I can find a better workaround.
In PR #14, the parameters of Assistants related commands have been significantly overhauled. This makes the following pipeline to work.
Get-VectorStoreFile -VectorStoreId 'vs_abc123' -All | Where-Object status -eq failed | Remove-VectorStoreFile
# This is a bit of an extreme example.
Get-VectorStore 'vs_abc123' | `
Start-VectorStoreFileBatch -FileId $UploadedFiles | `
Wait-VectorStoreFileBatch | `
Get-VectorStoreFileInBatch -Filter failed | `
Remove-VectorStoreFile
However, there are some side effects. Previously, the -InputObject
parameter could accept both an object and an ID string, but the new version requires the use of a separate parameter for each.
$vso = Get-VectorStore 'vs_abc123'
# Working
Remove-VectorStore -InputObject $vso
Remove-VectorStore -VectorStore $vso
Remove-VectorStore -VectorStoreId "vs_abc123"
Remove-VectorStore $vso
Remove-VectorStore "vs_abc123"
$vso | Remove-VectorStore
"vs_abc123" | Remove-VectorStore
# Not working
Remove-VectorStore -InputObject "vs_abc123"
Seems like this should work?