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
