Correct language

How to restrict an agent to the languages you allow

Correct Language allows users to explicitly define the set of allowed languages (which can be more than one) either by supplying the list of valid languages (include) or by specifying the ones to exclude. The detection algorithm will always classify the given text into one language only, even if the sentence is written in more than one language.

SUPERWISE guardrails: the Correct language rule form with apply to input or output and include or exclude languages

Using the SDK

from superwise_api.models.agent.agent import AgentCorrectLanguageGuard

restricted_topics_guard = AgentCorrectLanguageGuard(
    name="Rule name",
    tags={"input", "output"}, # A Set containing "input", "output", or both
    language_codes=["en", "fr"], # In ISO format
    filter_mode="include" # or - "exclude"
)



Did this page help you?