Jul 8, 2024
gcloud config list
, gcloud config set project <project-id>
).export GCP_PROJECT=<project-id>
export GCP_REGION=us-central1
gen-ai-app-templates-google-cloud
text-predict-cloud-function
directory in the repository.main.py
, requirements.txt
).main.py
: Handles the cloud function logic including retrieving and processing the prompt.requirements.txt
: Lists necessary dependencies such as the functions framework and Google Cloud libraries.gcloud
commands to deploy the function.
gcloud functions deploy predict_text ...
--runtime
, --region
, and environment variables.curl
for API testing.curl
command results).