Class ToolPayload
java.lang.Object
com.suncode.pwfl.ai.tool.ToolPayload
JSON object exchanged with a tool: arguments chosen by the model, data entered by the user or state the tool
keeps between calls. Plugins read it through typed accessors or map it onto their own class, so the tool contract
does not depend on the JSON library.
-
Method Summary
Modifier and TypeMethodDescription<T> Tbooleanstatic ToolPayloadgetBoolean(String name) inthashCode()static ToolPayloadtoJson()toString()
-
Method Details
-
fromJson
- Parameters:
json- JSON text; blank text is an empty object- Throws:
IllegalArgumentException- when the text is not valid JSON
-
of
- Parameters:
value- object serialized the way Jackson serializes it, e.g. a record with the tool state
-
getString
-
getLong
-
getBoolean
-
as
- Throws:
IllegalArgumentException- when the payload does not match the class
-
toJson
-
equals
-
hashCode
-
toString
-