pygeai 0.4.0b7__py3-none-any.whl → 0.4.0b9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pygeai might be problematic. Click here for more details.

@@ -9,11 +9,13 @@ from pygeai.cli.commands.lab.common import get_agent_data_prompt_inputs, get_age
9
9
  from pygeai.cli.texts.help import AI_LAB_HELP_TEXT
10
10
  from pygeai.core.common.exceptions import MissingRequirementException, WrongArgumentError
11
11
  from pygeai.core.utils.console import Console
12
+ from pygeai.cli.commands.lab.options import PROJECT_ID_OPTION
12
13
  from pygeai.lab.agents.clients import AgentClient
13
14
  from pygeai.lab.processes.clients import AgenticProcessClient
14
15
  from pygeai.lab.strategies.clients import ReasoningStrategyClient
15
16
  from pygeai.lab.tools.clients import ToolClient
16
17
  from pygeai.lab.constants import VALID_SCOPES
18
+ from pygeai.tests.snippets.lab.crud_ui import project_id
17
19
 
18
20
 
19
21
  def show_help():
@@ -25,6 +27,7 @@ def show_help():
25
27
 
26
28
 
27
29
  def list_agents(option_list: list):
30
+ project_id = None
28
31
  status = ""
29
32
  start = ""
30
33
  count = ""
@@ -33,6 +36,8 @@ def list_agents(option_list: list):
33
36
  allow_external = False
34
37
 
35
38
  for option_flag, option_arg in option_list:
39
+ if option_flag.name == "project_id":
40
+ project_id = option_arg
36
41
  if option_flag.name == "status":
37
42
  status = option_arg
38
43
  if option_flag.name == "start":
@@ -46,7 +51,7 @@ def list_agents(option_list: list):
46
51
  if option_flag.name == "allow_external":
47
52
  allow_external = get_boolean_value(option_arg)
48
53
 
