def _generate_files(
    agent_folder: str,
    *,
    google_api_key: Optional[str] = None,
    google_cloud_project: Optional[str] = None,
    google_cloud_region: Optional[str] = None,
    model: Optional[str] = None,
):
  """Generates a folder name for the agent."""
  os.makedirs(agent_folder, exist_ok=True)

  dotenv_file_path = os.path.join(agent_folder, ".env")
  init_file_path = os.path.join(agent_folder, "__init__.py")
  agent_file_path = os.path.join(agent_folder, "agent.py")

  with open(dotenv_file_path, "w", encoding="utf-8") as f:
    lines = []
    if google_api_key:
      lines.append("GOOGLE_GENAI_USE_VERTEXAI=0")
    elif google_cloud_project and google_cloud_region:
      lines.append("GOOGLE_GENAI_USE_VERTEXAI=1")
    if google_api_key:
      lines.append(f"GOOGLE_API_KEY={google_api_key}")
    if google_cloud_project:
      lines.append(f"GOOGLE_CLOUD_PROJECT={google_cloud_project}")
    if google_cloud_region:
      lines.append(f"GOOGLE_CLOUD_LOCATION={google_cloud_region}")
    f.write("\n".join(lines))

  with open(init_file_path, "w", encoding="utf-8") as f:
    f.write(_INIT_PY_TEMPLATE)

  with open(agent_file_path, "w", encoding="utf-8") as f:
    f.write(_AGENT_PY_TEMPLATE.format(model_name=model))

  click.secho(
      _SUCCESS_MSG.format(agent_folder=agent_folder),
      fg="green",
  )
Generates a folder name for the agent.
src/google/adk/cli/cli_create.py