Let's discuss how guardrails AI uses prompts to generate precise and controlled outputs from a model.
A guardrails prompt is not just a question or a command.
It's a blueprint that guides the AI to produce outputs that meets our specific requirements.
This blueprint combines instructions, parameters, and formatting guidelines, often in XML or JSON
formats, to ensure the output aligns with our criteria.
Imagine we need to generate a response to a billing inquiry from a patient who recently visited the
hospital.
Here is how the prompt structure looks like.
We start with a clear directive.
In this case, given the details of a patient's billing inquiry, please compile a JSON object that
accurately reflects the requested billing information.
This sets the stage informing the AI of the task at hand.
Next, we introduce parameters that will be replaced at runtime with the actual input at hand.
For instance, billing inquiry notes will contain the patient's inquiry details at the time of
Finally, we include the boilerplate text like complete JSON suffix, which instructs the AI to format
its outputs as a valid JSON object.
This parameter will be replaced by the boilerplate schema definition, and the final prompt to be provided
to LM looks like as shown here.
The AI is tasked with extracting this information and presenting it in a structured JSON format, conforming
to an XML schema provided here.
For example, a patient's query about charges for consultation, diagnostic tests and treatments, along
with insurance coverage details need to be meticulously transferred into a JSON object.
The AI uses the provided XML schema to map the patient's inquiry to the correct JSON structure, ensuring
every piece of information is accurately captured and formatted according to the specifications.
This EDM process ensures that the output is not just accurate, but also precisely tailored to our specific
needs.