From 2ea4315e9f69d039de907cb65645547143b03a8c Mon Sep 17 00:00:00 2001 From: "Xiang (Sean) Zhou" Date: Tue, 29 Apr 2025 13:33:03 -0700 Subject: [PATCH] update the doc comments of requested_auth_configs to make it more precise. PiperOrigin-RevId: 752861847 --- .github/workflows/pyink.yml | 59 ------------------- src/google/adk/events/event_actions.py | 13 ++-- .../adk/tools/mcp_tool/conversion_utils.py | 2 +- 3 files changed, 10 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/pyink.yml diff --git a/.github/workflows/pyink.yml b/.github/workflows/pyink.yml deleted file mode 100644 index 1ad57f9..0000000 --- a/.github/workflows/pyink.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Check Pyink Formatting - -on: - pull_request: - paths: - - 'src/**/*.py' - - 'tests/**/*.py' - - 'pyproject.toml' - -jobs: - pyink-check: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Install pyink - run: | - pip install pyink - - - name: Detect changed Python files - id: detect_changes - run: | - git fetch origin ${{ github.base_ref }} - CHANGED_FILES=$(git diff --diff-filter=ACMR --name-only origin/${{ github.base_ref }}...HEAD | grep -E '\.py$' || true) - echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV - - - name: Run pyink on changed files - if: env.CHANGED_FILES != '' - run: | - echo "Changed Python files:" - echo "$CHANGED_FILES" - - # Run pyink --check - set +e - pyink --check --config pyproject.toml $CHANGED_FILES - RESULT=$? - set -e - - if [ $RESULT -ne 0 ]; then - echo "" - echo "❌ Pyink formatting check failed!" - echo "👉 To fix formatting, run locally:" - echo "" - echo " pyink --config pyproject.toml $CHANGED_FILES" - echo "" - exit $RESULT - fi - - - name: No changed Python files detected - if: env.CHANGED_FILES == '' - run: | - echo "No Python files changed. Skipping pyink check." diff --git a/src/google/adk/events/event_actions.py b/src/google/adk/events/event_actions.py index 412546e..f4f4078 100644 --- a/src/google/adk/events/event_actions.py +++ b/src/google/adk/events/event_actions.py @@ -48,8 +48,13 @@ class EventActions(BaseModel): """The agent is escalating to a higher level agent.""" requested_auth_configs: dict[str, AuthConfig] = Field(default_factory=dict) - """Will only be set by a tool response indicating tool request euc. - dict key is the function call id since one function call response (from model) - could correspond to multiple function calls. - dict value is the required auth config. + """Authentication configurations requested by tool responses. + + This field will only be set by a tool response event indicating tool request + auth credential. + - Keys: The function call id. Since one function response event could contain + multiple function responses that correspond to multiple function calls. Each + function call could request different auth configs. This id is used to + identify the function call. + - Values: The requested auth config. """ diff --git a/src/google/adk/tools/mcp_tool/conversion_utils.py b/src/google/adk/tools/mcp_tool/conversion_utils.py index 9884b77..8afa301 100644 --- a/src/google/adk/tools/mcp_tool/conversion_utils.py +++ b/src/google/adk/tools/mcp_tool/conversion_utils.py @@ -22,7 +22,7 @@ def adk_to_mcp_tool_type(tool: BaseTool) -> mcp_types.Tool: """Convert a Tool in ADK into MCP tool type. This function transforms an ADK tool definition into its equivalent - MCP (Model Context Protocol) representation. + representation in the MCP (Model Control Plane) system. Args: tool: The ADK tool to convert. It should be an instance of a class derived