使用R调用Watson Conversation API

时间:2019-02-13 19:53:38

标签: r ibm-watson

我正在尝试使用R调用Watson Conversation,但出现此错误

conversation.init <- function()  
{
  raw_response <- POST(url=paste(url_CONV,workspace_CONV,version,sep=""),
                       authenticate(username_CONV,password_CONV),
                       add_headers("Content-Type"="application/json"),
                       body = '{ "input": { "text":""},
                       "system":{ "dialog_stack":["root"]},
                       "dialog_turn_counter":1,
                       "dialog_request_counter":1
}',
                 encode = "json"
  )
  return(content(raw_response, "text", encoding = "UTF-8"))
  }

我得到的结果是

[1]“

沃森错误

--------------------------- --------------------------------------------------

------------------------------------ -----------------------------------------

- -------------------------------------------------- -------------------------

请求网址:https://gateway.watsonplatform.net/assistant/apida8ba5e3-a02a-42ca-9f99-70f00043bd3f?version=2018-09-20

--- -------------------------------------------------- ------------------------

错误代码:ERCD-NOCONFIG

错误转移ID:gateway01 -1010827265

日期时间:2019-02-13T13:41:34-06:00

----------------- -------------------------------------------------- ----------

--------------------------------- --------------------------------------------

“ < p>

0 个答案:

没有答案