Reply

org.llm4s.testkit.Reply
See theReply companion class
object Reply

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Reply.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(content: String, toolCalls: List[ToolCall], failure: Option[LLMError], model: String, usage: Option[TokenUsage]): Reply

Creates a Reply. The named arguments are the supported way to build one; the factories below cover the common cases.

Creates a Reply. The named arguments are the supported way to build one; the factories below cover the common cases.

Attributes

def failure(error: LLMError): Reply

A call that fails with error, for example a RateLimitError or a TimeoutError.

A call that fails with error, for example a RateLimitError or a TimeoutError.

Attributes

def text(content: String): Reply

A plain text answer.

A plain text answer.

Attributes

def toolCall(name: String, argumentsJson: String, id: Option[String]): Reply

An answer that calls one tool.

An answer that calls one tool.

Reply.toolCall("get_weather", """{"city": "Paris"}""")

The arguments are checked here, when the script is written: text that is not a JSON object is a mistake in the test, so it throws at once, naming the tool and the text, instead of surfacing later as a confusing failure of the code under test.

Value parameters

argumentsJson

the arguments the model passes, as a JSON object; {} when the tool takes none

id

the id of the call; when None the client numbers it call-<call number>-<position>

name

the name of the tool, as registered with the agent

Attributes

Throws
IllegalArgumentException

if argumentsJson is not a JSON object

def toolCalls(calls: ToolCall*): Reply

An answer that makes several tool calls at once, built from core's ToolCall. Without a JSON library at hand, chain Reply.withToolCall onto Reply.toolCall instead.

An answer that makes several tool calls at once, built from core's ToolCall. Without a JSON library at hand, chain Reply.withToolCall onto Reply.toolCall instead.

Attributes

Concrete fields

val DefaultModel: String

The model name a completion reports unless Reply.withModel changes it.

The model name a completion reports unless Reply.withModel changes it.

Attributes