forked from google/adk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate updates #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
calvingiles
merged 24 commits into
TradeMe:approval-fork
from
calvingiles:feature/approval-mechanism
Jun 12, 2025
Merged
Integrate updates #5
calvingiles
merged 24 commits into
TradeMe:approval-fork
from
calvingiles:feature/approval-mechanism
Jun 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes google#973, google#1170 PiperOrigin-RevId: 767921051
…pection PiperOrigin-RevId: 767926726
PiperOrigin-RevId: 768124459
… before 0.1 version For context: tools/example_tool.py was created to replace LlmAgent.example Also removes relevant usage in tests. PiperOrigin-RevId: 768193042
PiperOrigin-RevId: 768198603
PiperOrigin-RevId: 768214087
PiperOrigin-RevId: 768583464
Merge google#1250 The `Args:` section in the docstring of the `cli_deploy_agent_engine` function was causing formatting issues in the help output, with line breaks not being rendered correctly. This commit removes the redundant `Args:` section from the docstring. The help text for options is already comprehensively covered by the `help` attributes in the `@click.option` decorators, and `click` automatically lists the command's arguments. This change ensures that the help output for `adk deploy agent_engine --help` is clean, readable, and correctly formatted, relying on `click`'s standard help generation mechanisms. After the fix: (adk_test234) (base) hangfeilin@Hangfeis-MBP adk-python % adk deploy agent_engine --help Usage: adk deploy agent_engine [OPTIONS] AGENT Deploys an agent to Agent Engine. Args: agent (str): Required. The path to the agent to be deloyed. Example: adk deploy agent_engine --project=[project] --region=[region] --staging_bucket=[staging_bucket] path/to/my_agent Options: --project TEXT Required. Google Cloud project to deploy the agent. --region TEXT Required. Google Cloud region to deploy the agent. --staging_bucket TEXT Required. GCS bucket for staging the deployment artifacts. --trace_to_cloud Optional. Whether to enable Cloud Trace for Agent Engine. --adk_app TEXT Optional. Python file for defining the ADK application (default: a file named agent_engine_app.py) --temp_folder TEXT Optional. Temp folder for the generated Agent Engine source files. If the folder already exists, its contents will be removed. (default: a timestamped folder in the system temp directory). --env_file TEXT Optional. The filepath to the `.env` file for environment variables. (default: the `.env` file in the `agent` directory, if any.) --requirements_file TEXT Optional. The filepath to the `requirements.txt` file to use. (default: the `requirements.txt` file in the `agent` directory, if any.) --help Show this message and exit. COPYBARA_INTEGRATE_REVIEW=google#1250 from google:fix-1191-agent-engine-help d2d0e89 PiperOrigin-RevId: 769182740
…ifact description PiperOrigin-RevId: 769203265
Merge google#1143 ## Summary Added a DeepWiki badge to the README.md file to provide users with easy access to interactive documentation that stays automatically updated. ## Changes Made - Added DeepWiki badge to the existing badge section in README.md - Badge links to: https://deepwiki.com/google/adk-python ## What is DeepWiki? DeepWiki provides up-to-date documentation you can talk to, for every repository in the world. By adding this badge to our repository, we help users find and interact with documentation more easily. Users can ask questions about the codebase and get contextual answers based on the latest repository content. The documentation is automatically updated weekly, ensuring that users always have access to the most current information about the ADK codebase, including new features, API changes, and code examples that reflect the latest development progress. COPYBARA_INTEGRATE_REVIEW=google#1143 from takashikik:add-deepwiki-badge d9b8bc6 PiperOrigin-RevId: 769273276
Merge google#1211 ### Description When using the Google.GenAI backend (GEMINI_API), file uploads fail if the `file_data` or `inline_data` parts of the request contain a `display_name`. The Gemini API (non-Vertex) does not support this attribute, causing a `ValueError`. This commit updates the `_preprocess_request` method in the `Gemini` class to sanitize the request. It now iterates through all content parts and sets `display_name` to `None` if the determined backend is `GEMINI_API`. This ensures compatibility, similar to the existing handling of the `labels` attribute. Fixes google#1182 ### Testing Plan **1. Unit Tests** - Added a new parameterized test `test_preprocess_request_handles_backend_specific_fields` to `tests/unittests/models/test_google_llm.py`. - This test verifies: - When the backend is `GEMINI_API`, `display_name` in `file_data` and `inline_data` is correctly set to `None`. - When the backend is `VERTEX_AI`, `display_name` remains unchanged. - All unit tests passed successfully. ```shell pytest ./tests/unittests/models/test_google_llm.py ░▒▓ ✔ adk-python base system 21:14:02 ============================================================================================ test session starts ============================================================================================ platform darwin -- Python 3.12.10, pytest-8.3.5, pluggy-1.6.0 rootdir: /Users/leo/PycharmProjects/adk-python configfile: pyproject.toml plugins: anyio-4.9.0, langsmith-0.3.42, asyncio-0.26.0, mock-3.14.0, xdist-3.6.1 asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function collected 20 items tests/unittests/models/test_google_llm.py .................... [100%] ============================================================================================ 20 passed in 3.19s ============================================================================================= ``` **2. Manual End-to-End (E2E) Test** I manually verified the fix using `adk web`. The test was configured to use a **Google AI Studio API key**, which is the scenario where the bug occurs. - **Before the fix:** When uploading a file, the request failed with the error: `{"error": "display_name parameter is not supported in Gemini API."}`. This confirms the bug. <img width="968" alt="Screenshot 2025-06-06 at 21 22 35" src="https://github.com/user-attachments/assets/f1ab2db2-d5ec-40fc-a182-9932562b21e1" /> - **After the fix:** With the patch applied, the same file upload was processed successfully. The agent correctly analyzed the file and responded without errors. <img width="973" alt="Screenshot 2025-06-06 at 21 23 24" src="https://github.com/user-attachments/assets/e03228f6-0b7d-4bf9-955a-ac24efb4fb72" /> COPYBARA_INTEGRATE_REVIEW=google#1211 from ystory:fix/display-name d3efebe PiperOrigin-RevId: 769278445
PiperOrigin-RevId: 769339396
…gress or experimental User will see warning if they instantiate such class or call such functions. PiperOrigin-RevId: 769413048
PiperOrigin-RevId: 769650108
PiperOrigin-RevId: 769655650
…agent engine PiperOrigin-RevId: 769674731
PiperOrigin-RevId: 769683091
…eeded after migrating to example tool PiperOrigin-RevId: 769757803
This allows to protect against any write operations (e.g. update or delete a table), useful for some agents that must only be used in a read-only mode, while the user may have write permissions. PiperOrigin-RevId: 769803741
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.