TopicBoundaryGuardrail

org.llm4s.agent.guardrails.rag.TopicBoundaryGuardrail
See theTopicBoundaryGuardrail companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(llmClient: LLMClient, allowedTopics: Seq[String]): TopicBoundaryGuardrail

Create a topic boundary guardrail with specified allowed topics.

Create a topic boundary guardrail with specified allowed topics.

Attributes

def apply(llmClient: LLMClient, allowedTopics: Seq[String], threshold: Double): TopicBoundaryGuardrail

Create a topic boundary guardrail with custom threshold.

Create a topic boundary guardrail with custom threshold.

Attributes

def apply(llmClient: LLMClient, allowedTopics: Seq[String], threshold: Double, onFail: GuardrailAction): TopicBoundaryGuardrail

Create a topic boundary guardrail with full customization.

Create a topic boundary guardrail with full customization.

Attributes

def balanced(llmClient: LLMClient, allowedTopics: Seq[String]): TopicBoundaryGuardrail

Preset: Balanced mode - good default for most applications.

Preset: Balanced mode - good default for most applications.

Attributes

def customerSupport(llmClient: LLMClient, productTopics: Seq[String]): TopicBoundaryGuardrail

Preset for customer support topics.

Preset for customer support topics.

Attributes

def education(llmClient: LLMClient, subjects: Seq[String]): TopicBoundaryGuardrail

Preset for educational topics.

Preset for educational topics.

Attributes

def lenient(llmClient: LLMClient, allowedTopics: Seq[String]): TopicBoundaryGuardrail

Preset: Lenient mode - allows loosely related queries.

Preset: Lenient mode - allows loosely related queries.

Attributes

def monitoring(llmClient: LLMClient, allowedTopics: Seq[String]): TopicBoundaryGuardrail

Preset: Monitoring mode - tracks off-topic queries without blocking.

Preset: Monitoring mode - tracks off-topic queries without blocking.

Attributes

Preset for software development topics.

Preset for software development topics.

Attributes

def strict(llmClient: LLMClient, allowedTopics: Seq[String]): TopicBoundaryGuardrail

Preset: Strict mode - requires high topic relevance.

Preset: Strict mode - requires high topic relevance.

Attributes