Google Action自定义intent匹配异常:始终返回actions.intent.TEXT
actions.intent.TEXT Problem Summary
I've built a Fulfillment for my Google Action that responds to requests correctly, but I'm facing an intent matching issue. When I input phrases defined in the queryPatterns of my custom "zwei" intent (like "komm schon"), the system always falls back to actions.intent.TEXT instead of triggering the intended "zwei" intent.
My action.json configuration:
{ "actions": [ { "description": "Default Welcome Intent", "name": "MAIN", "fulfillment": { "conversationName": "test" }, "intent": { "name": "actions.intent.MAIN", "trigger": { "queryPatterns": [ "talk to test" ] } } }, { "description": "zweites intent", "name": "zwei", "fulfillment": { "conversationName": "test" }, "intent": { "name": "zwei", "trigger": { "queryPatterns": [ "starte zwei", "zwei", "komm schon" ] } } }, { "description": "Everything Else Intent", "name": "allElse", "fulfillment": { "conversationName": "test" }, "intent": { "name": "actions.intent.TEXT" } } ], "conversations": { "dpd": { "name": "test", "url": "someurl" } }, "locale": "en" }
When testing with the query "komm schon", the request sent to Fulfillment shows the intent as actions.intent.TEXT:
{ "user": { "userId": "userid", "locale": "en-US", "lastSeen": "2018-01-29T15:06:04Z", "userStorage": "{\"data\":{}}" }, "conversation": { "conversationId": "1234", "type": "ACTIVE", "conversationToken": "{\"state\":null,\"data\":{}}" }, "inputs": [ { "intent": "actions.intent.TEXT", "rawInputs": [ { "inputType": "KEYBOARD", "query": "komm schon" } ], "arguments": [ { "name": "text", "rawText": "komm schon", "textValue": "komm schon" } ] } ], "surface": { "capabilities": [ { "name": "actions.capability.AUDIO_OUTPUT" }, { "name": "actions.capability.SCREEN_OUTPUT" }, { "name": "actions.capability.MEDIA_RESPONSE_AUDIO" }, { "name": "actions.capability.WEB_BROWSER" } ] }, "isInSandbox": true, "availableSurfaces": [ { "capabilities": [ { "name": "actions.capability.AUDIO_OUTPUT" }, { "name": "actions.capability.SCREEN_OUTPUT" } ] } ] }
Root Causes & Fixes
There are two critical issues in your configuration that are causing the intent mismatch:
1. Mismatched Conversation Reference
In your conversations object, the key is "dpd", but all your intents reference "conversationName": "test" in their fulfillment settings. Google Actions uses the conversationName value to look up the corresponding conversation configuration by its key in the conversations object, not the name field inside the conversation.
Fix: Update your conversations object to use "test" as the key (matching the conversationName in your intents):
"conversations": { "test": { "name": "test", "url": "someurl" } }
2. Locale Misalignment
Your action.json sets "locale": "en", but the queryPatterns for your "zwei" intent are all German phrases ("starte zwei", "zwei", "komm schon"). Additionally, the test request shows the user's locale as "en-US". Google Actions will only match trigger phrases to intents that are configured for the user's current locale—so German phrases won't be recognized in an English locale setup.
Fix:
- Change the
localeinaction.jsonto a German locale (e.g.,"de"or"de-DE"):"locale": "de-DE" - Ensure your test environment uses the same German locale (adjust user settings in the Actions Simulator or test device to match
de-DE).
Additional Notes
After making these changes, redeploy your Action and clear the conversation history in the simulator to test fresh. If you need to support both English and German, you should create separate locale-specific action.json files or use the Actions Console's multi-locale setup instead of a single manual configuration.
内容的提问来源于stack exchange,提问作者Beanssss

