ModelResponse

org.llm4s.agent.graph.middleware.ModelResponse
See theModelResponse companion object
@Experimental
final class ModelResponse

What a model wrapper returns: the model's completion, and an update to keys the wrapper declares in its writes, committed with the model step's task. A wrapper adds its writes with addUpdate, which keeps those of the wrappers inside it - the combined update applies innermost first - and changes the completion with withCompletion, which keeps the update. A wrapper that answers without calling next builds its own with ModelResponse(completion) or ModelResponse(completion, update). Only the response a wrapper returns counts: the updates of a response it discarded, calling next again, are never committed.

Every hook returns its update the same way (#2795): built with the result, read with update, added to with addUpdate - here, on BoundaryResult and on a tool wrapper's ToolOutcome. Nothing replaces an update.

Attributes

Companion
object
Source
AgentMiddleware.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

This response with u applied after its update; u belongs to the wrapper that returns the response.

This response with u applied after its update; u belongs to the wrapper that returns the response.

Attributes

Source
AgentMiddleware.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
AgentMiddleware.scala

The writes of every wrapper that contributed to this response, innermost first.

The writes of every wrapper that contributed to this response, innermost first.

Attributes

Source
AgentMiddleware.scala

This response with c as its completion, keeping its update.

This response with c as its completion, keeping its update.

Attributes

Source
AgentMiddleware.scala

Concrete fields