@@ -133,6 +133,8 @@ public open class AIAgent<Input, Output>(
133
133
134
134
private val pipeline = AIAgentPipeline ()
135
135
136
+ // Uuid.random is using secure random, therefore, must be initialized at runtime when performing a native build
137
+ // More about Java secure random and GrallVM: https://www.graalvm.org/jdk24/reference-manual/native-image/dynamic-features/JCASecurityServices/
136
138
override val id: String by lazy { id ? : Uuid .random().toString() }
137
139
138
140
init {
@@ -459,7 +461,7 @@ public inline fun <reified Input, reified Output> AIAgent(
459
461
promptExecutor : PromptExecutor ,
460
462
strategy : AIAgentStrategy <Input , Output >,
461
463
agentConfig : AIAgentConfigBase ,
462
- id : String = Uuid .random().toString() ,
464
+ id : String? = null ,
463
465
toolRegistry : ToolRegistry = ToolRegistry .EMPTY ,
464
466
clock : Clock = Clock .System ,
465
467
noinline installFeatures : FeatureContext .() -> Unit = {},
@@ -493,7 +495,7 @@ public inline fun <reified Input, reified Output> AIAgent(
493
495
public fun AIAgent (
494
496
executor : PromptExecutor ,
495
497
llmModel : LLModel ,
496
- id : String = Uuid .random().toString() ,
498
+ id : String? = null ,
497
499
strategy : AIAgentStrategy <String , String > = singleRunStrategy(),
498
500
systemPrompt : String = "",
499
501
temperature : Double = 1.0,
0 commit comments