RAGContext

org.llm4s.agent.guardrails.rag.RAGContext
See theRAGContext companion object
final case class RAGContext(query: String, retrievedChunks: Seq[String], sources: Seq[String])

Context provided to RAG guardrails for enhanced validation.

RAGContext encapsulates all the information a guardrail needs to validate a response in the context of a RAG (Retrieval-Augmented Generation) workflow.

Value parameters

query

The original user query

retrievedChunks

The chunks retrieved from the vector store

sources

Optional source identifiers for each chunk (file paths, URLs, etc.)

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def chunksWithSources: Seq[(String, Option[String])]

Get chunks with their source identifiers.

Get chunks with their source identifiers.

Attributes

def combinedContext: String

Get combined context as a single string.

Get combined context as a single string.

Attributes

def hasCompleteSources: Boolean

Check if we have source information for all chunks.

Check if we have source information for all chunks.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product