I’m working with Function Tools in Vertex AI Agent Builder and running into a weird issue. The behavior is different between the Agent Builder playbook and Dialogflow Messenger integration.
What I expect to see:
Based on the documentation, when my agent needs to call a function, I should get back function call details in the response like this:
{
"queryResult": {
"text": "what's the temperature in San Francisco",
"languageCode": "en",
"responseMessages": [
{
"source": "VIRTUAL_AGENT",
"toolCall": {
"tool": "<function-resource-id>",
"action": "fetch-temperature-data",
"inputParameters": {
"city": "San Francisco"
}
}
}
]
}
}
What actually happens:
In the Agent Builder playbook, everything works fine. When I ask “what’s the temperature in Berlin?”, I can see the network call to dialogflow.clients6.google.com/v3alpha1/ includes the toolCall data:
"queryResult": {
"text": "what's the temperature in Berlin?",
"languageCode": "en",
"responseMessages": [
{
"source": "VIRTUAL_AGENT",
"toolCall": {
"tool": "projects/myproject/locations/us/agents/abc123/tools/def456",
"action": "fetchTemperature",
"inputParameters": {
"city": "Berlin, Germany",
"scale": "fahrenheit"
}
}
}
]
}
But when I use Dialogflow Messenger, it calls dialogflow.googleapis.com/v3/ and the toolCall is missing:
"queryResult": {
"text": "what's the temperature in Berlin?",
"languageCode": "en",
"responseMessages": [
{}
]
}
This causes my session to get stuck waiting for tool results that never come. I get an error saying the session is waiting for function call results.
Why do these two integrations behave differently? How can I get the function call information in Dialogflow Messenger responses?