<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ### 3.2.12 詩詞大會 #### (1)功能說明 詩詞大會是一款詩詞知識問答的闖關游戲。游戲分三關,分為“明辨是非”,“對答如流”和“詩詞捉迷藏”。每關題目構思巧妙,寓教于樂。比比誰是詩詞達人,快來挑戰吧! #### (2)接口說明 **請求方法** * POST **請求地址** * http://api.ruyi.ai/v1/message **請求參數說明** |參數名 |參數類型 | 是否必須 |參數說明 | :-----| :---| :---:|:----- |q |String| 是| 自然語言表達,例如“詩詞大會”等 |app_key| String|是 |應用開發者秘鑰,注冊開發者后臺賬號,建立虛擬助理后獲得 |user_id |String| 是 |用戶唯一標識,便于支持個性化語義解析。建議開發者使用 UUID 字符,且不同用戶必須用不同的 user_id,防止意圖串。 #### (3)返回說明 **返回參數說明** |名稱 |類型| 說明 |:---|:---|:--- |code |Integer | 返回代碼 |msg | String |返回代碼描述 |parameters|JSON Object |解析到的實體以及服務說明 |action|String|服務的接口名稱 |name| String|匹配的意圖名稱 |result | JSON Object| 接口返回內容 |outputs| Array| 服務輸出結果,微信端使用 type 類型為 wechat 開頭的內容;硬件端收到所有內容,依據需求解析使用 **返回代碼說明** |返回代碼 |錯誤類型|說明 |:---|:---|:--- |0/200 |成功 |請求成功 |400 |無效請求 |某些必需參數缺失或參數值錯誤,詳見msg字段 |401 |未授權 |授權失敗,app_key缺失或錯誤 |403 |請求被禁止|有效請求,但服務拒絕響應,請聯系contact@ruyi.ai |408 |請求超時 |請求響應超時,一般響應時間設置為2000ms以內 |429 |短時間內大量訪問 |短時間內請求數過多 |500 |內部錯誤 |服務處理異常 |503 |服務不可用|服務異常或正在維護 #### (4)請求示例 **請求范例** 打開詩詞大會 了解玩法 開始答題 錯 是 跳過 退出 **請求示例喚醒** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=打開詩詞大會 (喚醒) 返回結果 ```json {"code": 0, "msg": "ok", "result"{ "_text": "打開詩詞大會", "msg_id": "22baaf5d-4fe5-4e5b-a6af-a7110d208d72", "intents": [ { "parameters": { "打開詩詞大會": "打開詩詞大會", "any": "", "service": "poetryCongress" }, "action": "喚醒", "name": "打開詩詞大會", "result": { "poetCollectInfo": { "playCount": 159, "collectedPoet": [ "詩魔白居易", "詩狂賀知章", "詩杰王勃", "詩豪劉禹錫" ], "notCollectPoet": [ "詩佛王維", "詩鬼李賀", "詩圣杜甫", "詩仙李白" ] } "text": "歡迎回到詩詞大會。你可以了解玩法或現在開始答題。", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "歡迎回到詩詞大會。你可以了解玩法或現在開始答題。" } }, { "type": "voice", "property": { "name": "詩詞大會.m4a", "voice_url": "https://qiniu.ruyi.ai/FheQoy3Yh__bW5s_CqQ36xxkVLuv/詩詞大會.m4a" } }, { "type": "dialog", "property": { "text": "歡迎回到詩詞大會。你可以了解玩法或現在開始答題。", "emotion": "positive" } } ], "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "00f8eebf-5931-4354-9e15-e58f2a371a00" } ], "meta_process_milliseconds": 171 } ``` **請求示例正確** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=開始答題 (開始答題) 返回結果 ```json {"code": 0, "msg": "ok", "result"{ "_text": "開始答題", "msg_id": "7b643234-74f1-4530-81a4-a670490e0236", "intents": [ { "parameters": { "any1": "答題", "any": "", "service": "poetryCongress" }, "action": "開始", "name": "開始", "result": { "chapter": "明辨是非", "question": { "correctGroup": { "questionType": "詩句,詩句", "verse1": "會當凌絕頂", "verse2": "一覽眾山小" }, "questionType": "詩句,詩句", "verse1": "會當凌絕頂", "verse2": "便引詩情到碧霄", "poemIds": "57,4,119" }, "answer": "錯誤", "qNo": 1, "chapterQno": 1, "score": 0, "chapterScore": 0, "chanceToAnswer": 2 "text": "第一關:明辨是非。說“正確”或“錯誤”來答題。第1題,詩句“會當凌絕頂“的下一句是“便引詩情到碧霄”", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "第一關:明辨是非。說“正確”或“錯誤”來答題。第1題,詩句“會當凌絕頂“的下一句是“便引詩情到碧霄”" } }, { "type": "dialog", "property": { "text": "第一關:明辨是非。說“正確”或“錯誤”來答題。第1題,詩句“會當凌絕頂“的下一句是“便引詩情到碧霄”", "emotion": "calm" } }, "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "99b233c4-0152-4adb-a04d-5c64b3924e95" } ], "meta_process_milliseconds": 169 } ``` **請求示例正確** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=錯 (答題) 返回結果 ```json {"code": 0, "msg": "ok", "result" { "_text": "錯", "msg_id": "162e9861-d03a-4343-8584-d614fa8f95da", "intents": [ { "parameters": { "判斷": "錯誤", "text": "錯誤", "service": "poetryCongress" }, "action": "玩游戲", "name": "第一關", "result": { "chapter": "明辨是非", "question": { "correctGroup": { "questionType": "詩人,詩句", "poet": "杜甫", "verse": "江船火獨明" }, "questionType": "詩人,詩句", "poet": "王安石", "verse": "江船火獨明", "poemIds": "121,61,73" }, "answer": "錯誤", "isRight": true, "qNo": 2, "chapterQno": 2, "score": 1, "chapterScore": 1, "chanceToAnswer": 2, "lastQuestion": { "correctGroup": { "questionType": "詩句,詩句", "verse1": "會當凌絕頂", "verse2": "一覽眾山小" }, "questionType": "詩句,詩句", "verse1": "會當凌絕頂", "verse2": "便引詩情到碧霄", "poemIds": "57,4,119" }, "lastAnswer": "錯誤" "text": "答對了,真厲害!古詩“會當凌絕頂”的下一句是“一覽眾山小”。第2題,詩句“江船火獨明“是出自王安石", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "答對了,真厲害!古詩“會當凌絕頂”的下一句是“一覽眾山小”。第2題,詩句“江船火獨明“是出自王安石" } }, { "type": "dialog", "property": { "text": "答對了,真厲害!古詩“會當凌絕頂”的下一句是“一覽眾山小”。第2題,詩句“江船火獨明“是出自王安石", "emotion": "happy" } }, "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "1b8acdf1-d287-455b-9172-0ea531abccf1" } ], "meta_process_milliseconds": 425 } ``` **請求示例錯誤** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=是 (答題錯誤) 返回結果 ```json {"code": 0, "msg": "ok", "result"{ "_text": "是", "msg_id": "8b5cf2e2-4d38-4f27-bbd9-719ad3bcac32", "intents": [ { "parameters": { "判斷": "正確", "text": "正確", "service": "poetryCongress" }, "action": "玩游戲", "name": "第一關", "result": { "chapter": "明辨是非", "question": { "correctGroup": { "questionType": "題目,詩句", "title": "滁州西澗", "verse": "上有黃鸝深樹鳴" }, "questionType": "題目,詩句", "title": "滁州西澗", "verse": "上有黃鸝深樹鳴", "poemIds": "108" }, "answer": "正確", "isRight": false, "qNo": 3, "chapterQno": 3, "score": 1, "chapterScore": 1, "chanceToAnswer": 2, "lastQuestion": { "correctGroup": { "questionType": "詩人,詩句", "poet": "杜甫", "verse": "江船火獨明" }, "questionType": "詩人,詩句", "poet": "王安石", "verse": "江船火獨明", "poemIds": "121,61,73" }, "lastAnswer": "錯誤" "text": "答錯了,好可惜!詩句“江船火獨明”是出自杜甫。第3題,詩句“上有黃鸝深樹鳴“是出自古詩滁州西澗", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "答錯了,好可惜!詩句“江船火獨明”是出自杜甫。第3題,詩句“上有黃鸝深樹鳴“是出自古詩滁州西澗" } }, { "type": "dialog", "property": { "text": "答錯了,好可惜!詩句“江船火獨明”是出自杜甫。第3題,詩句“上有黃鸝深樹鳴“是出自古詩滁州西澗", "emotion": "calm" } }, "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "1b8acdf1-d287-455b-9172-0ea531abccf1" } ], "meta_process_milliseconds": 355 ``` **請求示例正確** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=跳過 (跳過) 返回結果 ```json {"code": 0, "msg": "ok", "result" { "_text": "跳過", "msg_id": "862d8d72-d156-4acb-b492-90d319f3356b", "intents": [ { "parameters": { "service": "poetryCongress" }, "action": "跳過", "name": "第一關跳過", "result": { "code": 200, "response": { "code": 0, "msg": "成功", "result": { "chapter": "明辨是非", "question": { "correctGroup": { "questionType": "題目,詩句", "title": "憶江南", "verse": "日出江花紅似火" }, "questionType": "題目,詩句", "title": "憶江南", "verse": "日出江花紅似火", "poemIds": "85" }, "answer": "正確", "isRight": false, "qNo": 4, "chapterQno": 4, "score": 1, "chapterScore": 1, "chanceToAnswer": 0, "lastQuestion": { "correctGroup": { "questionType": "題目,詩句", "title": "滁州西澗", "verse": "上有黃鸝深樹鳴" }, "questionType": "題目,詩句", "title": "滁州西澗", "verse": "上有黃鸝深樹鳴", "poemIds": "108" }, "lastAnswer": "正確" } }, "text": "好,跳過前公布正確答案:詩句“上有黃鸝深樹鳴”是出自滁州西澗。第4題,詩句“日出江花紅似火“是出自古詩憶江南", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "好,跳過前公布正確答案:詩句“上有黃鸝深樹鳴”是出自滁州西澗。第4題,詩句“日出江花紅似火“是出自古詩憶江南" } }, { "type": "dialog", "property": { "text": "好,跳過前公布正確答案:詩句“上有黃鸝深樹鳴”是出自滁州西澗。第4題,詩句“日出江花紅似火“是出自古詩憶江南", "emotion": "positive" } }, "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "9c23cfbe-58bf-40e4-9da0-17e499db22f7" } ], "meta_process_milliseconds": 167 } ``` **請求示例退出** http://api.ruyi.ai/ruyi-api/v1/message?app_key=APP_KEY&user_id=user0&q=退出 (退出游戲) 返回結果 ```json {"code": 0, "msg": "ok", "result"{ "_text": "退出", "msg_id": "7c65fc2c-2138-4932-8410-c28202e40e95", "intents": [ { "parameters": { "text": "退出", "service": "poetryCongress" }, "action": "玩游戲", "name": "退出如意技能", "result": { "chapter": "明辨是非", "question": { "correctGroup": { "questionType": "詩人,詩句", "poet": "毛澤東", "verse": "風華正茂" }, "questionType": "詩人,詩句", "poet": "杜甫", "verse": "風華正茂", "poemIds": "55,67,32" }, "answer": "錯誤", "isRight": false, "qNo": 5, "chapterQno": 5, "score": 1, "chapterScore": 1, "chanceToAnswer": 0, "lastQuestion": { "correctGroup": { "questionType": "題目,詩句", "title": "憶江南", "verse": "日出江花紅似火" }, "questionType": "題目,詩句", "title": "憶江南", "verse": "日出江花紅似火", "poemIds": "85" }, "lastAnswer": "正確" "text": "好的,下次準備好跟我說打開詩詞大會哦", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "你在詩詞大會的第一關答對了1題,總共答對了1題,再接再厲哦" } }, { "type": "dialog", "property": { "text": "你在詩詞大會的第一關答對了1題,總共答對了1題,再接再厲哦", "emotion": "calm" } } ], "score": "1.0", "scoreColor": "c4", "is_match": 1, "skill_id": "d5a90c2c-d1ef-48d0-8301-adb350042d6d", "id": "b5646f63-d40a-454a-9aba-9017ad31946e" } ], "meta_process_milliseconds": 179 } ``` **詳細參數說明** |名稱|類型|說明| |:---|:---|:--- |service | String |服務名稱 |poetsToCollect| String |所有可收集的詩人卡片名稱列表 |poetCollectInfo| Object |用戶詩人卡片收集信息 |playCount| int |用戶玩游戲次數,首次進入為0 |collectedPoet| List |已獲取的詩人卡片名稱列表 |notCollectPoet| List |未獲取的詩人卡片名稱列表 |chapter| String |章節關卡,分為“明辨是非”,“對答如流”,“詩詞捉迷藏” |question| Object |新的題目信息,具體參考題目信息說明 |answer |String 新的題目答案 |qNo| int |當前題號 |chapterScore| int |當前章節積分 |score| int |總積分 correctGroup| Object| “明辨是非”章節中,題目對應正確的組合,內容與題目類型對應,參考明辨是非題目類型說明 |questionType |String |明辨是非題目類型,分為"詩人,題目","詩人,詩句","題目,詩句","詩句,詩句" |poet |String |詩人名稱 |title |String |詩詞標題 |verse |String| 詩句 |text |String |用戶所說原文 |lastQuestion |Object |上一道題目信息,具體參考題目信息說明 |isRight| boolean |上一題是否回答正確 |mission| int |關卡,1表示第一關,2表示第二關 |count| int |通關次數 |playTimes| int |用戶進入游戲的次數 **指令清單** |指令名稱|范例| |:---|:--- |喚醒 | 打開詩詞大會 |游戲玩法介紹 | 游戲玩法 |開始答題 | 開始答題 |跳過 | 跳過 |退出 | 退出
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看