Skip to content

google-marketing-solutions/adspace_agent

This is not an officially supported Google product.

AdSpace Agent

AdSpace Agent is designed to provide a standardized way to integrate an LLM with Google Ads, YouTube, Google Cloud, and Google Search to form a more comprehensive campaign and marketing plan for agencies.

Continuous Integration Code Style: Google Conventional Commits prek

Getting Started

Environment Variables

Create a .env file in the root of the project. Here are the environment variables required for the project:

# ADK
export GOOGLE_CLOUD_LOCATION=global
export GOOGLE_CLOUD_PROJECT=
export GOOGLE_GENAI_USE_VERTEXAI=TRUE

# Google API Toolsets
export CLIENT_ID=
export CLIENT_SECRET=

# Google Ads
# Required for: `adspace_agent/tools/google_ads.py`
# Reference:
# https://developers.google.com/google-ads/api/docs/client-libs/python/configuration#env-config-fields
# https://github.com/googleads/google-ads-python/blob/HEAD/google-ads.yaml
# https://developers.google.com/google-ads/api/docs/api-policy/developer-token
export GOOGLE_ADS_DEVELOPER_TOKEN=
export GOOGLE_ADS_LOGIN_CUSTOMER_ID=

When deploying, you can set those environment variables in the Google Cloud user interface.

Development

Install the dependencies with uv including all development dependencies:

uv sync --all-extras

Run the ADK webserver locally:

uv run adk web

Follow the URL to open the web interface.

Exploring Available Tools

You can list all available tools for supported APIs using the list-tools utility command. This is useful for discovering what operations the agent can perform.

Google Ads Tools

uv run list-tools google_ads

YouTube Tools

uv run list-tools youtube

Other Google API Tools

uv run list-tools google --api <api_name> --version <version>

Example for Google Drive:

uv run list-tools google --api drive --version v3

Deployment

To deploy the application, you can use the Google Cloud user interface to set the environment variables. Refer to the previous section for instructions on how to set up the environment variables.

gcloud run deploy adspace-agent \
  --source . \
  --memory 4Gi \
  --port 8000

You will also need the following APIs enabled:

gcloud services enable \
  aiplatform.googleapis.com \
  bigquery.googleapis.com \
  cloudbuild.googleapis.com \
  dfareporting.googleapis.com \
  displayvideo.googleapis.com \
  doubleclickbidmanager.googleapis.com \
  drive.googleapis.com \
  googleads.googleapis.com \
  run.googleapis.com \
  merchantapi.googleapis.com \
  searchads360.googleapis.com \
  storage.googleapis.com \
  youtube.googleapis.com

Contributing

Want to contribute? Learn more

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors