Package dev.dokimos.core.agents
Class ToolCalls
java.lang.Object
dev.dokimos.core.agents.ToolCalls
Coercion helpers for turning a raw value into a typed
List<ToolCall>.
A tool-call list reaches an evaluator either already typed (programmatic use) or as a list of
maps (deserialized from a JSON or CSV dataset). coerce(Object) normalizes both into a
typed list, validating every element so a malformed dataset row fails with a clear, indexed error.
-
Method Summary
-
Method Details
-
coerce
Coerces a value into a typedList<ToolCall>.Accepts an already-typed
List<ToolCall>, or aList<Map>mapped element by element viaToolCall.fromMap(Map). Every element is validated; a list mixing tool calls and maps (or containing any other element type) is rejected.nullor an empty list yields an empty list.- Parameters:
raw- the value to coerce- Returns:
- an unmodifiable list of tool calls, never
null - Throws:
IllegalArgumentException- if the value is not a list, mixes element types, or contains a malformed tool-call map (the message names the offending element index)
-