Tools
Use tools to add custom behavior to the Inkeep widgets.
Tools configuration allows you to define custom functions that can be called by the AI assistant during chat interactions. These tools enable the AI to trigger actions in your application based on its responses, such as opening forms, links, or performing callbacks.
Tools do not modify or generate the AI's response content. They are specifically designed to perform actions (like opening links or forms) in response to the AI's analysis of the conversation.
Basic Usage
Here's a simple example of configuring a tool that checks service status:
Available Actions
Tools can trigger three types of actions:
-
Open Link (
open_link
) -
Open Form (
open_form
) -
Invoke Callback (
invoke_callback
)
For more details about actions and their configurations, see the Actions Guide.
Common Use Cases
1. Confidence-Based Support Escalation
This example shows how to create a tool that suggests contacting support when the AI's confidence is low:
2. Contact Form Integration
Example of a tool that opens a contact form based on the query category:
Context-Based Tool Generation
Tools can be dynamically generated based on the conversation context. The getTools
function receives a context object containing the current conversation state
This example shows a tool that schedules a call when the AI has had multiple low confidence responses:
Using Zod Schemas
You can use Zod to define your parameter schemas in a more type-safe way. The schema can be converted to JSON Schema format using zod-to-json-schema
: