AfterCorrection
org.llm4s.testkit.AfterCorrection
object AfterCorrection
Matches a conversation whose last message is the agent's correction request: the retry of a structured answer (AgentBuilder.withOutput) that did not match its schema. It extracts nothing, so a rule writes it with parentheses - case AfterCorrection() =>. Without them the pattern compares the conversation with this object and never matches.
ScriptedLLMClient.respondingTo {
case AfterCorrection() => Reply.text("""{"customer":"Acme","total":12.5}""")
case EndsWithUser(_) => Reply.text("""{"customer":"Acme","total":"lots"}""")
}
The request is recognised by how its text starts, with the constant the agent runtime writes it with: a user message has nothing else to mark it. A user message of the test's own that starts the same way matches too.
Attributes
- Source
- RuleExtractors.scala
- Graph
-
- Supertypes
- Self type
-
AfterCorrection.type
Members list
In this article
