Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions docs/integrations/google_cloud_ parameter_manager.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do NOT use spaces in file names. Use git mv and rename this file to:

parameter-manager.md

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

# Catalog Frontmatter

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


|element|content|

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This front matter content is in the wrong format. see correct format example here:
https://github.com/google/adk-docs/blob/main/CONTRIBUTING.md#integrations

|-----|-----|
| catalog_title| Google Cloud Parameter Manager|
| catalog_description | A client for interacting with Google Cloud Parameter Manager |
---

# Google Cloud Secrets Manager
## Google Cloud Parameter Manager

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not not stack headings: heading should always have paragraphs after them.

The Parameter Manager integration is an extension of the Secret Manager class, offering a lightweight client designed to fetch processed parameter data from Google Cloud. This tool is ideal for agents that require configuration settings to be handled independently of the agent’s internal process. If you want to know more about all options, features or capabilities that this integration facilitates, click here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tool is ideal for agents --> This tool is useful for agents

avoid superlative language in developer documentation


... click here.

Revise this sentence. do not use language like "click here" in documentation or as the text of links
https://developers.google.com/style/cross-references#vague-link-text

The following code snippets represent the usage of different credential types as shown below.

# Integration Name

**ParameterManagerClient**

This integration provides a small client for fetching Google Cloud parameter values, which is perfect for agents that need to store their configuration settings externally.

# Use cases

## With different authentication credentials

### Using default credentials
```client = ParameterManagerClient()```

### Or with a service account json string
```client = ParameterManagerClient(service_account_json="...")```

### Or with an auth token
```client = ParameterManagerClient(auth_token="...")```

### To use a regional Parameter Manager endpoint, pass location:

```client = ParameterManagerClient(location="us-central1")```
Comment on lines +23 to +36

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use headings to list examples or items. use a list format


# Prerequisites

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include an introductory sentence, at the minimum

### Only the class ParameterManagerClient

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use headings to list items. use a list format

``` from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient```

# Explaining how to retrieve a parameter
```value =client.get_parameter("projects/my-project/locations/global/parameters/my-param/versions/latest")```
## Resources

- [Deploy Preview](https://deploy-preview-1729--adk-docs-preview.netlify.app/integrations/parameter-manager/#initialize-the-client)
- [GitHub Repository](src/google/adk/integrations/parameter_manager/parameter_client.py)
- [Google Cloud](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/overview)
- [Google AI Studio](https://aistudio-preprod.corp.google.com/prompts/1C4ldgvJkKT6qHtFUeiZKcTiDGOmlP1ze?resourceKey=0-IldDiiPSogAPqBzVfz5jSw)

## Complete usage of ParameterManagerClient
Here is a complete example of how to initialize the client and use it to fetch a parameter within an ADK application.

==python==

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


```python
import os
from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient

def fetch_external_api_key():
-- 1. Initialize the Client

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the correct format for Python comment. As written this code will not compile. update all the comments in this code.

client = ParameterManagerClient()

-- 2. Define the resource name
# Format: projects/{project_id}/locations/{location}/parameters/{parameter_id}
project_id = "your-gcp-project"
param_name = f"projects/{project_id}/locations/global/parameters/my-api-key"

try:
-- 3. Fetch the parameter payload
-- This automatically resolves linked secrets if configured
parameter_payload = client.get_parameter(param_name)

print(f"Successfully fetched parameter: {parameter_payload}")
return parameter_payload

except Exception as e:
print(f"Error retrieving parameter: {e}")
return None

-- Example usage in an agent tool
result = fetch_external_api_key()
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have not followed the contribution guide for headings and content. Review the guide and update:
https://github.com/google/adk-docs/blob/main/CONTRIBUTING.md#integrations

Loading