google-cloud-functions

Callable Cloud Functions Returning Null in Flutter

强颜欢笑 提交于 2020-12-15 19:45:22
问题 My Goal: I wish to call a Cloud Function in my Flutter App which retrieves a JSON obj from a Python-FastAPI server and displays content in Alert Dialogue . The Error: The Callable Function Service within my flutter app recieves null. My alert dialog displays "Null Value Error" as triggered by my code. Cloud Side Operations: My Cloud Function works in 2 parts: Receive data from client (Flutter APP) in Callable Http Function Call Python API => return to Cloud Function which returns to Client

Callable Cloud Functions Returning Null in Flutter

人盡茶涼 提交于 2020-12-15 19:37:37
问题 My Goal: I wish to call a Cloud Function in my Flutter App which retrieves a JSON obj from a Python-FastAPI server and displays content in Alert Dialogue . The Error: The Callable Function Service within my flutter app recieves null. My alert dialog displays "Null Value Error" as triggered by my code. Cloud Side Operations: My Cloud Function works in 2 parts: Receive data from client (Flutter APP) in Callable Http Function Call Python API => return to Cloud Function which returns to Client

Testing a Cloud Function from Trigerring Event option

你离开我真会死。 提交于 2020-12-15 06:42:14
问题 so I have this sort of http cloud function (python 3.7) from google.cloud import storage def upload_blob(bucket_name, blob_text, destination_blob_name): """Uploads a file to the bucket.""" storage_client = storage.Client() bucket = storage_client.get_bucket(bucket_name) blob = bucket.blob(destination_blob_name) blob.upload_from_string(blob_text) print('File {} uploaded to {}.'.format( source_file_name, destination_blob_name)) Now I want to test this function from Testing tab of the Functions

Any way to import Python's nltk.download('punkt') into Google Cloud Functions?

不打扰是莪最后的温柔 提交于 2020-12-15 05:05:14
问题 Any way to import Python's nltk.download('punkt') into Google Cloud Functions? I've found that adding the statement manually into my code block in main.py significantly slows down my function processing, since punkt has to be downloaded every time it is run. Is there any method to eliminate this by calling punkt in some other way? EDIT#1:- I edited my code and program structure to match what Barak suggested, but I keep getting the same error: Error: function terminated. Recommended action:

Any way to import Python's nltk.download('punkt') into Google Cloud Functions?

笑着哭i 提交于 2020-12-15 05:03:40
问题 Any way to import Python's nltk.download('punkt') into Google Cloud Functions? I've found that adding the statement manually into my code block in main.py significantly slows down my function processing, since punkt has to be downloaded every time it is run. Is there any method to eliminate this by calling punkt in some other way? EDIT#1:- I edited my code and program structure to match what Barak suggested, but I keep getting the same error: Error: function terminated. Recommended action:

Any way to import Python's nltk.download('punkt') into Google Cloud Functions?

筅森魡賤 提交于 2020-12-15 05:02:01
问题 Any way to import Python's nltk.download('punkt') into Google Cloud Functions? I've found that adding the statement manually into my code block in main.py significantly slows down my function processing, since punkt has to be downloaded every time it is run. Is there any method to eliminate this by calling punkt in some other way? EDIT#1:- I edited my code and program structure to match what Barak suggested, but I keep getting the same error: Error: function terminated. Recommended action:

How to download image into local storage?

时光毁灭记忆、已成空白 提交于 2020-12-15 04:57:09
问题 I am use Node.js Firebase Cloud Function but need get image I have store in Firebase Storage so I can send to Google Cloud vision API. Vision API require send from local image file: // const fileName = 'Local image file, e.g. /path/to/image.png'; // Performs safe search detection on the local file const [result] = await client.safeSearchDetection(fileName); const detections = result.safeSearchAnnotation; How to download remote image into local storage? For example I want store this image in

How to download image into local storage?

只愿长相守 提交于 2020-12-15 04:55:00
问题 I am use Node.js Firebase Cloud Function but need get image I have store in Firebase Storage so I can send to Google Cloud vision API. Vision API require send from local image file: // const fileName = 'Local image file, e.g. /path/to/image.png'; // Performs safe search detection on the local file const [result] = await client.safeSearchDetection(fileName); const detections = result.safeSearchAnnotation; How to download remote image into local storage? For example I want store this image in

Facing challenge to invoke cloud Function from cloud task using oidcToken

て烟熏妆下的殇ゞ 提交于 2020-12-15 01:38:42
问题 I am facing challenge to invoke cloud Function from cloud task using oidcToken . Here are details of my IAM & Code: const { CloudTasksClient } = require('@google-cloud/tasks'); const client = new CloudTasksClient(); //See https://cloud.google.com/tasks/docs/tutorial-gcf module.exports = async (payload, scheduleTimeInSec) => { const project = process.env.GOOGLE_APPLICATION_PROJECTID; const queue = process.env.QUEUE_NAME; const location = process.env.QUEUE_LOCATION; const callBackUrl = https:/

Facing challenge to invoke cloud Function from cloud task using oidcToken

青春壹個敷衍的年華 提交于 2020-12-15 01:37:09
问题 I am facing challenge to invoke cloud Function from cloud task using oidcToken . Here are details of my IAM & Code: const { CloudTasksClient } = require('@google-cloud/tasks'); const client = new CloudTasksClient(); //See https://cloud.google.com/tasks/docs/tutorial-gcf module.exports = async (payload, scheduleTimeInSec) => { const project = process.env.GOOGLE_APPLICATION_PROJECTID; const queue = process.env.QUEUE_NAME; const location = process.env.QUEUE_LOCATION; const callBackUrl = https:/