How can i achieve Aggregate function in knowledge base Actions?

If i want to get total count of specific record from database, how can i achieve it using the experimental feature knowledge base actions?

We don’t support aggregate functions out of the box. You would need to overwrite the ActionQueryKnowledgeBase (see Knowledge Base Actions and link to the current cod: rasa-sdk/ at master · RasaHQ/rasa-sdk · GitHub).

Do you want to always aggregate stuff when querying the knowledge base or just sometimes? If it depends on the user request, you might want to add a new function to the action, such as _query_aggregate. You would need to overwrite the run method (rasa-sdk/ at master · RasaHQ/rasa-sdk · GitHub) and route to the method whenever the user request matches certain circumstances.

Hope that helps. Let me know if you have any further questions.

hey @Tanja im trying to work with Knowledge Base Actions still in json fomat , so when i try the tuto given in the esamples about restaurants and hotels everything work fine , so i treid to custom my data and alwas keep sayin no object found , even when am changing entities and slots ,

i tried to leave the data as it is and just change name of object also same message no object found, even tho that am chaanging the slots anad entities in the domain file and working with my intent in nlu file ./