Skip to content
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

Field "document" is a required field, but no value is found. #7050

Open
traed opened this issue Feb 9, 2024 · 1 comment
Open

Field "document" is a required field, but no value is found. #7050

traed opened this issue Feb 9, 2024 · 1 comment

Comments

@traed
Copy link

traed commented Feb 9, 2024

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

Run the example from the docs

@bshaffer
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants