我試圖運行在IBM的統一沃森會話業務和following here, code snippetIBM沃森交談服務錯誤:無法從「方法組」轉換爲「conversation.onMessage」
private Conversation m_Conversation = new Conversation();
private string m_WrokspaceID = "xyz";
private string m_input = "help";
// Use this for initialization
void Start() {
Debug.Log("user : " + m_input);
m_Conversation.Message(OnMessage, m_WrokspaceID, m_input);
}
void OnMessage(MessageResponse resp, string customData) {
foreach (Intent mi in resp.intents)
{
Debug.Log("intent : " + mi.intent + ", confidence :" + mi.confidence);
}
Debug.Log("response :" + resp.output.text);
}
但我得到這個錯誤
cannot convert from 'method group' to 'conversation.onMessage'
我做錯了什麼?我從watson官方github回購中得到的代碼片段。
在哪一行發生此錯誤?我猜'm_Converstion.Message(OnMessage ...''m_Conversation.Message'的簽名是什麼?它作爲第一個參數而不是該方法的期望是什麼? –
@RenéVogt是同一行,它期望對象 –