How can I get embedded function calling to return the response of the attached function? It seems my

How can I get embedded function calling to return the response of the attached function? It seems my function's response is fed back into the LLM, for reasons unknown. I want the LLM only to prepare and pass arguments to my function (as with traditional function calling), not to do anything with the function response.
router.get('/fruitInfo2', async (req, env) => {
    return runWithTools(env.AI, model, {
        messages: [{
            role: 'system',
            content: `
                The user message is a cryptic clue about a fruit.
                Extract the name and shape of the fruit.
            `
        }, {
            role: 'user',
            content: 'garden of eden'
        }],
        tools: [{
            name: 'fruitInfo',
            description: 'Extract the fruit name and shape.',
            parameters: {
                type: 'object',
                properties: {
                    name: {type: 'string', description: 'The name of the fruit'},
                    shape: {type: 'string', description: 'The shape of the fruit'}
                },
                required: ['name', 'shape']
            },
            function: ({name, shape}) => `Fruit is ${name} and shape is ${shape}`
        }]
    });
})
Was this page helpful?