Tool Configuration
There are a few configuration options available when registering tools
Name
The name of the tool that will be provided to the agent.
For best results, function names should be descriptive. Along with the
description
they are used to guide the agent.
Language | Supported |
---|---|
Node.js | ✅ |
Go | ✅ |
.Net | ✅ |
Description
A human-readable description of the tool, use this to augment the agent’s understanding of the tool and when to use it.
Language | Supported |
---|---|
Node.js | ✅ |
Go | ✅ |
.Net | ✅ |
Schema
Language | Supported | Notes |
---|---|---|
Node.js | ✅ | Through the schema option |
Go | ☑️ | Not required. Inferred via Reflection |
.Net | ☑️ | Not required. Inferred via Reflection |
Node.js
schema
is only applicable to languages where the SDK cannot reflect the function type at runtime. NodeJS require the schema
to be specified, however Go and .Net do not.
In Node.js, a zod schema that defines the input shape of the function. The schema is used to explain how to use the function, and to validate the input before the function is executed.
Handler
The handler that will be executed when Inferable invokes the function. This handler runs within your environment.
Language | Supported |
---|---|
Node.js | ✅ |
Go | ✅ |
.Net | ✅ |
Config object
Additional configuration options for the function.
Retry Count on Stall
Language | Supported | Option |
---|---|---|
Node.js | ✅ | config.retryCountOnStall |
Go | ❌ | |
.Net | ❌ |
The number of times Inferable will retry the function call if the function stalls.
A function can stall if it does not complete within the allotted time. This usually happens if:
- Function fails to complete within the allotted timeoutSeconds time.
- Worker stalls due to a machine crash or network problems. (See Recovering from machine failures for more information)
Without this configuration, Inferable will not retry the function call.
timeoutSeconds
Language | Supported | Option |
---|---|---|
Node.js | ✅ | config.timeoutSeconds |
Go | ❌ | |
.Net | ❌ |
The number of seconds Inferable will wait before timing out the function call.
cache
Language | Supported | Option |
---|---|---|
Node.js | ✅ | config.cache |
Go | ❌ | |
.Net | ❌ |
Used to cache the result of the function for a specified amount of time.
ttl
- The time in milliseconds that the result of the function will be cached.keyPath
- The path (described using JSONPath) to the unique identifier in the function’s input.
private
Language | Supported | Option |
---|---|---|
Node.js | ✅ | config.private |
Go | ❌ | |
.Net | ❌ |
When set to true
, the function will not be made available to the agent. This is can be used for functions registered as onStatusChange handlers.
Was this page helpful?