Create an agent to access tracker

I created a custom channel in order to communicate with a custom chat, and it’s working great, but now I want to open a new route so the chat can modify slots through events. I want to do the exact same thing as the route /tracker/events, so I checked the code base, and I don’t understand how to create an agent to do things like :

tracker.agent.tracker_store.get_or_create_tracker(sender_id)  

Can anyone help me ? (If it helps, I want to copy the method append_event from rasa_core/server.py at master · RasaHQ/rasa_core · GitHub)

Thank you in advance !

I should specifie that I only have a core (in a docker container, action-server and nlu are in an another container) so I tried this :

_endpoints = AvailableEndpoints.read_endpoints(os.environ['RASA_CORE_ENDPOINTS_CUSTOM_CHANNEL'])
self.agent.load_agent(os.environ['RASA_CORE_MODEL_CUSTOM_CHANNEL'], interpreter=RegexInterpreter(), endpoints=_endpoints)

and then :

request_params = request.get_json(force=True)
            evt = Event.from_parameters(request_params)
            tracker = self.agent.tracker_store.get_or_create_tracker(sender_id)
            if evt:
                tracker.update(evt)
                self.agent.tracker_store.save(tracker)

To update the tracker. There is no error when I send an event, it returns with a json saying the slot is set, but when I send a message with the same conversation id, the slot is None. I’m using redis as tracker_store

If anyone have the same bug one day, the problem is that I didn’t load a tracker store with the agent in load_agent (the fourth argument) :

_broker.PikaProducer.from_endpoint_config(_endpoints.event_broker)
_tracker_store=TrackerStore.find_tracker_store(None, _endpoints.tracker_store, _broker)