chore: re-structure adk_documentation folder so that agents in it can share the common files

PiperOrigin-RevId: 806348410
This commit is contained in:
Xuan Yang
2025-09-12 10:53:13 -07:00
committed by Copybara-Service
parent a7f4e02dc7
commit 4cf00702a0
7 changed files with 53 additions and 29 deletions
@@ -0,0 +1,13 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@@ -11,3 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from . import agent
@@ -12,19 +12,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from adk_release_analyzer.settings import CODE_OWNER
from adk_release_analyzer.settings import CODE_REPO
from adk_release_analyzer.settings import DOC_OWNER
from adk_release_analyzer.settings import DOC_REPO
from adk_release_analyzer.settings import IS_INTERACTIVE
from adk_release_analyzer.settings import LOCAL_REPOS_DIR_PATH
from adk_release_analyzer.tools import clone_or_pull_repo
from adk_release_analyzer.tools import create_issue
from adk_release_analyzer.tools import get_changed_files_between_releases
from adk_release_analyzer.tools import list_directory_contents
from adk_release_analyzer.tools import list_releases
from adk_release_analyzer.tools import read_local_git_repo_file_content
from adk_release_analyzer.tools import search_local_git_repo
import os
import sys
SAMPLES_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "..")
)
if SAMPLES_DIR not in sys.path:
sys.path.append(SAMPLES_DIR)
from adk_documentation.settings import CODE_OWNER
from adk_documentation.settings import CODE_REPO
from adk_documentation.settings import DOC_OWNER
from adk_documentation.settings import DOC_REPO
from adk_documentation.settings import IS_INTERACTIVE
from adk_documentation.settings import LOCAL_REPOS_DIR_PATH
from adk_documentation.tools import clone_or_pull_repo
from adk_documentation.tools import create_issue
from adk_documentation.tools import get_changed_files_between_releases
from adk_documentation.tools import list_directory_contents
from adk_documentation.tools import list_releases
from adk_documentation.tools import read_local_git_repo_file_content
from adk_documentation.tools import search_local_git_repo
from google.adk import Agent
if IS_INTERACTIVE:
@@ -16,12 +16,12 @@ import asyncio
import logging
import time
from adk_release_analyzer import agent
from adk_release_analyzer.settings import CODE_OWNER
from adk_release_analyzer.settings import CODE_REPO
from adk_release_analyzer.settings import DOC_OWNER
from adk_release_analyzer.settings import DOC_REPO
from adk_release_analyzer.utils import call_agent_async
from adk_documentation.adk_release_analyzer import agent
from adk_documentation.settings import CODE_OWNER
from adk_documentation.settings import CODE_REPO
from adk_documentation.settings import DOC_OWNER
from adk_documentation.settings import DOC_REPO
from adk_documentation.utils import call_agent_async
from google.adk.cli.utils import logs
from google.adk.runners import InMemoryRunner
@@ -19,12 +19,12 @@ from typing import Dict
from typing import List
from typing import Optional
from adk_release_analyzer.settings import GITHUB_BASE_URL
from adk_release_analyzer.utils import error_response
from adk_release_analyzer.utils import get_paginated_request
from adk_release_analyzer.utils import get_request
from adk_release_analyzer.utils import patch_request
from adk_release_analyzer.utils import post_request
from adk_documentation.settings import GITHUB_BASE_URL
from adk_documentation.utils import error_response
from adk_documentation.utils import get_paginated_request
from adk_documentation.utils import get_request
from adk_documentation.utils import patch_request
from adk_documentation.utils import post_request
import requests
@@ -133,7 +133,7 @@ def clone_or_pull_repo(
A dictionary indicating the status of the operation, output message, and
the head commit hash.
"""
repo_url = f"https://github.com/{repo_owner}/{repo_name}.git"
repo_url = f"git@github.com:{repo_owner}/{repo_name}.git"
try:
# Check local path and decide to clone or pull
@@ -246,8 +246,8 @@ def list_directory_contents(directory_path: str) -> Dict[str, Any]:
def search_local_git_repo(
directory_path: str,
pattern: str,
extensions: Optional[List[str]],
ignored_dirs: Optional[List[str]],
extensions: Optional[List[str]] = None,
ignored_dirs: Optional[List[str]] = None,
) -> Dict[str, Any]:
"""Searches a local Git repository for a pattern.
@@ -16,7 +16,7 @@ from typing import Any
from typing import Dict
from typing import List
from adk_release_analyzer.settings import GITHUB_TOKEN
from adk_documentation.settings import GITHUB_TOKEN
from google.adk.agents.run_config import RunConfig
from google.adk.runners import Runner
from google.genai import types