I have an Agent with a the sample weather tool setup and I am trying to interact with it via the Dialogflow CX Java client library(google-cloud-dialogflow-cx 0.59.0). It works in the simulator; that is upon querying for the weather it shows the tool usage:
Agent console
As a point of note, it also works when I interact via the Vertex API(google-cloud-vertexai 1.8.0) (fx-weather
is present in functionCalls
):
Debugger: VertexA API
However when I programmatically interact wit the agent by invoking DetectIntentResponse response = sessionsClient.detectIntent(request);
from the Dialogflow API, the toolCall
is missing:
Debugger: Dialogflow API
Attempting a followup invocation for the same session indicates that the tool did kick in because it fails with:
com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: com.google.apps.framework.request.BadRequestException: Session is waiting for tool call result of tool, 85f8a7e8-4a47-4a96-bcab-6ca87ad83b50, and action, fx-weather.
I have also enabled Conversational Logging and via the Logs Explorer for that initial interaction I do see that the tooCall
is populated:
Logs Explorer
This Google Cloud Forum post is about the same issue and it is suggested that the setup may be wrong, Dialogflow lib may not support it, or maybe it’s just a bug.
I tried to interact with an Agent with a tool via the Java client library and I am not seeing the tooCall
populated as expected.
Dan Bush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Note tools are supported in the v3 beta lib.
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dialogflow</artifactId>
<version>4.54.0</version>
</dependency>
com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse
ToolCall toolCall = response.getQueryResult().getResponseMessages(0).getToolCall();
Dan Bush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.