I am trying to convert my current function to get the text out of an image with the GCloud Vision API from being synchronous to be asynchronous.
What I've found is this Google Documentation page. But being honest, it is very confusing to me.
Currently, the way I do this is (this works already):
image = vision.types.Image(content=content)
response = client.text_detection(image=image)
and afterwards, I work with the response.
My goal now is to save the asynchronous response to e.g. a gcloud bucket, so that my function can continue on doing the next task at hand without the need to wait for a response.
In the link you shared the prefix in the example is 'gs://your-bucket/prefix/'. If you use that as the prefix of your output, then the result of the async operation will eventually write 1 or more result files to 'gs://your-bucket/prefix/'.
Eg: you might find a file like 'gs://your-bucket/prefix/result1.json' in your gcs bucket.
You could also use a prefix for the output like 'gs://your-bucket/something/file-prefix', which includes a filename prefix and you will have output files like be written to your gcs bucket 'gs://your-bucket/something/file-prefixresult1.json'.
It doesn't specify the exact name of the output files, just that the prefix you provide will be used so good for it to be something unique in your bucket.