replaceSystemMessage

fun Prompt.replaceSystemMessage(id: String = this.id, systemMessageEditor: (String) -> String): Prompt

Create a new Prompt object with the same messages, except for the system prompt.

Edits every system message. A prompt taken from inside a fresh optimizable subgraph has two (the inherited agent-level one and the module instruction) — see optimizableSubgraphWithTask.