Reply

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

Attributes

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

Members list

Type members

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

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

Source
Reply.scala
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

Source
Reply.scala
def text(content: String): Reply

A plain text answer.

A plain text answer.

Attributes

Source
Reply.scala
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

Source
Reply.scala
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

Source
Reply.scala

Concrete fields

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

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

Attributes

Source
Reply.scala