简体   繁体   中英

Unable to extract log from watson assistant

Please I have struggling with consuming watson assistant log API. currently we use watson assistant log API for fetching daily conversation log between our chatbot and customer and feed the log into NLC for classifying the intents for precision analyst. Recently we observed that IBM has decomission the NLC and advice that we migrate to NLU. since then we've being having issues getting the component running. right now the assistant log return empty log for this filter

authenticator = IAMAuthenticator('********')
        assistant = AssistantV2(
            version='2021-06-14',
            authenticator = authenticator
        )

        assistant.set_service_url('https://api.eu-gb.assistant.watson.cloud.ibm.com')
        print("The assistant URL ")
        
        response=assistant.list_logs(
            assistant_id='******', page_limit=100, filter='response_timestamp>2022-09-14T00:00:00.000Z',
                                                cursor=cursor).get_result()
        response=assistant.list_logs(
            assistant_id='*******').get_result()
        print(json.dumps(response, indent=2))
        #print("the response is ",response)    

this is returning an empty data

{
  "logs": [],
  "pagination": {}
}

Here are some reasons why this may occur.

  • You are using V2 API which requires an Enterprise account. If you only have Plus then you can use the V1 API. But there is no guarantee it will continue to work as expected in the future.

  • You don't have any logs for that date range. Check in the Analytics page.

  • An issue in your code. Try running the sample code on the REST API docs . If this works then compare against your code.

Your filter looks ok, but try this filter (change language and assistant ID):

language::en,request.context.system.assistant_id::<YOUR_ASSISTANT_ID>,response_timestamp>2022-09-14T00:00:00.000Z

Seeing as you have midnight as your time, you can also change that part to:

response_timestamp>2022-09-14

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM