EndsWithUser

org.llm4s.testkit.EndsWithUser
object EndsWithUser

Matches a conversation whose last message is a user message, and extracts its text: the first model call of a turn. The later calls of the turn end with tool results (AfterToolResult) instead.

case EndsWithUser(s"take $item") => Reply.toolCall("add_inventory_item", s"""{"item":"$item"}""")

The agent's correction request is a user message too, so a rule for AfterCorrection goes before a rule for EndsWithUser that would match its text.

Attributes

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

Members list

Value members

Concrete methods

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

The text of the last message when it is a user message.

The text of the last message when it is a user message.

Attributes

Source
RuleExtractors.scala