Package com.sap.ai.sdk.orchestration

# Class LlamaGuardFilter

java.lang.Object
com.sap.ai.sdk.orchestration.LlamaGuardFilter

All Implemented Interfaces:
  `ContentFilter`

public class LlamaGuardFilter extends Object implements ContentFilter
A content filter wrapping Llama Guard filter config.

This class allows setting filters for different content categories such as hate, self-harm, sexual, and violence.

Example usage:

     // values not set are disabled by default
     val config =
         LlamaGuard38b.create()
             .violentCrimes(true)
             .selfHarm(true);
     val filterConfig = new LlamaGuardFilter().config(config);

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LlamaGuardFilter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LlamaGuardFilter`
  `config(LlamaGuard38b config)`
  `LlamaGuard38bFilterConfig`
  `createInputFilterConfig()`
  A method that produces the serializable equivalent `InputFilterConfig` object from data encapsulated in the `ContentFilter` object.
  `LlamaGuard38bFilterConfig`
  `createOutputFilterConfig()`
  A method that produces the serializable equivalent `OutputFilterConfig` object from data encapsulated in the `ContentFilter` object.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LlamaGuardFilter

    public LlamaGuardFilter()

- ## Method Details

  - ### createInputFilterConfig

    @Nonnull public LlamaGuard38bFilterConfig createInputFilterConfig()
    Description copied from interface: `ContentFilter`
    A method that produces the serializable equivalent `InputFilterConfig` object from data encapsulated in the `ContentFilter` object.
    Specified by:
      `createInputFilterConfig` in interface `ContentFilter`
    Returns:
      the corresponding `InputFilterConfig` object.

  - ### createOutputFilterConfig

    @Nonnull public LlamaGuard38bFilterConfig createOutputFilterConfig()
    Description copied from interface: `ContentFilter`
    A method that produces the serializable equivalent `OutputFilterConfig` object from data encapsulated in the `ContentFilter` object.
    Specified by:
      `createOutputFilterConfig` in interface `ContentFilter`
    Returns:
      the corresponding `OutputFilterConfig` object.

  - ### config

    public LlamaGuardFilter config(LlamaGuard38b config)
    Returns:
      `this`.