🔧 Client Tools Demo
Demonstrates registering and using client-side tools with the TTP Chat Widget
📝 How to Test
- Click "Initialize Widget" to create the widget and register the tools
- Open the chat widget (bottom-right corner)
- Ask the agent to use the tools: "What is the current URL?" or "Take me to the contact page"
- The tools will execute automatically when the agent requests them
- Check the browser console for detailed logs
Waiting to initialize widget...
Code Example:
// Register get_url tool
widget.registerClientTool('get_url', async (params) => {
return { url: window.location.href };
});
// Register move_to_contact_page tool
widget.registerClientTool('move_to_contact_page', async (params) => {
window.location.href = 'https://talktopc.com/contact';
return { success: true, message: 'Navigating to contact page...' };
});