Gemini for Google Cloud provides integrated generative-AI assistance for using Google Cloud and developing machine-learning workflows. It answers platform questions, generates code, explains code, and summarizes log entries. section 10.6 section 11.4
Use it at several points in a Google Cloud workflow:
- Ask the chat pane how to create a Cloud Storage bucket, import a custom model into Vertex AI, or deploy a model to a Vertex AI endpoint. section 10.6.1
- Generate Python in Cloud Shell Editor, or generate SQL in the BigQuery and Spanner query editors from comments or prompts. section 10.6.1
- Ask general or Google Cloud-specific questions about ML pipelines, Vertex AI pipelines, and prebuilt training containers. section 11.4.1
- Summarize difficult log entries to clarify errors and support debugging. section 11.4 section 11.4.4
Generating and reviewing a pipeline function
In Cloud Shell Editor, enter the signature and introductory comment for get_pipeline_config. Gemini generates provisional Python code that can be accepted incrementally. Compare the result with a handwritten version: generated code loads YAML configuration, while the handwritten version additionally prints the path and handles file-opening exceptions. Treat generated code as a starting point requiring review. section 11.4.2
Listing 11.10 get_pipeline_config function
def get_pipeline_config(path_to_yaml):
'''ingest the config yaml file
Args:
path_to_yaml: yaml file containing parameters for the pipeline script
Returns:
config: dictionary containing parameters read from the config file
'''
with open(path_to_yaml) as file: #1
config = yaml.safe_load(file)
return config #2
Inspect the generated get_pipeline_config function alongside the handwritten implementation to compare concise generation with added error handling. section 11.4.2
