LastUser

org.llm4s.testkit.LastUser
object LastUser

Matches a conversation that has a user message, and extracts the text of the latest one, whatever follows it: every model call of a turn, not only the first. It extracts lastUserText.

case LastUser(text) if text.contains("Oslo") => Reply.text("cold")

Attributes

Source
RuleExtractors.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LastUser.type

Members list

Value members

Concrete methods

def unapply(conversation: Conversation): Option[String]

The text of the latest user message, if the conversation has one.

The text of the latest user message, if the conversation has one.

Attributes

Source
RuleExtractors.scala