Field "document" is a required field, but no value is found.
traed opened this issue · 1 comments
Description
The basic example of creating a document in a Vertex AI datastore fails with the error Field "document" is a required field, but no value is found.
. Adding documentId
to the actual Document object as well as setting it on the request seems to solve the issue:
$document = new Document([
'id' => $documentId,
'json_data' => json_encode([
'title' => 'Foo'
])
]);
Please update your examples. It would also be nice if the docs explains what value [BRANCH]
is supposed to have.
Environment details
- OS: MacOS 13.6
- PHP version: 8.2
- Package name and version: google/cloud-discoveryengine 0.8.0
Steps to reproduce
The "problem" is that there is no indication in the protos that "document.id" is required in the DiscoveryEngine protos. Without this, our automatically generated samples don't know that we need to mark it as required.
We use the method_signature annotation to see that it's "recommended" to use document_id
in the request, and the samples take advantage of this. You can even use the build
method in CreateDocumentRequest
.
The nested document ID being required is unfortunate, and it seems to me like it may be a problem in the API.