updateInstructions

abstract fun updateInstructions(instructions: List<KarlInstruction>)(source)

Updates the user-defined instructions that customize container behavior.

This method enables dynamic modification of user instructions without requiring container restart or reinitialization. Instructions influence all aspects of container behavior including learning preferences, prediction filtering, privacy controls, and user experience customization.

Instruction update process:

  1. Validation: Verify instruction syntax and compatibility with current system

  2. Conflict resolution: Handle conflicting instructions using priority rules

  3. Component notification: Distribute updated instructions to all container components

  4. Immediate application: Apply new instructions to ongoing operations

  5. Persistence: Save updated instructions for future container sessions

Dynamic instruction capabilities:

  • Learning preferences: Modify focus areas, learning rates, and pattern priorities

  • Prediction filters: Update confidence thresholds, suggestion types, and content filters

  • Privacy controls: Adjust data collection, retention, and usage policies

  • UI customization: Change presentation styles, notification preferences, and interaction modes

  • Performance tuning: Modify resource usage, scheduling, and optimization parameters

Instruction processing and application:

  • Real-time updates: New instructions take effect immediately for subsequent operations

  • Backward compatibility: Historical data interpretation may be affected by instruction changes

  • Component coordination: All container components receive and apply updated instructions

  • Validation feedback: Invalid instructions are rejected with detailed error information

Thread safety and concurrency:

  • Safe to call concurrently with other container operations

  • Atomic instruction updates prevent partial application of changes

  • Proper synchronization with ongoing learning and prediction operations

  • Consistent instruction state across all component interactions

Parameters

instructions

The updated list of KarlInstruction objects that define new behavior preferences and constraints. The complete list replaces any previously configured instructions, so include all desired instructions in each update call.

See also

for instruction format and available types

for initial instruction configuration

Throws

IllegalArgumentException

if any instruction is malformed or incompatible

ValidationException

if instruction conflicts cannot be resolved

IllegalStateException

if container is not properly initialized