49
- client = AgentClient()
54
+ client = AgentClient(project_id=project_id)
50
55
  result = client.list_agents(
51
56
  status=status,
52
57
  start=start,
@@ -59,6 +64,7 @@ def list_agents(option_list: list):
59
64
 
60
65
 
61
66
  list_agents_options = [
67
+ PROJECT_ID_OPTION,
62
68
  Option(
63
69
  "status",
64
70
  ["--status"],
@@ -99,6 +105,7 @@ list_agents_options = [
99
105
 
100
106
 
101
107
  def create_agent(option_list: list):
108
+ project_id = None
102
109
  name = None
103
110
  access_scope = None
104
111
  public_name = None
@@ -120,6 +127,8 @@ def create_agent(option_list: list):
120
127
  automatic_publish = False
121
128
 
122
129
  for option_flag, option_arg in option_list:
130
+ if option_flag.name == "project_id":
131
+ project_id = option_arg
123
132
  if option_flag.name == "name":
124
133
  name = option_arg
125
134
  if option_flag.name == "access_scope":
@@ -231,7 +240,7 @@ def create_agent(option_list: list):
231
240
  {"name": agent_data_model_name}
232
241
  ]
233
242
 
234
- client = AgentClient()
243
+ client = AgentClient(project_id=project_id)
235
244
  result = client.create_agent(
236
245
  name=name,
237
246
  access_scope=access_scope,
@@ -250,6 +259,7 @@ def create_agent(option_list: list):
250
259
 
251
260
 
252
261
  create_agent_options = [
262
+ PROJECT_ID_OPTION,
253
263
  Option(
254
264
  "name",
255
265
  ["--name", "-n"],
@@ -370,12 +380,15 @@ create_agent_options = [
370
380
 
371
381
 
372
382
  def get_agent(option_list: list):
383
+ project_id = None
373
384
  agent_id = None
374
385
  revision = 0
375
386
  version = 0
376
387
  allow_drafts = True
377
388
 
378
389
  for option_flag, option_arg in option_list:
390
+ if option_flag.name == "project_id":
391
+ project_id = option_arg
379
392
  if option_flag.name == "agent_id":
380
393
  agent_id = option_arg
381
394
  if option_flag.name == "revision":
@@ -388,7 +401,7 @@ def get_agent(option_list: list):
388
401
  if not agent_id:
389
402
  raise MissingRequirementException("Agent ID must be specified.")
390
403
 
391
- client = AgentClient()
404
+ client = AgentClient(project_id=project_id)
392
405
  result = client.get_agent(
393
406
  agent_id=agent_id,
394
407
  revision=revision,
@@ -399,6 +412,7 @@ def get_agent(option_list: list):
399
412
 
400
413
 
401
414
  get_agent_options = [
415
+ PROJECT_ID_OPTION,
402
416
  Option(
403
417
  "agent_id",
404
418
  ["--agent-id", "--aid"],
@@ -427,10 +441,13 @@ get_agent_options = [
427
441
 
428
442
 
429
443
  def export_agent(option_list: list):
444
+ project_id = None
430
445
  agent_id = None
431
446
  file = None
432
447
 
433
448
  for option_flag, option_arg in option_list:
449
+ if option_flag.name == "project_id":
450
+ project_id = option_arg
434
451
  if option_flag.name == "agent_id":
435
452
  agent_id = option_arg
436
453
  if option_flag.name == "file":
@@ -439,7 +456,7 @@ def export_agent(option_list: list):
439
456
  if not agent_id:
440
457
  raise MissingRequirementException("Agent ID must be specified.")
441
458
 
442
- client = AgentClient()
459
+ client = AgentClient(project_id=project_id)
443
460
  result = client.export_agent(
444
461
  agent_id=agent_id,
445
462
  )
@@ -458,6 +475,7 @@ def export_agent(option_list: list):
458
475
 
459
476
 
460
477
  export_agent_options = [
478
+ PROJECT_ID_OPTION,
461
479
  Option(
462
480
  "agent_id",
463
481
  ["--agent-id", "--aid"],
@@ -474,9 +492,12 @@ export_agent_options = [
474
492
 
475
493
 
476
494
  def import_agent(option_list: list):
495
+ project_id = None
477
496
  file = None
478
497
 
479
498
  for option_flag, option_arg in option_list:
499
+ if option_flag.name == "project_id":
500
+ project_id = option_arg
480
501
  if option_flag.name == "file":
481
502
  file = option_arg
482
503
 
@@ -491,7 +512,7 @@ def import_agent(option_list: list):
491
512
  logger.error(f"File is not in JSON format: {e}")
492
513
  Console.write_stderr(f"File is not in JSON format.")
493
514
 
494
- client = AgentClient()
515
+ client = AgentClient(project_id=project_id)
495
516
  result = client.import_agent(
496
517
  data=agent_data
497
518
  )
@@ -501,6 +522,7 @@ def import_agent(option_list: list):
501
522
 
502
523
 
503
524
  import_agent_options = [
525
+ PROJECT_ID_OPTION,
504
526
  Option(
505
527
  "file",
506
528
  ["--file", "-f"],
@@ -511,16 +533,19 @@ import_agent_options = [
511
533
 
512
534
 
513
535
  def create_sharing_link(option_list: list):
536
+ project_id = None
514
537
  agent_id = None
515
538
 
516
539
  for option_flag, option_arg in option_list:
540
+ if option_flag.name == "project_id":
541
+ project_id = option_arg
517
542
  if option_flag.name == "agent_id":
518
543
  agent_id = option_arg
519
544
 
520
545
  if not agent_id:
521
546
  raise MissingRequirementException("Agent ID must be specified.")
522
547
 
523
- client = AgentClient()
548
+ client = AgentClient(project_id=project_id)
524
549
  result = client.create_sharing_link(
525
550
  agent_id=agent_id,
526
551
  )
@@ -528,6 +553,7 @@ def create_sharing_link(option_list: list):
528
553
 
529
554
 
530
555
  create_sharing_link_options = [
556
+ PROJECT_ID_OPTION,
531
557
  Option(
532
558
  "agent_id",
533
559
  ["--agent-id", "--aid"],
@@ -538,10 +564,13 @@ create_sharing_link_options = [
538
564
 
539
565
 
540
566
  def publish_agent_revision(option_list: list):
567
+ project_id = None
541
568
  agent_id = None
542
569
  revision = None
543
570
 
544
571
  for option_flag, option_arg in option_list:
572
+ if option_flag.name == "project_id":
573
+ project_id = option_arg
545
574
  if option_flag.name == "agent_id":
546
575
  agent_id = option_arg
547
576
  if option_flag.name == "revision":
@@ -550,7 +579,7 @@ def publish_agent_revision(option_list: list):
550
579
  if not (agent_id and revision):
551
580
  raise MissingRequirementException("Agent ID and revision must be specified.")
552
581
 
553
- client = AgentClient()
582
+ client = AgentClient(project_id=project_id)
554
583
  result = client.publish_agent_revision(
555
584
  agent_id=agent_id,
556
585
  revision=revision
@@ -559,6 +588,7 @@ def publish_agent_revision(option_list: list):
559
588
 
560
589
 
561
590
  publish_agent_revision_options = [
591
+ PROJECT_ID_OPTION,
562
592
  Option(
563
593
  "agent_id",
564
594
  ["--agent-id", "--aid"],
@@ -575,16 +605,19 @@ publish_agent_revision_options = [
575
605
 
576
606
 
577
607
  def delete_agent(option_list: list):
608
+ project_id = None
578
609
  agent_id = None
579
610
 
580
611
  for option_flag, option_arg in option_list:
612
+ if option_flag.name == "project_id":
613
+ project_id = option_arg
581
614
  if option_flag.name == "agent_id":
582
615
  agent_id = option_arg
583
616
 
584
617
  if not agent_id:
585
618
  raise MissingRequirementException("Agent ID must be specified.")
586
619
 
587
- client = AgentClient()
620
+ client = AgentClient(project_id=project_id)
588
621
  result = client.delete_agent(
589
622
  agent_id=agent_id,
590
623
  )
@@ -592,6 +625,7 @@ def delete_agent(option_list: list):
592
625
 
593
626
 
594
627
  delete_agent_options = [
628
+ PROJECT_ID_OPTION,
595
629
  Option(
596
630
  "agent_id",
597
631
  ["--agent-id", "--aid"],
@@ -602,6 +636,7 @@ delete_agent_options = [
602
636
 
603
637
 
604
638
  def update_agent(option_list: list):
639
+ project_id = None
605
640
  agent_id = None
606
641
  name = None
607
642
  access_scope = None
@@ -625,6 +660,8 @@ def update_agent(option_list: list):
625
660
  upsert = False
626
661
 
627
662
  for option_flag, option_arg in option_list:
663
+ if option_flag.name == "project_id":
664
+ project_id = option_arg
628
665
  if option_flag.name == "agent_id":
629
666
  agent_id = option_arg
630
667
  if option_flag.name == "name":
@@ -740,7 +777,7 @@ def update_agent(option_list: list):
740
777
  {"name": agent_data_model_name}
741
778
  ]
742
779
 
743
- client = AgentClient()
780
+ client = AgentClient(project_id=project_id)
744
781
  result = client.update_agent(
745
782
  agent_id=agent_id,
746
783
  name=name,
@@ -761,6 +798,7 @@ def update_agent(option_list: list):
761
798
 
762
799
 
763
800
  update_agent_options = [
801
+ PROJECT_ID_OPTION,
764
802
  Option(
765
803
  "agent_id",
766
804
  ["--agent-id", "--aid"],
@@ -894,6 +932,7 @@ update_agent_options = [
894
932
 
895
933
 
896
934
  def create_tool(option_list: list):
935
+ project_id = None
897
936
  name = None
898
937
  description = None
899
938
  scope = None
@@ -907,6 +946,8 @@ def create_tool(option_list: list):
907
946
  automatic_publish = False
908
947
 
909
948
  for option_flag, option_arg in option_list:
949
+ if option_flag.name == "project_id":
950
+ project_id = option_arg
910
951
  if option_flag.name == "name":
911
952
  name = option_arg
912
953
  if option_flag.name == "description":
@@ -959,7 +1000,7 @@ def create_tool(option_list: list):
959
1000
 
960
1001
  tool_parameters = get_tool_parameters(parameters)
961
1002
 
962
- client = ToolClient()
1003
+ client = ToolClient(project_id=project_id)
963
1004
  result = client.create_tool(
964
1005
  name=name,
965
1006
  description=description,
@@ -977,6 +1018,7 @@ def create_tool(option_list: list):
977
1018
 
978
1019
 
979
1020
  create_tool_options = [
1021
+ PROJECT_ID_OPTION,
980
1022
  Option(
981
1023
  "name",
982
1024
  ["--name", "-n"],
@@ -1047,6 +1089,7 @@ create_tool_options = [
1047
1089
 
1048
1090
 
1049
1091
  def list_tools(option_list: list):
1092
+ project_id = None
1050
1093
  id = ""
1051
1094
  count = "100"
1052
1095
  access_scope = "public"
@@ -1055,6 +1098,8 @@ def list_tools(option_list: list):
1055
1098
  allow_external = True
1056
1099
 
1057
1100
  for option_flag, option_arg in option_list:
1101
+ if option_flag.name == "project_id":
1102
+ project_id = option_arg
1058
1103
  if option_flag.name == "id":
1059
1104
  id = option_arg
1060
1105
  if option_flag.name == "count":
@@ -1071,7 +1116,7 @@ def list_tools(option_list: list):
1071
1116
  if scope and scope not in VALID_SCOPES:
1072
1117
  raise ValueError(f"Scope must be one of {', '.join(VALID_SCOPES)}.")
1073
1118
 
1074
- client = ToolClient()
1119
+ client = ToolClient(project_id=project_id)
1075
1120
  result = client.list_tools(
1076
1121
  id=id,
1077
1122
  count=count,
@@ -1084,6 +1129,7 @@ def list_tools(option_list: list):
1084
1129
 
1085
1130
 
1086
1131
  list_tools_options = [
1132
+ PROJECT_ID_OPTION,
1087
1133
  Option(
1088
1134
  "id",
1089
1135
  ["--id"],
@@ -1124,12 +1170,15 @@ list_tools_options = [
1124
1170
 
1125
1171
 
1126
1172
  def get_tool(option_list: list):
1173
+ project_id = None
1127
1174
  tool_id = None
1128
1175
  revision = 0
1129
1176
  version = 0
1130
1177
  allow_drafts = True
1131
1178
 
1132
1179
  for option_flag, option_arg in option_list:
1180
+ if option_flag.name == "project_id":
1181
+ project_id = option_arg
1133
1182
  if option_flag.name == "tool_id":
1134
1183
  tool_id = option_arg
1135
1184
  if option_flag.name == "revision":
@@ -1142,7 +1191,7 @@ def get_tool(option_list: list):
1142
1191
  if not tool_id:
1143
1192
  raise MissingRequirementException("Tool ID must be specified.")
1144
1193
 
1145
- client = ToolClient()
1194
+ client = ToolClient(project_id=project_id)
1146
1195
  result = client.get_tool(
1147
1196
  tool_id=tool_id,
1148
1197
  revision=revision,
@@ -1153,6 +1202,7 @@ def get_tool(option_list: list):
1153
1202
 
1154
1203
 
1155
1204
  get_tool_options = [
1205
+ PROJECT_ID_OPTION,
1156
1206
  Option(
1157
1207
  "tool_id",
1158
1208
  ["--tool-id", "--tid"],
@@ -1181,10 +1231,13 @@ get_tool_options = [
1181
1231
 
1182
1232
 
1183
1233
  def export_tool(option_list: list):
1234
+ project_id = None
1184
1235
  tool_id = None
1185
1236
  file = None
1186
1237
 
1187
1238
  for option_flag, option_arg in option_list:
1239
+ if option_flag.name == "project_id":
1240
+ project_id = option_arg
1188
1241
  if option_flag.name == "tool_id":
1189
1242
  tool_id = option_arg
1190
1243
  if option_flag.name == "file":
@@ -1194,7 +1247,7 @@ def export_tool(option_list: list):
1194
1247
  if not tool_id:
1195
1248
  raise MissingRequirementException("Tool ID must be specified.")
1196
1249
 
1197
- client = ToolClient()
1250
+ client = ToolClient(project_id=project_id)
1198
1251
  result = client.export_tool(
1199
1252
  tool_id=tool_id,
1200
1253
  )
@@ -1212,6 +1265,7 @@ def export_tool(option_list: list):
1212
1265
 
1213
1266
 
1214
1267
  export_tool_options = [
1268
+ PROJECT_ID_OPTION,
1215
1269
  Option(
1216
1270
  "tool_id",
1217
1271
  ["--tool-id", "--tid"],
@@ -1229,10 +1283,13 @@ export_tool_options = [
1229
1283
 
1230
1284
 
1231
1285
  def delete_tool(option_list: list):
1286
+ project_id = None
1232
1287
  tool_id = None
1233
1288
  tool_name = None
1234
1289
 
1235
1290
  for option_flag, option_arg in option_list:
1291
+ if option_flag.name == "project_id":
1292
+ project_id = option_arg
1236
1293
  if option_flag.name == "tool_id":
1237
1294
  tool_id = option_arg
1238
1295
  elif option_flag.name == "tool_name":
@@ -1241,7 +1298,7 @@ def delete_tool(option_list: list):
1241
1298
  if not (tool_id or tool_name):
1242
1299
  raise MissingRequirementException("Either Tool ID or Tool Name must be specified.")
1243
1300
 
1244
- client = ToolClient()
1301
+ client = ToolClient(project_id=project_id)
1245
1302
  result = client.delete_tool(
1246
1303
  tool_id=tool_id,
1247
1304
  tool_name=tool_name
@@ -1250,6 +1307,7 @@ def delete_tool(option_list: list):
1250
1307
 
1251
1308
 
1252
1309
  delete_tool_options = [
1310
+ PROJECT_ID_OPTION,
1253
1311
  Option(
1254
1312
  "tool_id",
1255
1313
  ["--tool-id", "--tid"],
@@ -1266,6 +1324,7 @@ delete_tool_options = [
1266
1324
 
1267
1325
 
1268
1326
  def update_tool(option_list: list):
1327
+ project_id = None
1269
1328
  tool_id = None
1270
1329
  name = None
1271
1330
  description = None
@@ -1281,6 +1340,8 @@ def update_tool(option_list: list):
1281
1340
  upsert = False
1282
1341
 
1283
1342
  for option_flag, option_arg in option_list:
1343
+ if option_flag.name == "project_id":
1344
+ project_id = option_arg
1284
1345
  if option_flag.name == "tool_id":
1285
1346
  tool_id = option_arg
1286
1347
  if option_flag.name == "name":
@@ -1337,7 +1398,7 @@ def update_tool(option_list: list):
1337
1398
 
1338
1399
  tool_parameters = get_tool_parameters(parameters)
1339
1400
 
1340
- client = ToolClient()
1401
+ client = ToolClient(project_id=project_id)
1341
1402
  result = client.update_tool(
1342
1403
  tool_id=tool_id,
1343
1404
  name=name,
@@ -1357,6 +1418,7 @@ def update_tool(option_list: list):
1357
1418
 
1358
1419
 
1359
1420
  update_tool_options = [
1421
+ PROJECT_ID_OPTION,
1360
1422
  Option(
1361
1423
  "tool_id",
1362
1424
  ["--tool-id", "--tid"],
@@ -1439,10 +1501,13 @@ update_tool_options = [
1439
1501
 
1440
1502
 
1441
1503
  def publish_tool_revision(option_list: list):
1504
+ project_id = None
1442
1505
  tool_id = None
1443
1506
  revision = None
1444
1507
 
1445
1508
  for option_flag, option_arg in option_list:
1509
+ if option_flag.name == "project_id":
1510
+ project_id = option_arg
1446
1511
  if option_flag.name == "tool_id":
1447
1512
  tool_id = option_arg
1448
1513
  if option_flag.name == "revision":
@@ -1451,7 +1516,7 @@ def publish_tool_revision(option_list: list):
1451
1516
  if not (tool_id and revision):
1452
1517
  raise MissingRequirementException("Tool ID and revision must be specified.")
1453
1518
 
1454
- client = ToolClient()
1519
+ client = ToolClient(project_id=project_id)
1455
1520
  result = client.publish_tool_revision(
1456
1521
  tool_id=tool_id,
1457
1522
  revision=revision
@@ -1460,6 +1525,7 @@ def publish_tool_revision(option_list: list):
1460
1525
 
1461
1526
 
1462
1527
  publish_tool_revision_options = [
1528
+ PROJECT_ID_OPTION,
1463
1529
  Option(
1464
1530
  "tool_id",
1465
1531
  ["--tool-id", "--tid"],
@@ -1476,6 +1542,7 @@ publish_tool_revision_options = [
1476
1542
 
1477
1543
 
1478
1544
  def get_parameter(option_list: list):
1545
+ project_id = None
1479
1546
  tool_id = None
1480
1547
  tool_public_name = None
1481
1548
  allow_drafts = True
@@ -1483,6 +1550,8 @@ def get_parameter(option_list: list):
1483
1550
  version = 0
1484
1551
 
1485
1552
  for option_flag, option_arg in option_list:
1553
+ if option_flag.name == "project_id":
1554
+ project_id = option_arg
1486
1555
  if option_flag.name == "tool_id":
1487
1556
  tool_id = option_arg
1488
1557
  if option_flag.name == "tool_public_name":
@@ -1497,7 +1566,7 @@ def get_parameter(option_list: list):
1497
1566
  if not (tool_public_name or tool_id):
1498
1567
  raise MissingRequirementException("Tool public name or ID must be specified.")
1499
1568
 
1500
- client = ToolClient()
1569
+ client = ToolClient(project_id=project_id)
1501
1570
  result = client.get_parameter(
1502
1571
  tool_id=tool_id,
1503
1572
  tool_public_name=tool_public_name,
@@ -1509,6 +1578,7 @@ def get_parameter(option_list: list):
1509
1578
 
1510
1579
 
1511
1580
  get_parameter_options = [
1581
+ PROJECT_ID_OPTION,
1512
1582
  Option(
1513
1583
  "tool_id",
1514
1584
  ["--tool-id", "--tid"],
@@ -1543,11 +1613,14 @@ get_parameter_options = [
1543
1613
 
1544
1614
 
1545
1615
  def set_parameter(option_list: list):
1616
+ project_id = None
1546
1617
  tool_public_name = None
1547
1618
  tool_id = None
1548
1619
  parameters = list()
1549
1620
 
1550
1621
  for option_flag, option_arg in option_list:
1622
+ if option_flag.name == "project_id":
1623
+ project_id = option_arg
1551
1624
  if option_flag.name == "tool_id":
1552
1625
  tool_id = option_arg
1553
1626
  if option_flag.name == "tool_public_name":
@@ -1574,7 +1647,7 @@ def set_parameter(option_list: list):
1574
1647
 
1575
1648
  tool_parameters = get_tool_parameters(parameters)
1576
1649
 
1577
- client = ToolClient()
1650
+ client = ToolClient(project_id=project_id)
1578
1651
  result = client.set_parameter(
1579
1652
  tool_id=tool_id,
1580
1653
  tool_public_name=tool_public_name,
@@ -1584,6 +1657,7 @@ def set_parameter(option_list: list):
1584
1657
 
1585
1658
 
1586
1659
  set_parameter_options = [
1660
+ PROJECT_ID_OPTION,
1587
1661
  Option(
1588
1662
  "tool_id",
1589
1663
  ["--tool-id", "--tid"],
@@ -1947,6 +2021,7 @@ get_reasoning_strategy_options = [
1947
2021
 
1948
2022
 
1949
2023
  def create_process(option_list: list):
2024
+ project_id = None
1950
2025
  key = None
1951
2026
  name = None
1952
2027
  description = None
@@ -1960,6 +2035,8 @@ def create_process(option_list: list):
1960
2035
  automatic_publish = False
1961
2036
 
1962
2037
  for option_flag, option_arg in option_list:
2038
+ if option_flag.name == "project_id":
2039
+ project_id = option_arg
1963
2040
  if option_flag.name == "key":
1964
2041
  key = option_arg
1965
2042
  if option_flag.name == "name":
@@ -2052,7 +2129,7 @@ def create_process(option_list: list):
2052
2129
  if not name:
2053
2130
  raise MissingRequirementException("Name must be specified.")
2054
2131
 
2055
- client = AgenticProcessClient()
2132
+ client = AgenticProcessClient(project_id=project_id)
2056
2133
  result = client.create_process(
2057
2134
  key=key,
2058
2135
  name=name,
@@ -2070,6 +2147,7 @@ def create_process(option_list: list):
2070
2147
 
2071
2148
 
2072
2149
  create_process_options = [
2150
+ PROJECT_ID_OPTION,
2073
2151
  Option(
2074
2152
  "key",
2075
2153
  ["--key", "-k"],
@@ -2154,6 +2232,7 @@ create_process_options = [
2154
2232
 
2155
2233
 
2156
2234
  def update_process(option_list: list):
2235
+ project_id = None
2157
2236
  process_id = None
2158
2237
  name = None
2159
2238
  key = None
@@ -2169,6 +2248,8 @@ def update_process(option_list: list):
2169
2248
  upsert = False
2170
2249
 
2171
2250
  for option_flag, option_arg in option_list:
2251
+ if option_flag.name == "project_id":
2252
+ project_id = option_arg
2172
2253
  if option_flag.name == "process_id":
2173
2254
  process_id = option_arg
2174
2255
  if option_flag.name == "name":
@@ -2263,7 +2344,7 @@ def update_process(option_list: list):
2263
2344
  if not (process_id or name):
2264
2345
  raise MissingRequirementException("Either process ID or name must be specified.")
2265
2346
 
2266
- client = AgenticProcessClient()
2347
+ client = AgenticProcessClient(project_id=project_id)
2267
2348
  result = client.update_process(
2268
2349
  process_id=process_id,
2269
2350
  name=name,
@@ -2283,6 +2364,7 @@ def update_process(option_list: list):
2283
2364
 
2284
2365
 
2285
2366
  update_process_options = [
2367
+ PROJECT_ID_OPTION,
2286
2368
  Option(
2287
2369
  "process_id",
2288
2370
  ["--process-id", "--pid"],
@@ -2379,6 +2461,7 @@ update_process_options = [
2379
2461
 
2380
2462
 
2381
2463
  def get_process(option_list: list):
2464
+ project_id = None
2382
2465
  process_id = None
2383
2466
  process_name = None
2384
2467
  revision = "0"
@@ -2386,6 +2469,8 @@ def get_process(option_list: list):
2386
2469
  allow_drafts = True
2387
2470
 
2388
2471
  for option_flag, option_arg in option_list:
2472
+ if option_flag.name == "project_id":
2473
+ project_id = option_arg
2389
2474
  if option_flag.name == "process_id":
2390
2475
  process_id = option_arg
2391
2476
  if option_flag.name == "process_name":
@@ -2400,7 +2485,7 @@ def get_process(option_list: list):
2400
2485
  if not (process_id or process_name):
2401
2486
  raise MissingRequirementException("Either process ID or process name must be specified.")
2402
2487
 
2403
- client = AgenticProcessClient()
2488
+ client = AgenticProcessClient(project_id=project_id)
2404
2489
  result = client.get_process(
2405
2490
  process_id=process_id,
2406
2491
  process_name=process_name,
@@ -2412,6 +2497,7 @@ def get_process(option_list: list):
2412
2497
 
2413
2498
 
2414
2499
  get_process_options = [
2500
+ PROJECT_ID_OPTION,
2415
2501
  Option(
2416
2502
  "process_id",
2417
2503
  ["--process-id", "--pid"],
@@ -2446,6 +2532,7 @@ get_process_options = [
2446
2532
 
2447
2533
 
2448
2534
  def list_processes(option_list: list):
2535
+ project_id = None
2449
2536
  id = None
2450
2537
  name = None
2451
2538
  status = None
@@ -2454,6 +2541,8 @@ def list_processes(option_list: list):
2454
2541
  allow_draft = True
2455
2542
 
2456
2543
  for option_flag, option_arg in option_list:
2544
+ if option_flag.name == "project_id":
2545
+ project_id = option_arg
2457
2546
  if option_flag.name == "id":
2458
2547
  id = option_arg
2459
2548
  if option_flag.name == "name":
@@ -2467,7 +2556,7 @@ def list_processes(option_list: list):
2467
2556
  if option_flag.name == "allow_draft":
2468
2557
  allow_draft = get_boolean_value(option_arg)
2469
2558
 
2470
- client = AgenticProcessClient()
2559
+ client = AgenticProcessClient(project_id=project_id)
2471
2560
  result = client.list_processes(
2472
2561
  id=id,
2473
2562
  name=name,
@@ -2480,6 +2569,7 @@ def list_processes(option_list: list):
2480
2569
 
2481
2570
 
2482
2571
  list_processes_options = [
2572
+ PROJECT_ID_OPTION,
2483
2573
  Option(
2484
2574
  "id",
2485
2575
  ["--id"],
@@ -2520,12 +2610,15 @@ list_processes_options = [
2520
2610
 
2521
2611
 
2522
2612
  def list_processes_instances(option_list: list):
2613
+ project_id = None
2523
2614
  process_id = None
2524
2615
  is_active = True
2525
2616
  start = "0"
2526
2617
  count = "10"
2527
2618
 
2528
2619
  for option_flag, option_arg in option_list:
2620
+ if option_flag.name == "project_id":
2621
+ project_id = option_arg
2529
2622
  if option_flag.name == "process_id":
2530
2623
  process_id = option_arg
2531
2624
  if option_flag.name == "is_active":
@@ -2538,7 +2631,7 @@ def list_processes_instances(option_list: list):
2538
2631
  if not process_id:
2539
2632
  raise MissingRequirementException("Process ID must be specified.")
2540
2633
 
2541
- client = AgenticProcessClient()
2634
+ client = AgenticProcessClient(project_id=project_id)
2542
2635
  result = client.list_process_instances(
2543
2636
  process_id=process_id,
2544
2637
  is_active=is_active,
@@ -2549,6 +2642,7 @@ def list_processes_instances(option_list: list):
2549
2642
 
2550
2643
 
2551
2644
  list_processes_instances_options = [
2645
+ PROJECT_ID_OPTION,
2552
2646
  Option(
2553
2647
  "process_id",
2554
2648
  ["--process-id", "--pid"],
@@ -2577,10 +2671,13 @@ list_processes_instances_options = [
2577
2671
 
2578
2672
 
2579
2673
  def delete_process(option_list: list):
2674
+ project_id = None
2580
2675
  process_id = None
2581
2676
  process_name = None
2582
2677
 
2583
2678
  for option_flag, option_arg in option_list:
2679
+ if option_flag.name == "project_id":
2680
+ project_id = option_arg
2584
2681
  if option_flag.name == "process_id":
2585
2682
  process_id = option_arg
2586
2683
  if option_flag.name == "process_name":
@@ -2589,7 +2686,7 @@ def delete_process(option_list: list):
2589
2686
  if not (process_id or process_name):
2590
2687
  raise MissingRequirementException("Either process ID or process name must be specified.")
2591
2688
 
2592
- client = AgenticProcessClient()
2689
+ client = AgenticProcessClient(project_id=project_id)
2593
2690
  result = client.delete_process(
2594
2691
  process_id=process_id,
2595
2692
  process_name=process_name
@@ -2598,6 +2695,7 @@ def delete_process(option_list: list):
2598
2695
 
2599
2696
 
2600
2697
  delete_process_options = [
2698
+ PROJECT_ID_OPTION,
2601
2699
  Option(
2602
2700
  "process_id",
2603
2701
  ["--process-id", "--pid"],
@@ -2614,11 +2712,14 @@ delete_process_options = [
2614
2712
 
2615
2713
 
2616
2714
  def publish_process_revision(option_list: list):
2715
+ project_id = None
2617
2716
  process_id = None
2618
2717
  process_name = None
2619
2718
  revision = None
2620
2719
 
2621
2720
  for option_flag, option_arg in option_list:
2721
+ if option_flag.name == "project_id":
2722
+ project_id = option_arg
2622
2723
  if option_flag.name == "process_id":
2623
2724
  process_id = option_arg
2624
2725
  if option_flag.name == "process_name":
@@ -2631,7 +2732,7 @@ def publish_process_revision(option_list: list):
2631
2732
  if not revision:
2632
2733
  raise MissingRequirementException("Revision must be specified.")
2633
2734
 
2634
- client = AgenticProcessClient()
2735
+ client = AgenticProcessClient(project_id=project_id)
2635
2736
  result = client.publish_process_revision(
2636
2737
  process_id=process_id,
2637
2738
  process_name=process_name,
@@ -2641,6 +2742,7 @@ def publish_process_revision(option_list: list):
2641
2742
 
2642
2743
 
2643
2744
  publish_process_revision_options = [
2745
+ PROJECT_ID_OPTION,
2644
2746
  Option(
2645
2747
  "process_id",
2646
2748
  ["--process-id", "--pid"],
@@ -2666,6 +2768,7 @@ publish_process_revision_options = [
2666
2768
 
2667
2769
 
2668
2770
  def create_task(option_list: list):
2771
+ project_id = None
2669
2772
  name = None
2670
2773
  description = None
2671
2774
  title_template = None
@@ -2675,6 +2778,8 @@ def create_task(option_list: list):
2675
2778
  automatic_publish = False
2676
2779
 
2677
2780
  for option_flag, option_arg in option_list:
2781
+ if option_flag.name == "project_id":
2782
+ project_id = option_arg
2678
2783
  if option_flag.name == "name":
2679
2784
  name = option_arg
2680
2785
  if option_flag.name == "description":
@@ -2703,7 +2808,7 @@ def create_task(option_list: list):
2703
2808
  if not name:
2704
2809
  raise MissingRequirementException("Task name must be specified.")
2705
2810
 
2706
- client = AgenticProcessClient()
2811
+ client = AgenticProcessClient(project_id=project_id)
2707
2812
  result = client.create_task(
2708
2813
  name=name,
2709
2814
  description=description,
@@ -2717,6 +2822,7 @@ def create_task(option_list: list):
2717
2822
 
2718
2823
 
2719
2824
  create_task_options = [
2825
+ PROJECT_ID_OPTION,
2720
2826
  Option(
2721
2827
  "name",
2722
2828
  ["--name", "-n"],
@@ -2763,10 +2869,13 @@ create_task_options = [
2763
2869
 
2764
2870
 
2765
2871
  def get_task(option_list: list):
2872
+ project_id = None
2766
2873
  task_id = None
2767
2874
  task_name = None
2768
2875
 
2769
2876
  for option_flag, option_arg in option_list:
2877
+ if option_flag.name == "project_id":
2878
+ project_id = option_arg
2770
2879
  if option_flag.name == "task_id":
2771
2880
  task_id = option_arg
2772
2881
  if option_flag.name == "task_name":
@@ -2775,7 +2884,7 @@ def get_task(option_list: list):
2775
2884
  if not (task_id or task_name):
2776
2885
  raise MissingRequirementException("Either task ID or task name must be specified.")
2777
2886
 
2778
- client = AgenticProcessClient()
2887
+ client = AgenticProcessClient(project_id=project_id)
2779
2888
  result = client.get_task(
2780
2889
  task_id=task_id,
2781
2890
  task_name=task_name
@@ -2784,6 +2893,7 @@ def get_task(option_list: list):
2784
2893
 
2785
2894
 
2786
2895
  get_task_options = [
2896
+ PROJECT_ID_OPTION,
2787
2897
  Option(
2788
2898
  "task_id",
2789
2899
  ["--task-id", "--tid"],
@@ -2800,12 +2910,15 @@ get_task_options = [
2800
2910
 
2801
2911
 
2802
2912
  def list_tasks(option_list: list):
2913
+ project_id = None
2803
2914
  id = None
2804
2915
  start = "0"
2805
2916
  count = "100"
2806
2917
  allow_drafts = True
2807
2918
 
2808
2919
  for option_flag, option_arg in option_list:
2920
+ if option_flag.name == "project_id":
2921
+ project_id = option_arg
2809
2922
  if option_flag.name == "id":
2810
2923
  id = option_arg
2811
2924
  if option_flag.name == "start":
@@ -2815,7 +2928,7 @@ def list_tasks(option_list: list):
2815
2928
  if option_flag.name == "allow_drafts":
2816
2929
  allow_drafts = get_boolean_value(option_arg)
2817
2930
 
2818
- client = AgenticProcessClient()
2931
+ client = AgenticProcessClient(project_id=project_id)
2819
2932
  result = client.list_tasks(
2820
2933
  id=id,
2821
2934
  start=start,
@@ -2826,6 +2939,7 @@ def list_tasks(option_list: list):
2826
2939
 
2827
2940
 
2828
2941
  list_tasks_options = [
2942
+ PROJECT_ID_OPTION,
2829
2943
  Option(
2830
2944
  "id",
2831
2945
  ["--id"],
@@ -2854,6 +2968,7 @@ list_tasks_options = [
2854
2968
 
2855
2969
 
2856
2970
  def update_task(option_list: list):
2971
+ project_id = None
2857
2972
  task_id = None
2858
2973
  name = None
2859
2974
  description = None
@@ -2865,6 +2980,8 @@ def update_task(option_list: list):
2865
2980
  upsert = False
2866
2981
 
2867
2982
  for option_flag, option_arg in option_list:
2983
+ if option_flag.name == "project_id":
2984
+ project_id = option_arg
2868
2985
  if option_flag.name == "task_id":
2869
2986
  task_id = option_arg
2870
2987
  if option_flag.name == "name":
@@ -2897,7 +3014,7 @@ def update_task(option_list: list):
2897
3014
  if not (task_id or name):
2898
3015
  raise MissingRequirementException("Either task ID or name must be specified.")
2899
3016
 
2900
- client = AgenticProcessClient()
3017
+ client = AgenticProcessClient(project_id=project_id)
2901
3018
  result = client.update_task(
2902
3019
  task_id=task_id,
2903
3020
  name=name,
@@ -2913,6 +3030,7 @@ def update_task(option_list: list):
2913
3030
 
2914
3031
 
2915
3032
  update_task_options = [
3033
+ PROJECT_ID_OPTION,
2916
3034
  Option(
2917
3035
  "task_id",
2918
3036
  ["--task-id", "--tid"],
@@ -2971,10 +3089,13 @@ update_task_options = [
2971
3089
 
2972
3090
 
2973
3091
  def delete_task(option_list: list):
3092
+ project_id = None
2974
3093
  task_id = None
2975
3094
  task_name = None
2976
3095
 
2977
3096
  for option_flag, option_arg in option_list:
3097
+ if option_flag.name == "project_id":
3098
+ project_id = option_arg
2978
3099
  if option_flag.name == "task_id":
2979
3100
  task_id = option_arg
2980
3101
  if option_flag.name == "task_name":
@@ -2983,7 +3104,7 @@ def delete_task(option_list: list):
2983
3104
  if not (task_id or task_name):
2984
3105
  raise MissingRequirementException("Either task ID or task name must be specified.")
2985
3106
 
2986
- client = AgenticProcessClient()
3107
+ client = AgenticProcessClient(project_id=project_id)
2987
3108
  result = client.delete_task(
2988
3109
  task_id=task_id,
2989
3110
  task_name = task_name
@@ -2992,6 +3113,7 @@ def delete_task(option_list: list):
2992
3113
 
2993
3114
 
2994
3115
  delete_task_options = [
3116
+ PROJECT_ID_OPTION,
2995
3117
  Option(
2996
3118
  "task_id",
2997
3119
  ["--task-id", "--tid"],
@@ -3008,11 +3130,14 @@ delete_task_options = [
3008
3130
 
3009
3131
 
3010
3132
  def publish_task_revision(option_list: list):
3133
+ project_id = None
3011
3134
  task_id = None
3012
3135
  task_name = None
3013
3136
  revision = None
3014
3137
 
3015
3138
  for option_flag, option_arg in option_list:
3139
+ if option_flag.name == "project_id":
3140
+ project_id = option_arg
3016
3141
  if option_flag.name == "task_id":
3017
3142
  task_id = option_arg
3018
3143
  if option_flag.name == "task_name":
@@ -3025,7 +3150,7 @@ def publish_task_revision(option_list: list):
3025
3150
  if not revision:
3026
3151
  raise MissingRequirementException("Revision must be specified.")
3027
3152
 
3028
- client = AgenticProcessClient()
3153
+ client = AgenticProcessClient(project_id=project_id)
3029
3154
  result = client.publish_task_revision(
3030
3155
  task_id=task_id,
3031
3156
  task_name=task_name,
@@ -3035,6 +3160,7 @@ def publish_task_revision(option_list: list):
3035
3160
 
3036
3161
 
3037
3162
  publish_task_revision_options = [
3163
+ PROJECT_ID_OPTION,
3038
3164
  Option(
3039
3165
  "task_id",
3040
3166
  ["--task-id", "--tid"],
@@ -3058,11 +3184,14 @@ publish_task_revision_options = [
3058
3184
 
3059
3185
  # RUNTIME - Process instances
3060
3186
  def start_instance(option_list: list):
3187
+ project_id = None
3061
3188
  process_name = None
3062
3189
  subject = None
3063
3190
  variables = None
3064
3191
 
3065
3192
  for option_flag, option_arg in option_list:
3193
+ if option_flag.name == "project_id":
3194
+ project_id = option_arg
3066
3195
  if option_flag.name == "process_name":
3067
3196
  process_name = option_arg
3068
3197
  if option_flag.name == "subject":
@@ -3080,7 +3209,7 @@ def start_instance(option_list: list):
3080
3209
  if not process_name:
3081
3210
  raise MissingRequirementException("Process name must be specified.")
3082
3211
 
3083
- client = AgenticProcessClient()
3212
+ client = AgenticProcessClient(project_id=project_id)
3084
3213
  result = client.start_instance(
3085
3214
  process_name=process_name,
3086
3215
  subject=subject,
@@ -3090,6 +3219,7 @@ def start_instance(option_list: list):
3090
3219
 
3091
3220
 
3092
3221
  start_instance_options = [
3222
+ PROJECT_ID_OPTION,
3093
3223
  Option(
3094
3224
  "process_name",
3095
3225
  ["--process-name", "--pn"],
@@ -3112,16 +3242,19 @@ start_instance_options = [
3112
3242
 
3113
3243
 
3114
3244
  def abort_instance(option_list: list):
3245
+ project_id = None
3115
3246
  instance_id = None
3116
3247
 
3117
3248
  for option_flag, option_arg in option_list:
3249
+ if option_flag.name == "project_id":
3250
+ project_id = option_arg
3118
3251
  if option_flag.name == "instance_id":
3119
3252
  instance_id = option_arg
3120
3253
 
3121
3254
  if not instance_id:
3122
3255
  raise MissingRequirementException("Instance ID must be specified.")
3123
3256
 
3124
- client = AgenticProcessClient()
3257
+ client = AgenticProcessClient(project_id=project_id)
3125
3258
  result = client.abort_instance(
3126
3259
  instance_id=instance_id
3127
3260
  )
@@ -3129,6 +3262,7 @@ def abort_instance(option_list: list):
3129
3262
 
3130
3263
 
3131
3264
  abort_instance_options = [
3265
+ PROJECT_ID_OPTION,
3132
3266
  Option(
3133
3267
  "instance_id",
3134
3268
  ["--instance-id", "--iid"],
@@ -3139,16 +3273,19 @@ abort_instance_options = [
3139
3273
 
3140
3274
 
3141
3275
  def get_instance(option_list: list):
3276
+ project_id = None
3142
3277
  instance_id = None
3143
3278
 
3144
3279
  for option_flag, option_arg in option_list:
3280
+ if option_flag.name == "project_id":
3281
+ project_id = option_arg
3145
3282
  if option_flag.name == "instance_id":
3146
3283
  instance_id = option_arg
3147
3284
 
3148
3285
  if not instance_id:
3149
3286
  raise MissingRequirementException("Instance ID must be specified.")
3150
3287
 
3151
- client = AgenticProcessClient()
3288
+ client = AgenticProcessClient(project_id=project_id)
3152
3289
  result = client.get_instance(
3153
3290
  instance_id=instance_id
3154
3291
  )
@@ -3156,6 +3293,7 @@ def get_instance(option_list: list):
3156
3293
 
3157
3294
 
3158
3295
  get_instance_options = [
3296
+ PROJECT_ID_OPTION,
3159
3297
  Option(
3160
3298
  "instance_id",
3161
3299
  ["--instance-id", "--iid"],
@@ -3166,16 +3304,19 @@ get_instance_options = [
3166
3304
 
3167
3305
 
3168
3306
  def get_instance_history(option_list: list):
3307
+ project_id = None
3169
3308
  instance_id = None
3170
3309
 
3171
3310
  for option_flag, option_arg in option_list:
3311
+ if option_flag.name == "project_id":
3312
+ project_id = option_arg
3172
3313
  if option_flag.name == "instance_id":
3173
3314
  instance_id = option_arg
3174
3315
 
3175
3316
  if not instance_id:
3176
3317
  raise MissingRequirementException("Instance ID must be specified.")
3177
3318
 
3178
- client = AgenticProcessClient()
3319
+ client = AgenticProcessClient(project_id=project_id)
3179
3320
  result = client.get_instance_history(
3180
3321
  instance_id=instance_id
3181
3322
  )
@@ -3183,6 +3324,7 @@ def get_instance_history(option_list: list):
3183
3324
 
3184
3325
 
3185
3326
  get_instance_history_options = [
3327
+ PROJECT_ID_OPTION,
3186
3328
  Option(
3187
3329
  "instance_id",
3188
3330
  ["--instance-id", "--iid"],
@@ -3192,16 +3334,19 @@ get_instance_history_options = [
3192
3334
  ]
3193
3335
 
3194
3336
  def get_thread_information(option_list: list):
3337
+ project_id = None
3195
3338
  thread_id = None
3196
3339
 
3197
3340
  for option_flag, option_arg in option_list:
3341
+ if option_flag.name == "project_id":
3342
+ project_id = option_arg
3198
3343
  if option_flag.name == "thread_id":
3199
3344
  thread_id = option_arg
3200
3345
 
3201
3346
  if not thread_id:
3202
3347
  raise MissingRequirementException("Thread ID must be specified.")
3203
3348
 
3204
- client = AgenticProcessClient()
3349
+ client = AgenticProcessClient(project_id=project_id)
3205
3350
  result = client.get_thread_information(
3206
3351
  thread_id=thread_id
3207
3352
  )
@@ -3209,6 +3354,7 @@ def get_thread_information(option_list: list):
3209
3354
 
3210
3355
 
3211
3356
  get_thread_information_options = [
3357
+ PROJECT_ID_OPTION,
3212
3358
  Option(
3213
3359
  "thread_id",
3214
3360
  ["--thread-id", "--tid"],
@@ -3219,10 +3365,13 @@ get_thread_information_options = [
3219
3365
 
3220
3366
 
3221
3367
  def send_user_signal(option_list: list):
3368
+ project_id = None
3222
3369
  instance_id = None
3223
3370
  signal_name = None
3224
3371
 
3225
3372
  for option_flag, option_arg in option_list:
3373
+ if option_flag.name == "project_id":
3374
+ project_id = option_arg
3226
3375
  if option_flag.name == "instance_id":
3227
3376
  instance_id = option_arg
3228
3377
  if option_flag.name == "signal_name":
@@ -3233,7 +3382,7 @@ def send_user_signal(option_list: list):
3233
3382
  if not signal_name:
3234
3383
  raise MissingRequirementException("Signal name must be specified.")
3235
3384
 
3236
- client = AgenticProcessClient()
3385
+ client = AgenticProcessClient(project_id=project_id)
3237
3386
  result = client.send_user_signal(
3238
3387
  instance_id=instance_id,
3239
3388
  signal_name=signal_name
@@ -3242,6 +3391,7 @@ def send_user_signal(option_list: list):
3242
3391
 
3243
3392
 
3244
3393
  send_user_signal_options = [
3394
+ PROJECT_ID_OPTION,
3245
3395
  Option(
3246
3396
  "instance_id",
3247
3397
  ["--instance-id", "--iid"],
@@ -3260,11 +3410,14 @@ send_user_signal_options = [
3260
3410
 
3261
3411
 
3262
3412
  def create_kb(option_list: list):
3413
+ project_id = None
3263
3414
  name = None
3264
3415
  artifacts = None
3265
3416
  metadata = None
3266
3417
 
3267
3418
  for option_flag, option_arg in option_list:
3419
+ if option_flag.name == "project_id":
3420
+ project_id = option_arg
3268
3421
  if option_flag.name == "name":
3269
3422
  name = option_arg
3270
3423
  if option_flag.name == "artifacts":
@@ -3289,7 +3442,7 @@ def create_kb(option_list: list):
3289
3442
  if not name:
3290
3443
  raise MissingRequirementException("Name must be specified.")
3291
3444
 
3292
- client = AgenticProcessClient()
3445
+ client = AgenticProcessClient(project_id=project_id)
3293
3446
  result = client.create_kb(
3294
3447
  name=name,
3295
3448
  artifacts=artifacts,
@@ -3299,6 +3452,7 @@ def create_kb(option_list: list):
3299
3452
 
3300
3453
 
3301
3454
  create_kb_options = [
3455
+ PROJECT_ID_OPTION,
3302
3456
  Option(
3303
3457
  "name",
3304
3458
  ["--name", "-n"],
@@ -3321,10 +3475,13 @@ create_kb_options = [
3321
3475
 
3322
3476
 
3323
3477
  def get_kb(option_list: list):
3478
+ project_id = None
3324
3479
  kb_id = None
3325
3480
  kb_name = None
3326
3481
 
3327
3482
  for option_flag, option_arg in option_list:
3483
+ if option_flag.name == "project_id":
3484
+ project_id = option_arg
3328
3485
  if option_flag.name == "kb_id":
3329
3486
  kb_id = option_arg
3330
3487
  if option_flag.name == "kb_name":
@@ -3333,7 +3490,7 @@ def get_kb(option_list: list):
3333
3490
  if not (kb_id or kb_name):
3334
3491
  raise MissingRequirementException("Either KB ID or KB name must be specified.")
3335
3492
 
3336
- client = AgenticProcessClient()
3493
+ client = AgenticProcessClient(project_id=project_id)
3337
3494
  result = client.get_kb(
3338
3495
  kb_id=kb_id,
3339
3496
  kb_name=kb_name
@@ -3342,6 +3499,7 @@ def get_kb(option_list: list):
3342
3499
 
3343
3500
 
3344
3501
  get_kb_options = [
3502
+ PROJECT_ID_OPTION,
3345
3503
  Option(
3346
3504
  "kb_id",
3347
3505
  ["--kb-id", "--kid"],
@@ -3358,11 +3516,14 @@ get_kb_options = [
3358
3516
 
3359
3517
 
3360
3518
  def list_kbs(option_list: list):
3519
+ project_id = None
3361
3520
  name = None
3362
3521
  start = "0"
3363
3522
  count = "100"
3364
3523
 
3365
3524
  for option_flag, option_arg in option_list:
3525
+ if option_flag.name == "project_id":
3526
+ project_id = option_arg
3366
3527
  if option_flag.name == "name":
3367
3528
  name = option_arg
3368
3529
  if option_flag.name == "start":
@@ -3370,7 +3531,7 @@ def list_kbs(option_list: list):
3370
3531
  if option_flag.name == "count":
3371
3532
  count = option_arg
3372
3533
 
3373
- client = AgenticProcessClient()
3534
+ client = AgenticProcessClient(project_id=project_id)
3374
3535
  result = client.list_kbs(
3375
3536
  name=name,
3376
3537
  start=start,
@@ -3380,6 +3541,7 @@ def list_kbs(option_list: list):
3380
3541
 
3381
3542
 
3382
3543
  list_kbs_options = [
3544
+ PROJECT_ID_OPTION,
3383
3545
  Option(
3384
3546
  "name",
3385
3547
  ["--name", "-n"],
@@ -3402,10 +3564,13 @@ list_kbs_options = [
3402
3564
 
3403
3565
 
3404
3566
  def delete_kb(option_list: list):
3567
+ project_id = None
3405
3568
  kb_id = None
3406
3569
  kb_name = None
3407
3570
 
3408
3571
  for option_flag, option_arg in option_list:
3572
+ if option_flag.name == "project_id":
3573
+ project_id = option_arg
3409
3574
  if option_flag.name == "kb_id":
3410
3575
  kb_id = option_arg
3411
3576
  if option_flag.name == "kb_name":
@@ -3414,7 +3579,7 @@ def delete_kb(option_list: list):
3414
3579
  if not (kb_id or kb_name):
3415
3580
  raise MissingRequirementException("Either KB ID or KB name must be specified.")
3416
3581
 
3417
- client = AgenticProcessClient()
3582
+ client = AgenticProcessClient(project_id=project_id)
3418
3583
  result = client.delete_kb(
3419
3584
  kb_id=kb_id,
3420
3585
  kb_name=kb_name
@@ -3423,6 +3588,7 @@ def delete_kb(option_list: list):
3423
3588
 
3424
3589
 
3425
3590
  delete_kb_options = [
3591
+ PROJECT_ID_OPTION,
3426
3592
  Option(
3427
3593
  "kb_id",
3428
3594
  ["--kb-id", "--kid"],
@@ -3441,6 +3607,7 @@ delete_kb_options = [
3441
3607
 
3442
3608
 
3443
3609
  def list_jobs(option_list: list):
3610
+ project_id = None
3444
3611
  start = "0"
3445
3612
  count = "100"
3446
3613
  topic = None
@@ -3448,6 +3615,8 @@ def list_jobs(option_list: list):
3448
3615
  name = None
3449
3616
 
3450
3617
  for option_flag, option_arg in option_list:
3618
+ if option_flag.name == "project_id":
3619
+ project_id = option_arg
3451
3620
  if option_flag.name == "start":
3452
3621
  start = option_arg
3453
3622
  if option_flag.name == "count":
@@ -3459,7 +3628,7 @@ def list_jobs(option_list: list):
3459
3628
  if option_flag.name == "name":
3460
3629
  name = option_arg
3461
3630
 
3462
- client = AgenticProcessClient()
3631
+ client = AgenticProcessClient(project_id=project_id)
3463
3632
  result = client.list_jobs(
3464
3633
  start=start,
3465
3634
  count=count,
@@ -3471,6 +3640,7 @@ def list_jobs(option_list: list):
3471
3640
 
3472
3641
 
3473
3642
  list_jobs_options = [
3643
+ PROJECT_ID_OPTION,
3474
3644
  Option(
3475
3645
  "start",
3476
3646
  ["--start", "-s"],