ContextRelevanceGuardrail

org.llm4s.agent.guardrails.rag.ContextRelevanceGuardrail
See theContextRelevanceGuardrail companion class

Attributes

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

Members list

Value members

Concrete methods

Create a context relevance guardrail with default settings.

Create a context relevance guardrail with default settings.

Attributes

def apply(llmClient: LLMClient, threshold: Double): ContextRelevanceGuardrail

Create a context relevance guardrail with custom threshold.

Create a context relevance guardrail with custom threshold.

Attributes

def apply(llmClient: LLMClient, threshold: Double, minRelevantRatio: Double): ContextRelevanceGuardrail

Create a context relevance guardrail with custom settings.

Create a context relevance guardrail with custom settings.

Attributes

Preset: Balanced mode - good default for most applications.

Preset: Balanced mode - good default for most applications.

Attributes

Preset: Lenient mode - only fails when most chunks are irrelevant.

Preset: Lenient mode - only fails when most chunks are irrelevant.

Attributes

Preset: Monitoring mode - warns but doesn't block.

Preset: Monitoring mode - warns but doesn't block.

Attributes

Preset: Strict mode - requires high relevance for most chunks.

Preset: Strict mode - requires high relevance for most chunks.

Attributes