gen_ai_hub.orchestration.models.llama_guard_3_filter module

class gen_ai_hub.orchestration.models.llama_guard_3_filter.LlamaGuard38bFilter(violent_crimes: bool = False, non_violent_crimes: bool = False, sex_crimes: bool = False, child_exploitation: bool = False, defamation: bool = False, specialized_advice: bool = False, privacy: bool = False, intellectual_property: bool = False, indiscriminate_weapons: bool = False, hate: bool = False, self_harm: bool = False, sexual_content: bool = False, elections: bool = False, code_interpreter_abuse: bool = False, **kwargs)

Bases: ContentFilter

Specific implementation of ContentFilter for Llama Guard 3. Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.

__init__(violent_crimes: bool = False, non_violent_crimes: bool = False, sex_crimes: bool = False, child_exploitation: bool = False, defamation: bool = False, specialized_advice: bool = False, privacy: bool = False, intellectual_property: bool = False, indiscriminate_weapons: bool = False, hate: bool = False, self_harm: bool = False, sexual_content: bool = False, elections: bool = False, code_interpreter_abuse: bool = False, **kwargs)

Initializes the LlamaGuard38bFilter with specified content filtering options.

Parameters:
  • violent_crimes (bool, optional) – Responses that enable, encourage, or endorse the commission of violent crimes. Defaults to False.

  • non_violent_crimes (bool, optional) – Responses that enable, encourage, or endorse the commission of non-violent crimes. Defaults to False.

  • sex_crimes (bool, optional) – Responses that enable, encourage, or endorse the commission of sex-related crimes. Defaults to False.

  • child_exploitation (bool, optional) – Responses that contain, describe, enable or endorse the sexual abuse of children. Defaults to False.

  • defamation (bool, optional) – Responses that are both verifiably false and likely to injure a living person’s reputation. Defaults to False.

  • specialized_advice (bool, optional) – Responses that contain specialized financial, medical or legal advice. Defaults to False.

  • privacy (bool, optional) – Responses that contain sensitive or nonpublic personal information. Defaults to False.

  • intellectual_property (bool, optional) – Responses that may violate the intellectual property rights of any third party. Defaults to False.

  • indiscriminate_weapons (bool, optional) – Responses that enable, encourage, or endorse the creation of indiscriminate weapons. Defaults to False.

  • hate (bool, optional) – Responses that demean or dehumanize people on the basis of their sensitive, personal characteristics. Defaults to False.

  • self_harm (bool, optional) – Responses that enable, encourage, or endorse acts of intentional self-harm. Defaults to False.

  • sexual_content (bool, optional) – Responses that contain erotica. Defaults to False.

  • elections (bool, optional) – Responses that contain factually incorrect information about electoral systems and processes. Defaults to False.

  • code_interpreter_abuse (bool, optional) – Responses that seek to abuse code interpreters. Defaults to False.