2017-03-03 59 views
0

目前我正在使用IBM Watson Coversation api提供的chatbot服務。現在我遇到了一個問題,就是在chatbot的文本回復中添加了一個新行。誰能告訴我如何做到這一點?如何在IBM Watson chatbot對話中添加新行?

+0

請分享你至今嘗試過,包括您想要添加新行的代碼。 – ralphearle

+0

http://conversation-test-shinoy.au-syd.mybluemix.net/你可以在這裏找到這個機器人 –

+0

[在watson對話輸出(JSON)中添加換行符和間距]可能的重複(http://stackoverflow.com/questions/40023329/added-newline-and-spacing-in-watson-conversation-output-json) –

回答

4

在這種情況下,您可以使用HTML表示,內部對話流程爲<br>

檢查我的例子:

enter image description here

你可以看到不工作的 「實戰」:

enter image description here

但是如果你打開一個瀏覽器,你看到那個工作:

enter image description here

檢查JSON例如:

{ 
    "output": { 
    "text": { 
     "values": [ 
     "Hey, <br>Can I help you?", 
     "", 
     "" 
     ], 
     "selection_policy": "random" 
    } 
    } 
} 

您可以使用其它的標籤,例如:<button><id>

+0

其工作.....非常感謝.. –

+0

不客氣。 –

相關問題