Agent DailyAgent Daily
videobeginner

Google ADK .env & requirements.txt files !! #shorts #adk

By AI Tech With raviyoutube
View original on youtube

This tutorial covers the essential configuration files for Google ADK (Agent Development Kit) projects: .env and requirements.txt. The .env file stores environment variables and sensitive credentials, while requirements.txt lists Python dependencies. Understanding these files is fundamental for setting up and managing Python-based AI agent projects with Google ADK.

Key Points

  • •.env file stores environment variables and sensitive configuration data (API keys, credentials) that should never be committed to version control
  • •requirements.txt lists all Python package dependencies needed for the project to run properly
  • •.env files should be added to .gitignore to prevent accidental exposure of secrets
  • •Use python-dotenv library to load environment variables from .env file into your Python application
  • •requirements.txt can be generated using 'pip freeze > requirements.txt' to capture current project dependencies
  • •Separate sensitive data (in .env) from code configuration (in requirements.txt) follows security best practices
  • •Google ADK projects require proper dependency management to ensure reproducible environments across development and production

Found this useful? Add it to a playbook for a step-by-step implementation guide.

Workflow Diagram

Start Process
Step A
Step B
Step C
Complete
Quality★★★★★

Concepts

Artifacts (4)

.env.exampleconfig
# Google ADK Configuration
GOOGLE_API_KEY=your_api_key_here
GOOGLE_PROJECT_ID=your_project_id
AGENT_NAME=my_agent
DEBUG=False
requirements.txtconfig
google-adk>=1.0.0
python-dotenv>=0.19.0
requests>=2.28.0
pydantic>=1.9.0
.gitignoreconfig
.env
.env.local
__pycache__/
*.pyc
.venv/
venv/
load_config.pypythonscript
from dotenv import load_dotenv
import os

# Load environment variables from .env file
load_dotenv()

# Access environment variables
api_key = os.getenv('GOOGLE_API_KEY')
project_id = os.getenv('GOOGLE_PROJECT_ID')
agent_name = os.getenv('AGENT_NAME')

print(f"Agent: {agent_name}")
print(f"Project: {project_id}")