DefaultResponseReceiver

class DefaultResponseReceiver(val response: String)(source)

Receiver class for configuring text responses from the LLM.

This class is part of the fluent API for configuring how the LLM should respond with text when it receives specific inputs.

Constructors

Link copied to clipboard
constructor(response: String)

Properties

Link copied to clipboard

Sets this response as the default response to be returned when no other response matches.

Link copied to clipboard

The text response to return

Functions

Link copied to clipboard
infix fun onCondition(condition: (String) -> Boolean): String

Configures the LLM to respond with this string when the user request satisfies the specified condition.

Link copied to clipboard
infix fun onRequestContains(pattern: String): String

Configures the LLM to respond with this string when the user request contains the specified pattern.

Link copied to clipboard
infix fun onRequestEquals(pattern: String): String

Configures the LLM to respond with this string when the user request exactly matches the specified pattern.