File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -315,8 +315,15 @@ def to_agent_engine(
315
315
shutil .rmtree (agent_src_path )
316
316
317
317
try :
318
+ ignore_patterns = None
319
+ ae_ignore_path = os .path .join (agent_folder , '.ae_ignore' )
320
+ if os .path .exists (ae_ignore_path ):
321
+ click .echo (f'Ignoring files matching the patterns in { ae_ignore_path } ' )
322
+ with open (ae_ignore_path , 'r' ) as f :
323
+ patterns = [pattern .strip () for pattern in f .readlines ()]
324
+ ignore_patterns = shutil .ignore_patterns (* patterns )
318
325
click .echo ('Copying agent source code...' )
319
- shutil .copytree (agent_folder , agent_src_path )
326
+ shutil .copytree (agent_folder , agent_src_path , ignore = ignore_patterns )
320
327
click .echo ('Copying agent source code complete.' )
321
328
322
329
click .echo ('Initializing Vertex AI...' )
@@ -341,7 +348,7 @@ def to_agent_engine(
341
348
env_vars = None
342
349
if not env_file :
343
350
# Attempt to read the env variables from .env in the dir (if any).
344
- env_file = os .path .join (agent_src_path , '.env' )
351
+ env_file = os .path .join (agent_folder , '.env' )
345
352
if os .path .exists (env_file ):
346
353
from dotenv import dotenv_values
347
354
You can’t perform that action at this time.
0 commit comments