Closed lordofthejars closed 2 weeks ago
This already exists.
public class OutputGuardRailExample implements OutputGuardrail {
@Override
public OutputGuardrailResult validate(OutputGuardrailParams params) {
params.userMessageTemplate(); // The input text should be here.
params.variables(); // If there are variables in the user message, they should be here.
// ...
return this.success();
}
}
Thanks
In some output guards, we would need the original input text to validate the output. For example, I want to validate that the output of the LLM is in the same language as the input text, and if not reprompt.
Another use case could be to ask to the model if the response is accurate to the question given initially
I think now this is not possible now in the output guardrails, but I might be wrong.