mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
feat: Add ADK_DISABLE_LOAD_DOTENV environment variable that disables automatic loading of .env when running ADK cli, if set to true or 1
Fixes #3228 PiperOrigin-RevId: 825273905
This commit is contained in:
committed by
Copybara-Service
parent
ee8acc58be
commit
15afbcd158
@@ -34,6 +34,7 @@ from ..sessions.base_session_service import BaseSessionService
|
||||
from ..sessions.in_memory_session_service import InMemorySessionService
|
||||
from ..sessions.session import Session
|
||||
from ..utils.context_utils import Aclosing
|
||||
from ..utils.env_utils import is_env_enabled
|
||||
from .utils import envs
|
||||
from .utils.agent_loader import AgentLoader
|
||||
|
||||
@@ -160,7 +161,8 @@ async def run_cli(
|
||||
root_agent = AgentLoader(agents_dir=agent_parent_dir).load_agent(
|
||||
agent_folder_name
|
||||
)
|
||||
envs.load_dotenv_for_agent(agent_folder_name, agent_parent_dir)
|
||||
if not is_env_enabled('ADK_DISABLE_LOAD_DOTENV'):
|
||||
envs.load_dotenv_for_agent(agent_folder_name, agent_parent_dir)
|
||||
if input_file:
|
||||
session = await run_input_file(
|
||||
app_name=agent_folder_name,
|
||||
|
||||
Reference in New Issue
Block a user