Which Cortex functions support a parameterized option that can be used to filter unsafe and harmful responses from LLMs?
Both the COMPLETE (SNOWFLAKE.CORTEX) and TRY_COMPLETE (SNOWFLAKE.CORTEX) functions accept an options object that includes a 'guardrails' setting. When set to TRUE, this parameter activates Cortex Guard, which evaluates the LLM's response before it is returned and filters out content associated with categories such as violent crimes, hate, sexual content, and self-harm, replacing it with a filtered-response message. This capability is documented specifically for COMPLETE and TRY_COMPLETE because they are the functions that generate free-form chat/completion responses from a language model; TRANSLATE(), CLASSIFY_TEXT(), and SUMMARIZE() perform different, more constrained NLP tasks and do not expose a guardrails option.
Community Discussion