Cyclium.Synthesizer.PromptBuilder (Cyclium v0.2.1)

Copy Markdown View Source

Builds system prompts for interactive actors from strategy_config.

Generates the boilerplate JSON schema instructions, tool/action documentation, and response format guidance. The consuming app only needs to provide a short role description and domain-specific guidelines.

Usage

In strategy_config:

strategy_config: %{
  role: "You are a Client Support Assistant for a SaaS health monitoring platform.",
  guidelines: [
    "If the user asks about a specific client by name, first use list_clients to find the ID",
    "Keep explanations concise and helpful"
  ],
  allowed_tool_signatures: [
    %{
      name: "client_support",
      side_effect: "write",
      actions: [
        %{name: "lookup_client", args: %{"client_id" => "UUID"}, description: "get full details for one client"},
        %{name: "list_clients", args: %{}, description: "list all clients with summary"},
        %{name: "initiate_health_check", args: %{"client_id" => "UUID"}, description: "trigger a full health review workflow", risk: "medium"}
      ]
    }
  ]
}

The Interactive synthesizer calls build_system_prompt/1 when strategy_config has a role key instead of (or in addition to) a system_prompt key.

Summary

Functions

Build a complete system prompt from strategy_config.

Functions

build(config)

Build a complete system prompt from strategy_config.

If the config has a "system_prompt" key, returns it as-is (backwards compatible). If it has a "role" key, generates the full prompt from role + tool signatures + guidelines.