A call decodes the model's arguments with the endpoint's own codecs, so its types and validators check them before anything is sent, then calls the endpoint through sttp. Every failure (an argument the endpoint rejects, an error response, a server error, a request that cannot be sent) is a tool error the model reads; nothing throws.
The tools, each calling its endpoint at baseUri through backend; or a ValidationError listing every endpoint that cannot be a tool and why: an input the model cannot supply (a stream, a multipart or binary body, a cookie, a required header nobody supplies), a type its schema cannot state (a map, a recursive type, a sealed hierarchy that is not an enumeration), a binary or streaming output, an invalid or repeated tool name.
The tools, each calling its endpoint at baseUri through backend; or a ValidationError listing every endpoint that cannot be a tool and why: an input the model cannot supply (a stream, a multipart or binary body, a cookie, a required header nobody supplies), a type its schema cannot state (a map, a recursive type, a sealed hierarchy that is not an enumeration), a binary or streaming output, an invalid or repeated tool name.
The names of the tools that require approval, for an agent's approval middleware: new ApprovalMiddleware(call => Option.when(gated(call.spec.name))("changes data")).
The names of the tools that require approval, for an agent's approval middleware: new ApprovalMiddleware(call => Option.when(gated(call.spec.name))("changes data")).
Attributes
def tool[A, I, E, O](name: String, endpoint: Endpoint[A, I, E, O, Any]): EndpointTool
endpoint as the tool name. It requires approval unless its method is safe (GET, HEAD or OPTIONS, or none, which tapir sends as GET): an agent then asks before a call that may change something.
endpoint as the tool name. It requires approval unless its method is safe (GET, HEAD or OPTIONS, or none, which tapir sends as GET): an agent then asks before a call that may change something.
Attributes
def tool[A, I, E, O](name: String, endpoint: Endpoint[A, I, E, O, Any], requiresApproval: Boolean): EndpointTool
endpoint as the tool name, requiring approval when requiresApproval is true.
endpoint as the tool name, requiring approval when requiresApproval is true.