Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"useSearchGrounding" with Google Gen AI breaks tool calling #4312

Open
acron0 opened this issue Jan 7, 2025 · 0 comments
Open

"useSearchGrounding" with Google Gen AI breaks tool calling #4312

acron0 opened this issue Jan 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@acron0
Copy link

acron0 commented Jan 7, 2025

Description

Use a basic tool, such as

{
toolTest: {
        description: 'Test tool - use this if the user asks to test the tools',
        parameters: z.object({}),
        execute: async () => {
            console.log('Test tool executed')
            return { message: 'Test tool executed' }
        },
    },
}

Then use a prompt such as "test the tools" and observe the console log and the model will respond acknowledging the test.

  • WORKS when using an OpenAI model such as openai('gpt-4o')
  • WORKS when using a Google Gen AI model such as google('gemini-1.5-pro-latest')
  • DOES NOT WORK when using a Google Gen AI model AND { useSearchGrounding: true } option

Code example

const result = await ai({
    model: google('gemini-1.5-pro-latest', {
        useSearchGrounding: true,
    }),
    //model: openai('gpt-4o'),
    prompt: "test the tools" 
    tools: {
        toolTest: {
                description: 'Test tool - use this if the user asks to test the tools',
                parameters: z.object({}),
                execute: async () => {
                    console.log('Test tool executed')
                    return { message: 'Test tool executed' }
                },
            },
        }),
    maxToolRoundtrips: 3,
    temperature: 0.85,
    maxSteps: 3,
    })

AI provider

google('gemini-1.5-pro-latest')

Additional context

No response

@acron0 acron0 added the bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant