Inference Logoinference.sh

Building Tools

Define tools for agents using the fluent builder API.


Tool Types

Agents can use several types of tools:

TypeDescription
ClientExecuted by your code (with handler)
AppRuns an inference.sh app
AgentDelegates to a sub-agent
WebhookCalls an external URL
InternalBuilt-in: plan, memory, widgets, finish

Quick Example

1from inferencesh import tool, string2 3greet = (4    tool("greet")5    .describe("Greet a user")6    .param("name", string("User's name"))7    .handler(lambda args: f"Hello, {args['name']}!")8    .build()9)

Parameter Types

All tool builders share these parameter types:

1from inferencesh import string, number, integer, boolean, enum_of, array, obj, optional2 3# Basic types4string("Description")      # Text input5number("Description")      # Decimal number6integer("Description")     # Whole number7boolean("Description")     # True/false8 9# Complex types10enum_of(["a", "b"], "desc")    # Choice from list11array(string(), "desc")        # List of items12obj({"key": string()}, "desc") # Nested object13optional(string())             # Optional parameter

Learn More

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.