Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Google assistant sdk[自定义类型]:从自定义操作中捕获货币值($10,$20.$50)_Python_Json_Python 3.x_Schema.org_Google Assistant Sdk - Fatal编程技术网

Python Google assistant sdk[自定义类型]:从自定义操作中捕获货币值($10,$20.$50)

Python Google assistant sdk[自定义类型]:从自定义操作中捕获货币值($10,$20.$50),python,json,python-3.x,schema.org,google-assistant-sdk,Python,Json,Python 3.x,Schema.org,Google Assistant Sdk,我想使用自定义类型在我的自定义操作中捕获$10、$5、$20等值,因为这种数据没有Schema.org定义的类型。我将其添加到json文件中,但它不起作用 这是在拉斯宾身上运行的。 使用google assistant SDK 1.0.1版本。 这个动作是用西班牙语做的 { "locale": "es", "manifest": { "displayName": "Imprimir", "invocationName": "Imprimir"

我想使用自定义类型在我的自定义操作中捕获$10、$5、$20等值,因为这种数据没有Schema.org定义的类型。我将其添加到json文件中,但它不起作用

这是在拉斯宾身上运行的。 使用google assistant SDK 1.0.1版本。 这个动作是用西班牙语做的

{   
    "locale": "es",
    "manifest": {
        "displayName": "Imprimir",
        "invocationName": "Imprimir",
        "category": "PRODUCTIVITY"
    },
    "actions": [
        {
            "name": "com.example.actions.Imprimir",
            "availability": {
                "deviceClasses": [
                    {
                        "assistantSdkDevice": {}
                    }
                ]
            },
            "intent": {
                "name": "com.example.intents.Imprimir",
                "parameters": [
                    {
                        "name": "cantidad",
                        "type": "SchemaOrg_Number"
                    },
                    {
                        "name": "valor",
                        "type": "$Valor"
                    }
                ],
                "trigger": {
                    "queryPatterns": [
                        "imprimir $SchemaOrg_Number:cantidad tickets de $Valor:valor"
                    ]
                }
            },
            "fulfillment": {
                "staticFulfillment": {
                    "templatedResponse": {
                        "items": [
                            {
                                "simpleResponse": {
                                    "textToSpeech": "De acuerdo"
                                }
                            },
                            {
                                "deviceExecution": {
                                    "command": "com.example.commands.Imprimir",
                                    "params": {
                                        "cantidad": "$cantidad",
                                        "valor": "$valor"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    ],
    "types": [
        {
            "name": "$Valor",
            "entities": [
                {
                    "key": "1$",
                    "synonyms": [
                        "1 dolar"
                    ]
                },
                {
                    "key": "2$",
                    "synonyms": [
                        "2 dolares"
                    ]
                },
                {
                    "key": "5$",
                    "synonyms": [
                        "5 dolares"
                    ]
                },
                {
                    "key": "10$",
                    "synonyms": [
                        "10 dolares"
                    ]
                },
                {
                    "key": "20$",
                    "synonyms": [
                        "20 dolares"
                    ]
                }
            ]
        }
    ]
}
我看不出有任何明显的错误。这就是我谈论订单时发生的事情:

ON_END_OF_UTTERANCE
ON_END_OF_UTTERANCE
ON_RECOGNIZING_SPEECH_FINISHED:
  {"text": "imprimir dos ticket de $10"}
ON_RESPONDING_STARTED:
  {"is_error_response": false}
ON_RESPONDING_FINISHED
ON_CONVERSATION_TURN_FINISHED:
  {"with_follow_on_turn": false}
助手告诉我她不懂。 我在一家西班牙酒吧工作

我知道我的自定义类型不起作用,因为没有捕获事件。我确信json文件没有错误,因为如果我忽略“Valor”类型,将其替换为
$SchemaOrg_Number
并省略单词“dolar”,则该操作效果良好


我已经试过使用
$SchemaOrg\u priceCurrency
,但它捕获了货币的类型,如美元、溶胶、日元、欧元等。

您的同义词列表应该包括每种可能的组合。如果查询的字符串为“$10”,则需要将其作为同义词匹配,否则查询将完全不匹配