8000 [pull] main from google:main by pull[bot] · Pull Request #100 · Stars1233/adk-python · GitHub
[go: up one dir, main page]

Skip to content

[pull] main from google:main #100

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
merged 197 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
d052e8f
chore: Update agent.py
hangfei Jun 4, 2025
552e42f
Merge pull request #1154 from google:hangfei-patch-2
copybara-github Jun 4, 2025
984c1d6
test: Added unit test coverage for local_eval_set_results_manager.py
ankursharmas Jun 4, 2025
54ed031
feat: support None as return type, such as def func() -> None:
google-genai-bot Jun 4, 2025
c6e1e82
chore: Minor improvement to session service
DeanChensj Jun 4, 2025
92e7a4a
chore: bump version number to 1.2.0
selcukgun Jun 4, 2025
86e15ca
chore: Make ArtifactService transparent to AgentTools
google-genai-bot Jun 4, 2025
068df04
fix: import deprecated from typing_extensions
google-genai-bot Jun 4, 2025
78bfce4
chore: bump version number to 1.2.1
selcukgun Jun 4, 2025
cf689fd
chore: Create agent.py
hangfei Jun 5, 2025
0d23258
chore: Update agent.py
hangfei Jun 5, 2025
1d8d1e0
Update agent.py
hangfei Jun 5, 2025
c224626
fix: handle the case when agent loading error doesn't have msg attrib…
seanzhougoogle Jun 5, 2025
19dbe24
Merge branch 'main' into hangfei-patch-3
hangfei Jun 5, 2025
4269cac
chore: change import path to import directly from module instead of p…
seanzhougoogle Jun 5, 2025
b7ebb69
Merge pull request #1171 from google:hangfei-patch-3
copybara-github Jun 5, 2025
7dbd8c6
chore: add file contents check in a GitHub action
wuliang229 Jun 5, 2025
4b1c218
fix: Prevent agent_graph.py throwing when workflow agent is root agent
Jacksunwei Jun 5, 2025
078ac84
chore: replace print with logger.info
seanzhougoogle Jun 5, 2025
fe1de7b
feat: Add url_context_tool
google-genai-bot Jun 5, 2025
54367dc
feat: support to customize timeout for mcpstdio connections
google-genai-bot Jun 5, 2025
d1b0587
feat: use threshold from the eval config dialog to run eval
google-genai-bot Jun 6, 2025
6ed6351
feat: show the used metric in evaluation history
google-genai-bot Jun 6, 2025
3b1f2ae
fix: Fix broken agent graphs
selcukgun Jun 6, 2025
9abb841
fix: Forwards `__annotations__` to the fake func for FunctionTool ins…
Jacksunwei Jun 6, 2025
309a656
refactor: extract credentail key building logic to auth_config
seanzhougoogle Jun 6, 2025
a097811
chore: Removes `LlmAgent.examples` field, which was already abandoned…
Jacksunwei Jun 6, 2025
8488ff0
feat: save and last run threshold and use it in next run evaluation
google-genai-bot Jun 6, 2025
4942f19
chore: Remove duplicated `model_config` attribute in EvalMetric class
jsondai Jun 6, 2025
be71208
chore: Adds apache headers for samples
Jacksunwei Jun 7, 2025
13f98c3
fix: Correct help text formatting for `adk deploy agent_engine`
hangfei Jun 9, 2025
3ae6ce1
docs: Update code example in tool declaration to reflect BigQuery art…
google-genai-bot Jun 9, 2025
f38c08b
feat: Add DeepWiki badge to README
takashikik Jun 9, 2025
cf5d701
fix: Remove display_name for non-Vertex file uploads
ystory Jun 9, 2025
bf47a8b
fix: hide new eval metric behind flag
abchang123 Jun 9, 2025
0882000
chore: Adds decorators to mark classes or fucntions as working_in_pro…
Jacksunwei Jun 10, 2025
fa110c2
chore: refine doc string of global_instruction
seanzhougoogle Jun 10, 2025
8e438f2
refactor: Extract out platform specific code like threading
google-genai-bot Jun 10, 2025
aaf1f9b
feat: Add support for display_name and description when deploying to …
yeesian Jun 10, 2025
484b33e
chore: add rag agent for testing
abchang123 Jun 10, 2025
77f44a4
refactor: remove the examples filed of LlmAgent which are no longer n…
seanzhougoogle Jun 10, 2025
6c999ca
feat: Introduce write protected mode to BigQuery tools
google-genai-bot Jun 10, 2025
9df3f72
chore: update adk-web to use latest
wyf7107 Jun 11, 2025
416dc6f
feat: add memory_service option to CLI
DeanChensj Jun 11, 2025
c9e2655
test: add assert statements in hello_world agent main.py
wuliang229 Jun 11, 2025
0c40542
fix: Handle project and location in the .env properly when deploying …
yeesian Jun 11, 2025
b2f319f
chore: move README to parent folder contributing/
wuliang229 Jun 11, 2025
f46b73b
chore: Bump version number and update changelog for 1.3.0 release
Jacksunwei Jun 11, 2025
a7ea374
chore: Update isort config to prevent vscode flickering
Jacksunwei Jun 12, 2025
fc65873
chore: Set agent_engine_id in the service constructor, also use the a…
DeanChensj Jun 12, 2025
b08bdbc
chore: Fixes the sample of example_tool
Jacksunwei Jun 12, 2025
bbceb4f
fix: remove unnecessary double quote on Claude docstring
zchee Jun 12, 2025
1551bd4
feat: Re-factor some eval sets manager logic, and implement GcsEvalSe…
google-genai-bot Jun 12, 2025
0a5cf45
feat: Implement GcsEvalSetResultsManager to handle storage of eval se…
google-genai-bot Jun 12, 2025
2ff9b1f
test: Add unit tests for `execute_sql` tool
google-genai-bot Jun 12, 2025
d22920b
feat: support realtime input config
ammmr Jun 12, 2025
4ccda99
fix: Merge custom http options with adk specific http options in mode…
seanzhougoogle Jun 12, 8000 2025
29e4ca9
chore: Add empty a2a package
seanzhougoogle Jun 13, 2025
b2fc774
fix: Support project-based gemini model path to use google_search_tool
google-genai-bot Jun 13, 2025
313f1b0
chore: Add all missing direct deps to pyproject.toml
google-genai-bot Jun 13, 2025
c5b063f
feat: Add an Oauth2 credential fetcher to exchange and refresh oauth2…
seanzhougoogle Jun 13, 2025
1779801
feat: Support refresh access token automatically for rest_api_tool
seanzhougoogle Jun 13, 2025
dbdeb49
chore: Add a2a-sdk to pyproject.toml
seanzhougoogle Jun 13, 2025
40b15ad
refactor: enhance mcp tool session management
seanzhougoogle Jun 13, 2025
cb55970
refactor: Simplify agent_tool.py
google-genai-bot Jun 13, 2025
8e28587
feat: Add integration tests for litellm with and without turn on add_…
google-genai-bot Jun 13, 2025
131957c
chore: Triaging agent improvements & github workflow
selcukgun Jun 13, 2025
d129fd6
chore: Update the comments of MCPTool
seanzhougoogle Jun 13, 2025
233fd20
feat: Add import session API in the fast API
google-genai-bot Jun 14, 2025
8932106
chore: Raise error when using features decorated by working_in_progre…
seanzhougoogle Jun 14, 2025
b51a1f4
chore: support @working_in_progress and @expremental without calling …
seanzhougoogle Jun 14, 2025
8ebf229
chore: Add base credential service interface (WIP)
seanzhougoogle Jun 14, 2025
a19d617
chore: Add experimental decorator to BigQuery tools
seanzhougoogle Jun 14, 2025
d1bda9d
chore: Allow working_in_progress feature for unittests
seanzhougoogle Jun 14, 2025
a4d432a
chore: Add Service Account Credential Exchanger (Experimental)
seanzhougoogle Jun 14, 2025
675faef
feat: Allow data_store_specs pass into ADK VAIS built-in tool
google-genai-bot Jun 16, 2025
badbcbd
fix: agent generate config err (#1305)
simonwei97 Jun 16, 2025
1cfc555
ADK changes
xuanyang15 Jun 16, 2025
8201f9a
chore: Added live-streaming sample agent
hangfei Jun 16, 2025
fe1d5aa
feat: add enable_affective_dialog and proactivity to run_config and l…
hangfei Jun 16, 2025
fef8778
fix: liteLLM test failures
google-genai-bot Jun 16, 2025
31b81a3
chore: Update streamable http mcp example agent
seanzhougoogle Jun 16, 2025
4bda245
chore: fix oauth_calendar_agent example
seanzhougoogle Jun 16, 2025
aafa80b
fix: stream in litellm + adk and add corresponding integration tests
google-genai-bot Jun 16, 2025
e384fa4
chore: fix previously skipped isort issue
wuliang229 Jun 16, 2025
a6b1baa
chore: Add base credential exchanger (Experimental)
seanzhougoogle Jun 17, 2025
28dfcd2
chore: Add experimental decorator to Oauth2 credential fethcer
seanzhougoogle Jun 17, 2025
e2a8136
chore: Add a base credential refresher interface
seanzhougoogle Jun 17, 2025
476805d
chore: Add a2a extra dependency for github UT workflows
seanzhougoogle Jun 17, 2025
94caccc
refactor: Extract util method from OAuth2 credential fetcher for reuse
seanzhougoogle Jun 17, 2025
c755cf2
chore: Ignore a2a ut tests for python 3.9 given a2a-sdk only supports…
seanzhougoogle Jun 17, 2025
e181279
chore: Add A2A Part converter (WIP)
seanzhougoogle Jun 17, 2025
694b712
fix: agent generate config error (#1450)
simonwei97 Jun 17, 2025
1ae176a
fix: update conversion between Celsius and Fahrenheit
google-genai-bot Jun 17, 2025
c04adaa
chore: Add in memory credential service (Experimental)
seanzhougoogle Jun 17, 2025
6d174eb
fix: Set explicit project in the BigQuery client
google-genai-bot Jun 18, 2025
5f89a46
chore: Add credential service to runner and invocation context
seanzhougoogle Jun 18, 2025
f9fa784
chore: add google-adk/{version} to bigquery user agent
google-genai-bot Jun 18, 2025 8000
0a96253
refactor: Adapt service account credential exchanger to base credenti…
seanzhougoogle Jun 18, 2025
55201cb
chore: Add credential exchanger registry (Experimentals)
seanzhougoogle Jun 18, 2025
a17ebe6
chore: Add a credential refresher registry
seanzhougoogle Jun 18, 2025
9a207cb
refactor: Refactor oauth2_credential_exchanger to exchanger and refre…
seanzhougoogle Jun 18, 2025
2c739ab
chore: Add Credential Manager for managing tools credential (Experime…
seanzhougoogle Jun 18, 2025
dcea776
feat: Add Authenticated Tool (Experimental)
seanzhougoogle Jun 18, 2025
18a541c
chore: Ignore mcp_tool ut tests for python 3.9 given mcp sdk only sup…
seanzhougoogle Jun 18, 2025
157d9be
feat: Enable MCP Tool Auth (Experimental)
seanzhougoogle Jun 18, 2025
58e07ca
fix: Fix tracing for live
hangfei Jun 18, 2025
913d771
chore: Raise meaningful errors when importing a2a modules for python 3.9
seanzhougoogle Jun 19, 2025
9a1115c
chore: Remove service account support
seanzhougoogle Jun 19, 2025
7f8dc89
chore: fix the mcp_sse_agent
seanzhougoogle Jun 19, 2025
17beb32
chore: Bump version number and update changelog for 1.4.1 release
DeanChensj Jun 19, 2025
2f716ad
fix: Allow more credentials types for BigQuery tools
google-genai-bot Jun 19, 2025
ffcba70
chore: skip mcp and a2a tests for python 3.9
seanzhougoogle Jun 20, 2025
742478f
chore: Add event converters to convert adk event to a2a event (WIP)
seanzhougoogle Jun 20, 2025
4d72d31
fix: Add type checking to handle different response type of genai API…
DeanChensj Jun 20, 2025
8677d5c
chore: bump version number to 1.4.2
DeanChensj Jun 20, 2025
2fd8feb
chore: Support `allow_origins` in cloud_run deployment
DeanChensj Jun 20, 2025
fb13963
chore: Add request converter to convert a2a request to ADK request
seanzhougoogle Jun 21, 2025
7c670f6
chore: Send user message to the agent that returned a corresponding f…
seanzhougoogle Jun 21, 2025
3b1d9a8
fix: Use starred tuple unpacking on GCS artifact blob names
bck-ob-gh Jun 23, 2025
f033e40
chore: Clarify the behavior of Event.invocation_id
DeanChensj Jun 23, 2025
ea69c90
feat: add usage span attributes to telemetry (#356)
soundTricker Jun 23, 2025
bd67e84
fix: make LiteLLM streaming truly asynchronous
avidelatm Jun 23, 2025
29cd183
chore: Add credential service backed by session state
seanzhougoogle Jun 23, 2025
120cbab
refactor: Rename long util function name in runner.py and move it to …
seanzhougoogle Jun 23, 2025
fa025d7
feat: Add a new option `eval_storage_uri` in adk web & adk eval to sp…
jcpagadora737 Jun 23, 2025
9597a44
feat: Add rouge_score library to ADK eval dependencies, and implement…
jcpagadora737 Jun 23, 2025
00cc8cd
feat: Add Vertex Express mode compatibility for VertexAiSessionService
google-genai-bot Jun 24, 2025
abc89d2
feat: Add implementation of VertexAiMemoryBankService and support in …
DeanChensj Jun 24, 2025
f33e090
feat: Add ADK examples for litellm with add_function_to_prompt
genquan9 Jun 24, 2025
a1e1441
fix: update contributing links
wuliang229 Jun 24, 2025
ed7a21e
chore: Update google-genai package and related deps to latest
google-genai-bot Jun 24, 2025
acbdca0
fix: Make raw_auth_credential and exchanged_auth_credential optional …
seanzhougoogle Jun 24, 2025
9e473e0
fix: Include current turn context when include_contents='none'
google-genai-bot Jun 24, 2025
09f1269
ci(tests): leverage official uv action for install
d33bs Jun 24, 2025
88a4402
chore: Do not send api request when session does not have events
DeanChensj Jun 24, 2025
ef3c745
fix: typo fix in sample agent instruction
adityamulik Jun 24, 2025
917a8a1
chore: Adapt oauth calendar agent to use authenticated tool
seanzhougoogle Jun 24, 2025
6729edd
refactor: Rename the Google API based bigquery sample agent
google-genai-bot Jun 25, 2025
f54b9b6
chore: Add unit tests for contents.py
seanzhougoogle Jun 25, 2025
a623467
chore: Enhance a2a context id parsing and construction logic
seanzhougoogle Jun 25, 2025
5306dda
chore: Release 1.5.0
hangfei Jun 25, 2025
738d1a8
chore: create an agent to check issue format and content for bugs and…
xuanyang15 Jun 25, 2025
832a633
chore: Enhance a2a part converters
seanzhougoogle Jun 25, 2025
a71dbdf
chore: Enhance a2a event converter
seanzhougoogle Jun 25, 2025
3901fad
fix: converts litellm generate config err
simonwei97 Jun 26, 2025
04de3e1
fix: Adding detailed information on each metric evaluation
ankursharmas Jun 26, 2025
77b869f
fix: Update google_search_tool.py to support updated Gemini LIVE mode…
rayira Jun 26, 2025
2f55de6
chore: Add a2a task result aggregator
seanzhougoogle Jun 26, 2025
630f167
chore: Add a2a agent executor
seanzhougoogle Jun 26, 2025
ed09cd8
chore: Add enable_a2a option to adk command line
seanzhougoogle Jun 26, 2025
5356f20
chore: Add a2a log utils for formatting a2a reqeust/response logs
seanzhougoogle Jun 26, 2025
22629a1
chore: update adk web
wyf7107 Jun 26, 2025
e79651c
feat: Add A2A endpoints to fast api server when --a2a option is speci…
seanzhougoogle Jun 26, 2025
e153d07
chore: updating CONTRIBUTING.md with missing extra
jackwotherspoon Jun 27, 2025
9029b8a
fix: Lock LangGraph version to <= 0.4.10
hangfei Jun 27, 2025
31e41bd
chore: Enhance part_converter module to only import sys when needed a…
seanzhougoogle Jun 27, 2025
1fe9c47
chore: Enhance a2a_agent_executor module to raise error with meaningf…
seanzhougoogle Jun 27, 2025
51a559e
chore: Adding PR commit check github workflow
hangfei Jun 27, 2025
09e487d
chore: Use context_id as session_id and construct temp user_id from c…
seanzhougoogle Jun 27, 2025
20279d9
fix: Save output in state via output_key only when the event is autho…
seanzhougoogle Jun 27, 2025
045aea9
fix: Support API-Key for MCP Tool authentication
seanzhougoogle Jun 27, 2025
c13c987
feat: Add remote a2a agent
seanzhougoogle Jun 27, 2025
4e765ae
fix: raise ValueError when sessionId and userId are incorrect combina…
soundTricker Jun 27, 2025
3f621ae
fix: treat SQLite database update time as UTC for session's last upda…
xuanyang15 Jun 27, 2025
f0183a9
feat: Enable A2A features as experimental
seanzhougoogle Jun 27, 2025
1cf5cf0
chore: Add a basic a2a agent demo sample
seanzhougoogle Jun 27, 2025
379810d
chore: Add a human in the loop a2a agent demo sample
seanzhougoogle Jun 27, 2025
e2748b3
chore: Add an a2a agent to demo oauth flow
seanzhougoogle Jun 27, 2025
dc43d51
feat: Support protected write in BigQuery `execute_sql` tool
google-genai-bot Jun 27, 2025
ffa9b36
docs: Update CONTRIBUTING.md
hangfei Jun 27, 2025
b6c7b5b
chore: refactor the ADK Triaging Agent to make the code easier to read
xuanyang15 Jun 27, 2025
37108be
docs: Add AGENTS.md to provide relevant project context for the Gemin…
google-genai-bot Jun 28, 2025
a58cc3d
chore: Create an example for multi agent live streaming
hangfei Jun 30, 2025
9b75e24
fix: Avoid pydantic.ValidationError when the model stream returns emp…
hangfei Jun 30, 2025
43083ba
chore: update adk web
Jun 30, 2025
17d6042
fix: Make sure each partial event has different timestamp
DeanChensj Jul 1, 2025
b0d88bf
feat: BaseEvalService declaration and surrounding data models
ankursharmas Jul 1, 2025
a903c54
chore: Add util to build our llms.txt and llms-full.txt files
hangfei Jun 28, 2025
873beca
Merge pull request #1709 from google:my-feature-branch-llmstxt
copybara-github Jul 1, 2025
9af2394
fix: continue the action when `grep -L` returns exit status 1
wuliang229 Jul 1, 2025
0959b06
Fix: Handle unexpected 'parameters' argument in FunctionTool.run_async
google-labs-jules[bot] Jun 26, 2025
d0fdfb8
doc: Update README.md
hangfei Jul 2, 2025
3d2f13c
chore: Update the retry logic of create session polling
DeanChensj Jul 2, 2025
9bd539e
Merge pull request #1656 from google:fix-transfer-to-agent-parameters…
copybara-github Jul 2, 2025
df141db
chore: Add tenacity into project.toml
DeanChensj Jul 2, 2025
08869cc
Merge pull request #1744 from google:hangfei-patch-3
copybara-github Jul 2, 2025
62c4a85
chore: Update ResponseEvaluator to use newer version of Eval SDK
ankursharmas Jul 2, 2025
0bd05df
feat: Add Safety evaluator metric
ankursharmas Jul 2, 2025
362fb3f
fix: scenario where a user can access another users events given the …
sindrigunnars Jun 25, 2025
b04a5ce
Merge pull request #1644 from sindrigunnars:fix-issue-1641-database-s…
copybara-github Jul 2, 2025
6a39c85
chore: update agents.md to include versioning strategy
hangfei Jul 2, 2025
3fa2ea7
fix: Remove duplicate options from `adk deploy`
DeanChensj Jul 3, 2025
e437c7a
fix: Replace Event ID generation with UUID4 to prevent SQLite integri…
rahulsamant37 Jul 3, 2025
4442167
Merge pull request #1778 from rahulsamant37:fix/event-id-uuid4-collis…
copybara-github Jul 4, 2025
a021222
feat: Add `custom_metadata` to VertexAiSessionService event handling
DeanChensj Jul 4, 2025
dc414cb
chore: Add docstring to clarify that inmemory service are not suitabl…
DeanChensj Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Support allow_origins in cloud_run deployment
Also reorganize the fast_api_common_options. This resolves google#1444.

PiperOrigin-RevId: 773890111
  • Loading branch information
DeanChensj authored and copybara-github committed Jun 20, 2025
commit 2fd8feb65d6ae59732fb3ec0652d5650f47132cc
11 changes: 9 additions & 2 deletions src/google/adk/cli/cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

EXPOSE {port}

CMD adk {command} --port={port} {host_option} {service_option} {trace_to_cloud_option} "/app/agents"
CMD adk {command} --port={port} {host_option} {service_option} {trace_to_cloud_option} {allow_origins_option} "/app/agents"
"""

_AGENT_ENGINE_APP_TEMPLATE = """
Expand Down Expand Up @@ -121,8 +121,10 @@ def to_cloud_run(
port: int,
trace_to_cloud: bool,
with_ui: bool,
log_level: str,
verbosity: str,
adk_version: str,
allow_origins: Optional[list[str]] = None,
session_service_uri: Optional[str] = None,
artifact_service_uri: Optional[str] = None,
memory_service_uri: Optional[str] = None,
Expand Down Expand Up @@ -150,6 +152,7 @@ def to_cloud_run(
app_name: The name of the app, by default, it's basename of `agent_folder`.
temp_folder: The temp folder for the generated Cloud Run source files.
port: The port of the ADK api server.
allow_origins: The list of allowed origins for the ADK api server.
trace_to_cloud: Whether to enable Cloud Trace.
with_ui: Whether to deploy with UI.
verbosity: The verbosity level of the CLI.
Expand Down Expand Up @@ -183,6 +186,9 @@ def to_cloud_run(
# create Dockerfile
click.echo('Creating Dockerfile...')
host_option = '--host=0.0.0.0' if adk_version > '0.5.0' else ''
allow_origins_option = (
f'--allow_origins={",".join(allow_origins)}' if allow_origins else ''
)
dockerfile_content = _DOCKERFILE_TEMPLATE.format(
gcp_project_id=project,
gcp_region=region,
Expand All @@ -197,6 +203,7 @@ def to_cloud_run(
memory_service_uri,
),
trace_to_cloud_option='--trace_to_cloud' if trace_to_cloud else '',
allow_origins_option=allow_origins_option,
adk_version=adk_version,
host_option=host_option,
)
Expand Down Expand Up @@ -226,7 +233,7 @@ def to_cloud_run(
'--port',
str(port),
'--verbosity',
verbosity,
log_level.lower() if log_level else verbosity,
'--labels',
'created-by=adk',
],
Expand Down
93 changes: 48 additions & 45 deletions src/google/adk/cli/cli_tools_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
from .utils import envs
from .utils import logs

LOG_LEVELS = click.Choice(
["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
case_sensitive=False,
)


class HelpfulCommand(click.Command):
"""Command that shows full help on error instead of just the error message.
Expand Down Expand Up @@ -498,13 +503,6 @@ def fast_api_common_options():
"""Decorator to add common fast api options to click commands."""

def decorator(func):
@click.option(
"--host",
type=str,
help="Optional. The binding host of the server",
default="127.0.0.1",
show_default=True,
)
@click.option(
"--port",
type=int,
Expand All @@ -518,10 +516,7 @@ def decorator(func):
)
@click.option(
"--log_level",
type=click.Choice(
["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
case_sensitive=False,
),
type=LOG_LEVELS,
default="INFO",
help="Optional. Set the logging level",
)
Expand All @@ -535,7 +530,10 @@ def decorator(func):
@click.option(
"--reload/--no-reload",
default=True,
help="Optional. Whether to enable auto reload for server.",
help=(
"Optional. Whether to enable auto reload for server. Not supported"
" for Cloud Run."
),
)
@functools.wraps(func)
def wrapper(*args, **kwargs):
Expand All @@ -547,6 +545,13 @@ def wrapper(*args, **kwargs):


@main.command("web")
@click.option(
"--host",
type=str,
help="Optional. The binding host of the server",
default="127.0.0.1",
show_default=True,
)
@fast_api_common_options()
@adk_services_options()
@deprecated_adk_services_options()
Expand Down Expand Up @@ -578,7 +583,7 @@ def cli_web(

Example:

adk web --session_service_uri=[uri] --port=[port] path/to/agents_dir
adk web --port=[port] path/to/agents_dir
"""
logs.setup_adk_logger(getattr(logging, log_level.upper()))

Expand Down Expand Up @@ -628,6 +633,16 @@ async def _lifespan(app: FastAPI):


@main.command("api_server")
@click.option(
"--host",
type=str,
help="Optional. The binding host of the server",
default="127.0.0.1",
show_default=True,
)
@fast_api_common_options()
@adk_services_options()
@deprecated_adk_services_options()
# The directory of agents, where each sub-directory is a single agent.
# By default, it is the current working directory
@click.argument(
Expand All @@ -637,9 +652,6 @@ async def _lifespan(app: FastAPI):
),
default=os.getcwd(),
)
@fast_api_common_options()
@adk_services_options()
@deprecated_adk_services_options()
def cli_api_server(
agents_dir: str,
log_level: str = "INFO",
Expand All @@ -661,7 +673,7 @@ def cli_api_server(

Example:

adk api_server --session_service_uri=[uri] --port=[port] path/to/agents_dir
adk api_server --port=[port] path/to/agents_dir
"""
logs.setup_adk_logger(getattr(logging, log_level.upper()))

Expand Down Expand Up @@ -720,19 +732,7 @@ def cli_api_server(
" of the AGENT source code)."
),
)
@click.option(
"--port",
type=int,
default=8000,
help="Optional. The port of the ADK API server (default: 8000).",
)
@click.option(
"--trace_to_cloud",
is_flag=True,
show_default=True,
default=False,
help="Optional. Whether to enable Cloud Trace for cloud run.",
)
@fast_api_common_options()
@click.option(
"--with_ui",
is_flag=True,
Expand All @@ -743,6 +743,11 @@ def cli_api_server(
" only)"
),
)
@click.option(
"--verbosity",
type=LOG_LEVELS,
help="Deprecated. Use --log_level instead.",
)
@click.option(
"--temp_folder",
type=str,
Expand All @@ -756,20 +761,6 @@ def cli_api_server(
" (default: a timestamped folder in the system temp directory)."
),
)
@click.option(
"--verbosity",
type=click.Choice(
["debug", "info", "warning", "error", "critical"], case_sensitive=False
),
default="WARNING",
help="Optional. Override the default verbosity level.",
)
@click.argument(
"agent",
type=click.Path(
exists=True, dir_okay=True, file_okay=False, resolve_path=True
),
)
@click.option(
"--adk_version",
type=str,
Expand All @@ -782,6 +773,12 @@ def cli_api_server(
)
@adk_services_options()
@deprecated_adk_services_options()
@click.argument(
"agent",
type=click.Path(
exists=True, dir_okay=True, file_okay=False, resolve_path=True
),
)
def cli_deploy_cloud_run(
agent: str,
project: Optional[str],
Expand All @@ -792,8 +789,11 @@ def cli_deploy_cloud_run(
port: int,
trace_to_cloud: bool,
with_ui: bool,
verbosity: str,
adk_version: str,
log_level: Optional[str] = None,
verbosity: str = "WARNING",
reload: bool = True,
allow_origins: Optional[list[str]] = None,
session_service_uri: Optional[str] = None,
artifact_service_uri: Optional[str] = None,
memory_service_uri: Optional[str] = None,
Expand All @@ -808,6 +808,7 @@ def cli_deploy_cloud_run(

adk deploy cloud_run --project=[project] --region=[region] path/to/my_agent
"""
log_level = log_level or verbosity
session_service_uri = session_service_uri or session_db_url
artifact_service_uri = artifact_service_uri or artifact_storage_uri
try:
Expand All @@ -820,7 +821,9 @@ def cli_deploy_cloud_run(
temp_folder=temp_folder,
port=port,
trace_to_cloud=trace_to_cloud,
allow_origins=allow_origins,
with_ui=with_ui,
log_level=log_level,
verbosity=verbosity,
adk_version=adk_version,
session_service_uri=session_service_uri,
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/cli/utils/test_cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def _recording_copytree(*args: Any, **kwargs: Any):
trace_to_cloud=True,
with_ui=True,
verbosity="info",
log_level="info",
session_service_uri="sqlite://",
artifact_service_uri="gs://bucket",
memory_service_uri="rag://",
Expand Down Expand Up @@ -206,6 +207,7 @@ def _fake_rmtree(path: str | Path, *a: Any, **k: Any) -> None:
trace_to_cloud=False,
with_ui=False,
verbosity="info",
log_level="info",
adk_version="1.0.0",
session_service_uri=None,
artifact_service_uri=None,
Expand Down
0