Skip to main content

prepend_protocol_instructions

Function prepend_protocol_instructions 

Source
pub fn prepend_protocol_instructions(
    prompt: &str,
    profile: ProtocolRequestProfile,
    schema_instruction_mode: ProtocolSchemaInstructionMode,
    workspace_root: &Path,
) -> String
Expand description

Prepends structured response protocol instructions to a prompt.

Tells agents to emit one top-level JSON object that matches Agentty’s structured protocol while selecting the cheapest safe schema guidance for the current provider. Providers without native structured output receive the full JSON Schema in the prompt; providers with native enforcement get policy and field-routing instructions only. workspace_root bounds project edits; documented tool-managed support state may live outside it when execution permissions allow writes. The transport selects bootstrap or refresh delivery explicitly and calls this once for an unwrapped payload; payload text never determines whether policy is applied.