ContextFormatter

org.llm4s.rag.ContextFormatter
See theContextFormatter companion object
@Experimental

Writes one retrieved chunk into an answer's prompt (#3024). RAG puts the chunk's number, [n], on the line before what this returns, and fences what it returns inside <context> tags, neutralising any such tag in it, so metadata and content alike reach the model as data: a formatter need not escape anything.

Attributes

Companion
object
Source
RAGAnswerContext.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def format(number: Int, context: RAGSearchResult): String

The text of the chunk numbered number (from 1) in the prompt.

The text of the chunk numbered number (from 1) in the prompt.

Attributes

Source
RAGAnswerContext.scala