A client that chooses each reply from the conversation. A conversation no case matches returns a Left(UnscriptedCallError) that names the call.
A client that chooses each reply from the conversation. A conversation no case matches returns a Left(UnscriptedCallError) that names the call.
The rules run under the client's lock, so they must not block on another call to the same client, and an exception a rule throws is not caught: it propagates from complete or streamComplete.
ScriptedLLMClient.respondingTo {
case EndsWithUser(s"take $item") => Reply.toolCall("add_inventory_item", s"""{"item":"$item"}""")
case AfterToolResult("add_inventory_item", _) => Reply.text("Taken.")
case c if c.messages.size > 20 => Reply.text("That is enough.")
}
A client that answers call 1 with the first reply, call 2 with the second, and so on. A call past the end of the script returns a Left(UnscriptedCallError) that names the call.
A client that answers call 1 with the first reply, call 2 with the second, and so on. A call past the end of the script returns a Left(UnscriptedCallError) that names the call.