【问题标题】:There is no URL template for action 'actions.intent.GET_EXERCISE_OBSERVATION' with zero required parameters没有所需参数为零的操作“actions.intent.GET_EXERCISE_OBSERVATION”的 URL 模板
【发布时间】:2023-11-18 12:10:01
【问题描述】:

这是我的 actions.xml 操作,关于 GET_EXERCISE_OBSERVATION

<action intentName="actions.intent.GET_EXERCISE_OBSERVATION">
    <fulfillment urlTemplate="https://www.xelion.com/stats{?exerciseType}">
        <parameter-mapping
            entityMatchRequired="true"
            intentParameter="exerciseObservation.aboutExercise.name"
            required="true"
            urlParameter="exerciseType" />
    </fulfillment>
    <parameter name="exerciseObservation.aboutExercise.name">
        <entity-set-reference entitySetId="ExerciseEntitySet" />
    </parameter>
</action>

这是我的练习实体集:

  <entity-set entitySetId="ExerciseEntitySet">

    <!-- For each entity you can specify the name, alternate names and the identifier -->
    <!-- The identifier is the value that will be added to the action uri. -->
    <!-- For our sample we map the supported entities with the class FitActivity.Type  -->

    <entity
        name="running"
        identifier="RUNNING" />
    <entity
        name="walking"
        identifier="WALKING" />
    <entity
        name="cycling"
        identifier="CYCLING" />
</entity-set>

如您所见,参数映射严格表示 REQUIRED 和 entityMatchRequired="true" 但是当我运行应用操作测试工具和“更新预览”时,它会说:

 13:09  App Actions Test Tool v3.0.0
        Preview Creation Error
        Status Code: 400
        Message: Precondition check failed.
        - There is no URL template for action 'actions.intent.GET_EXERCISE_OBSERVATION' with zero required parameters.

我确实从他们的示例中复制了这个: https://github.com/actions-on-google/appactions-fitness-kotlin/tree/master/app/src/main/java/com/devrel/android/fitactions

为什么不编译。为什么它不能识别我的参数?

【问题讨论】:

  • 我在GET_FOOD_OBSERVATION 上遇到了类似的问题,在我的参数化&lt;fulfillment&gt; 解决了我的问题之后,似乎添加了另一个没有参数的&lt;fulfillment&gt;。因此,例如,可以尝试在关闭 &lt;/fulfillment&gt; 节点后添加 &lt;fulfillment urlTemplate="https://www.xelion.com/stats"&gt;。我认为它可能需要作为后备。

标签: android kotlin voice-recognition voice app-actions


【解决方案1】:

这应该现在修复。测试工具包括对此处所需内容的说明。在这种情况下,您需要一个后备履行,以防第一个履行没有被触发,后备将作为一个包罗万象。

【讨论】:

  • 嗯我收到错误Missing fulfillment for action 'my.own.ACTION' with zero required parameters. Add a fallback fulfillment with no required parameters. 这似乎是同一个问题。我能做什么?
  • 这个示例应该有助于阐明如何添加fallback fulfillment
最近更新 更多