-
Notifications
You must be signed in to change notification settings - Fork 1.8k
vision: add set_endpoint sample #1113
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
vision: add set_endpoint sample #1113
Conversation
a27b16a
to
f2db374
Compare
GcsImageUri: "gs://cloud-samples-data/vision/text/screen.jpg", | ||
}, | ||
} | ||
texts, err := client.DetectTexts(ctx, image, nil, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the output of this change based on the endpoint? Is there a more direct way we can test the endpoint was actually set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the output changes, this is what they're doing in the canonical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nnegrey do you know if there is a more direct way to test if the endpoint was actually used? Or is it completely transparent for users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I know of for this API, you can pass an invalid endpoint and get an error. But no resource is created.
Natural Language for example has a different set of endpoints they support as documented here: https://cloud.google.com/natural-language/docs/locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove this portion of the test if it's not testing the sample? Or is it needed to make sure it still works after changing the endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly to just verify the endpoint works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbpg how do you feel about this? Would you still want to change anything or should we go ahead and merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test, you could set the endpoint to a dummy gRPC server.
(But I think this is good enough.)
990bfc3
to
6723252
Compare
@tbpg do you think this is ready? |
6723252
to
109421a
Compare
Ping me when this is merged so I can add it to the docs. Thanks. |
GcsImageUri: "gs://cloud-samples-data/vision/text/screen.jpg", | ||
}, | ||
} | ||
texts, err := client.DetectTexts(ctx, image, nil, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
507a850
to
cb9d880
Compare
cb9d880
to
9c45a5d
Compare
@tbpg Can we merge this if you think it's ready? (I'm not authorized to merge) |
Will wait for Kokoro then merge. Thanks! |
Test failure is unrelated. Merging. |
Adding code sample for vision to set a custom endpoint.
Python canonical: GoogleCloudPlatform/python-docs-samples#2569