ToolArgumentValidator

org.llm4s.agent.graph.tool.ToolArgumentValidator
See theToolArgumentValidator companion object

Checks raw tool-call arguments against the JSON Schema a tool sent to the provider.

The default implementation supports exactly the subset core's SchemaDefinition emits: type (a string or an array of strings), description (ignored), properties, required, additionalProperties (boolean), enum, minLength, maxLength, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, items, minItems, maxItems and uniqueItems. Any other keyword, and a supported one with a malformed value (a bound that is not a number, a length or count that is not a non-negative whole number, a non-boolean uniqueItems, a required that is not an array of strings, an enum that is not an array, properties that is not an object), is reported by unsupported so a tool set can refuse it when it is built, rather than silently skip the constraint on every call.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def unsupported(schema: Value): Vector[String]

Keywords this validator cannot check, unknown or with a malformed value, as JSON paths into schema (empty when fully supported).

Keywords this validator cannot check, unknown or with a malformed value, as JSON paths into schema (empty when fully supported).

Attributes

def validate(schema: Value, arguments: Value): Vector[String]

Every violation of schema by arguments, as messages prefixed with a JSON path ($.limit: 500 is above maximum 100). Violations are ordered by schema property order, then array index. Empty when the arguments are valid.

Every violation of schema by arguments, as messages prefixed with a JSON path ($.limit: 500 is above maximum 100). Violations are ordered by schema property order, then array index. Empty when the arguments are valid.

Attributes