QuestionCondenser

org.llm4s.rag.QuestionCondenser
See theQuestionCondenser companion object
@Experimental

Turns a chat follow-up into the standalone question a RAG searches with (#2733), so that "what about the second one?" retrieves what it refers to. Set it with RAGConfig.withQuestionCondenser; the pipeline calls it only when the history passed to queryWithAnswer (or its permission and streaming variants) is non-empty, and the model still answers the original question. A Left fails the query.

A function is one, so withQuestionCondenser((question, history) => ...) takes a lambda; QuestionCondenser.llm is the built-in condenser that asks a model.

Attributes

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

Members list

Value members

Abstract methods

def condense(question: String, history: Seq[Message]): Result[String]

The standalone question to search with.

The standalone question to search with.

Value parameters

history

the conversation before it, oldest first; never empty when the pipeline calls it

question

the question asked

Attributes

Source
QuestionCondenser.scala

Concrete methods

This condenser with its LLM calls traced to tracing, as a RAG configured with withTracing uses it. The default returns it unchanged; QuestionCondenser.llm's calls are traced, tagged rag.condense.

This condenser with its LLM calls traced to tracing, as a RAG configured with withTracing uses it. The default returns it unchanged; QuestionCondenser.llm's calls are traced, tagged rag.condense.

Attributes

Source
QuestionCondenser.scala