You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于DialogFlow实现iOS&Android应用数据库语音搜索过滤功能的问询

Does Dialogflow Support Filtered Voice Search for Records?

Absolutely, Dialogflow does support this kind of filtered voice search functionality—let me walk you through exactly how to build the "search order xxxx" workflow you're asking about.

Key Steps to Implement This:

1. Create an Intent with Extraction Parameters

  • First, set up an intent (e.g., SearchOrderIntent) that listens for voice commands like "search order [orderNumber]", "find my order #[orderNumber]", or "pull up order [orderNumber]".
  • Add a required parameter named orderNumber:
    • If your order IDs are numeric, use the built-in @sys.number entity type.
    • If your order IDs include letters or special characters, create a custom entity (e.g., @orderId) and train it with sample values to improve recognition accuracy.
  • Enable parameter prompts so Dialogflow asks the user to provide the order number if they skip it (e.g., "Sure, which order ID would you like me to search for?").

2. Connect to Your Data Store via Fulfillment

Once Dialogflow extracts the orderNumber parameter, you’ll use fulfillment to query your backend/database and return filtered results:

  • You can use Dialogflow’s inline code editor (supports Node.js) or connect your own webhook service.
  • Here’s a simplified Node.js example for the inline editor:
    // Map the intent to your fulfillment function
    intentMap.set('SearchOrderIntent', searchOrder);
    
    function searchOrder(agent) {
      const orderNumber = agent.parameters.orderNumber;
      // Replace this with your actual database query logic
      return fetchYourOrdersDatabase(orderNumber)
        .then(orderData => {
          if (orderData) {
            // Speak-friendly response for voice interactions
            agent.add(`Got it, here's order ${orderNumber}: The status is ${orderData.status}, placed on ${orderData.date}.`);
          } else {
            agent.add(`Sorry, I couldn't find any order with ID ${orderNumber}.`);
          }
        })
        .catch(error => {
          agent.add(`Oops, something went wrong while searching for your order.`);
          console.error('Database query error:', error);
        });
    }
    

3. Optimize for Voice Usability

  • Keep responses concise and conversational—voice users don’t want to listen to long blocks of text.
  • Add follow-up intents (e.g., OrderDetailsFollowup) to let users ask for more info like "What's the shipping status?" after the initial search.

4. Test Edge Cases

  • Use Dialogflow’s test console to simulate voice inputs (try speaking or typing variations) and confirm the orderNumber parameter is extracted correctly.
  • Test with mispronounced order IDs, partial numbers, or special characters to ensure your entity recognition handles real-world voice input.

内容的提问来源于stack exchange,提问作者Bhadresh Mulsaniya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:59:27