Http://earthpilot.com/play and then join at AnthonyDavidAdams.com/zoom at 11 for show and tell.
I’m making a non-fiction book writing agent and I’d love to better understand how you used function calling to navigate the website!
Then you handle those function calls in your javascript.
``` if (function_name === 'search_recipes') { const searchParams = new URLSearchParams();
if (args.name) searchParams.set('name', args.name); if (args.difficulty) searchParams.set('difficulty', formatDifficulty(args.difficulty)); if (args.min_duration) searchParams.set('minDuration', args.min_duration.toString()); if (args.max_duration) searchParams.set('maxDuration', args.max_duration.toString()); if (args.tag) searchParams.set('tag', args.tag); // Handle ingredients array correctly - the search page expects ingredients[] if (args.ingredients && args.ingredients.length > 0) { // Clear any existing ingredients searchParams.delete('ingredients[]'); // Add each ingredient individually with the correct array notation args.ingredients.forEach((ingredient: string) => { searchParams.append('ingredients[]', ingredient); }); } const queryString = searchParams.toString(); const url = queryString ? `/search?${queryString}` : '/search'; navigate(url); return; } // start_cooking function if (function_name === 'start_cooking') { // First check if we have an onStartCooking callback registered if (callbacksRef.current.onStartCooking) { callbacksRef.current.onStartCooking(); return; } }
Http://earthpilot.com/play and then join at AnthonyDavidAdams.com/zoom at 11 for show and tell.
I’m making a non-fiction book writing agent and I’d love to better understand how you used function calling to navigate the website!