File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ All notable changes to Parlant will be documented here.
16
16
- Add a log command under client CLI for streaming logs
17
17
- Modified ToolCaller shot schema
18
18
- Fix ToolCaller making up argument values when it doesn't have them
19
+ - Allow only specifying guideline condition or action when updating guideline from CLI
19
20
20
21
21
22
## [ 1.5.1] - 2025-01-05
Original file line number Diff line number Diff line change @@ -366,10 +366,18 @@ def update_guideline(
366
366
action : str ,
367
367
check : bool ,
368
368
index : bool ,
369
- updated_id : Optional [ str ] = None ,
369
+ updated_id : str ,
370
370
) -> GuidelineWithConnectionsAndToolAssociations :
371
371
client = cast (ParlantClient , ctx .obj .client )
372
372
373
+ if not (condition and action ):
374
+ retrived_guideline = client .guidelines .retrieve (
375
+ agent_id = agent_id , guideline_id = updated_id
376
+ )
377
+
378
+ condition = condition or retrived_guideline .guideline .condition
379
+ action = action or retrived_guideline .guideline .action
380
+
373
381
evaluation = client .evaluations .create (
374
382
agent_id = agent_id ,
375
383
payloads = [
@@ -2429,13 +2437,13 @@ def guideline_create(
2429
2437
"--condition" ,
2430
2438
type = str ,
2431
2439
help = "A statement describing when the guideline should apply" ,
2432
- required = True ,
2440
+ required = False ,
2433
2441
)
2434
2442
@click .option (
2435
2443
"--action" ,
2436
2444
type = str ,
2437
2445
help = "The instruction to perform when the guideline applies" ,
2438
- required = True ,
2446
+ required = False ,
2439
2447
)
2440
2448
@click .option (
2441
2449
"--agent-id" ,
@@ -2468,6 +2476,10 @@ def guideline_update(
2468
2476
check : bool ,
2469
2477
connect : bool ,
2470
2478
) -> None :
2479
+ if not (condition or action ):
2480
+ Interface .write_error ("At least one of --condition or --action must be specified" )
2481
+ raise FastExit ()
2482
+
2471
2483
agent_id = agent_id if agent_id else Interface .get_default_agent (ctx )
2472
2484
assert agent_id
2473
2485
You can’t perform that action at this time.
0 commit comments