@@ -285,7 +285,7 @@ data class ProcessOptions(
285
285
*/
286
286
class Builder internal constructor() {
287
287
288
- private var processOptions = ProcessOptions . DEFAULT
288
+ private var processOptions = DEFAULT
289
289
290
290
/* *
291
291
* Set the context identifier to use for the invocation. Can be null.
@@ -300,6 +300,16 @@ data class ProcessOptions(
300
300
return this
301
301
}
302
302
303
+ /* *
304
+ * Sets the identities associated with the process.
305
+ * @param identities the identities
306
+ * @return this [Builder]
307
+ */
308
+ fun identities (identities : Identities ): Builder {
309
+ this .processOptions = processOptions.copy(identities = identities)
310
+ return this
311
+ }
312
+
303
313
/* *
304
314
* An existing blackboard to use for this invocation.
305
315
* By default, it will be modified as the process runs.
@@ -387,6 +397,40 @@ data class ProcessOptions(
387
397
return this
388
398
}
389
399
400
+ /* *
401
+ * Whether to prune the agent to only relevant actions
402
+ * @param prune true to prune the agent to only relevant actions
403
+ * @return this [Builder]
404
+ */
405
+ fun prune (prune : Boolean ): Builder {
406
+ this .processOptions = processOptions.copy(prune = prune)
407
+ return this
408
+ }
409
+
410
+ /* *
411
+ * Add a listener to the list of [AgenticEventListener]s.
412
+ * @param listener the listener to add
413
+ * @return this [Builder]
414
+ */
415
+ fun listener (listener : AgenticEventListener ): Builder {
416
+ val listeners = this .processOptions.listeners + listener
417
+ this .processOptions = processOptions.copy(listeners = listeners)
418
+ return this
419
+ }
420
+
421
+ /* *
422
+ * Manipulate the listeners with the given consumer.
423
+ * The list provided to the consumer can be used to remove listeners, change ordering, etc.
424
+ * @param listener the listener to add
425
+ * @return this [Builder]
426
+ */
427
+ fun listeners (consumer : Consumer <List <AgenticEventListener >>): Builder {
428
+ val listeners = this .processOptions.listeners.toMutableList()
429
+ consumer.accept(listeners)
430
+ this .processOptions = processOptions.copy(listeners = listeners)
431
+ return this
432
+ }
433
+
390
434
/* *
391
435
* Build the [ProcessOptions].
392
436
* @return a newly built [ProcessOptions]
0 commit comments