Rasa Knowledge base object_name error

Hello so I began using rasa knowledge base via provided examples in the documentation. Everything works like it should except one thing. When I try to get object attribute for some reason {object_name} comes up as '<function KnowledgeBase.init.... at 0x7f1a093983b0>' has the value '1850–2200 W.' for attribute 'galia'.

As you can see the {attribute_value} and {attribute_name} comes up as perfect strings. While {object_name} comes up as some gibberish stuff.

1 Like

@Juste Maybe you could help?

Can you share the debug log output of the conversation that gave you the object name in the format you mentions?

Im sorry I dont quite understood what you meant by that. Conversation goes smoothly and without errors. Its just the object_name variable(constant, or entity whatever) comes up as “function KnowledgeBase.init… at 0x7f1a093983b0” while it should come up as an “Microwave”. If you could help me with providing the steps to debug it I would gladly follow them.

Thank you!

Did you modify any code? How does you json data look like?

How do you interact with your bot? One way would be via rasa shell via the command line. If you add --debug to that command you can see the debug output. Might help if you share that output here.

Hi currently I did not modified any code just used your tutorials and your git repos to create custom action that querries knowledge base (.json) and searches for objects. My json data is copy pasted from your tutorial in here Knowledge Base Actions except with additional attributes. I made a docker compose override file which looks like this. As you can see my KB actions.py file looks identical to this one rasa-sdk/actions.py at master · RasaHQ/rasa-sdk · GitHub

app:
    image: 'rasa/rasa-sdk:latest'
    volumes:
      - ./knowledge_base_data.json:/app/knowledge_base_data.json
      - ./actions:/app/actions
    expose:
      - '5055'
    depends_on:
      - rasa-production

Also I interact with my bot via Rasa x dashboard

Also I looked thru logs the only error I see is this one

/app/rasa_sdk/utils.py:160: UserWarning: Your versions of rasa and rasa_sdk might not be compatible. You are currently running rasa version 2.0.2 and rasa_sdk version 2.2.0a1.
app_1              | To ensure compatibility use the same version for both, modulo the last number, i.e. using version A.B.x the numbers A and B should be identical for both rasa and rasa_sdk.

and this console log for object_name variable

app_1              | 2020-12-14 13:06:47 WARNING  root  - <function KnowledgeBase.__init__.<locals>.<lambda>.<locals>.<lambda> at 0x7f784848b3b0>

I failed to reproduce the problem on the latest Rasa version using the knowledgebasebot example. Can you maybe update to the latest Rasa version and try again? Does the example knowledgebasebot work for you?

Hi. As per your request I updated my Rasa package to {"rasa":{"production":"2.1.2","worker":"2.1.2"},"rasa-x":"0.34.0" Also downloaded knowledgebasebot /actions.py file and still got the same answer

'<function KnowledgeBase.**init** .... at 0x7f6c2399cb90>' has the value '1850–2200 W.' for attribute 'galia'.

image

I just tried your example bot on clean AWS Ubuntu instance. Went thru install.sh script. Added docker.override and custom action of your git repo. And still got the same problem

Also I noticed that to querry attribute the function querry_object needs to be called first. Which means I cannot querry for attribute without first printing all the objects for the user. How can I go around that?

Hi Im having the same issue. Were you able to resolve this by any chance?

Updating rasa to the latest version(2.4.3) with pip install rasa --upgrade and fixing the sanic version requirement like it is mentioned here fixed it for me! :+1:

@hrabago good for you. To be honest I worked with Rasa stuff like 3-4 months ago. All I can remmember I went into the code itself and fixed it myself. As I currently do not have access to the project I cant really tell what I did.

1 Like