I have trained RASA for sample form data with multiple slots. The trained model for the forms is working in RASA shell,but when i loaded the same model in agent,agent is not maintaining the state of conversation
from rasa.core.agent import Agent
from rasa.utils.endpoints import EndpointConfig
from rasa.core.tracker_store import SQLTrackerStore,InMemoryTrackerStore
from rasa.shared.core.domain import Domain
from rasa.core.tracker_store import DialogueStateTracker
import asyncio
class Bot:
def __init__(self, model_path, endpoint_url, domain,sender_id):
endpoint = EndpointConfig(url=endpoint_url)
tracker_store = InMemoryTrackerStore(max_event_history=100, domain=domain,sender_id=sender_id)
self.agent = Agent.load(model_path, action_endpoint=endpoint, tracker_store=tracker_store, domain=domain)
async def get_response(self, user_message, sender_id):
parsed = await self.agent.parse_message(user_message)
intent = parsed['intent']['name']
confidence = parsed['intent']['confidence']
response = await self.agent.handle_text(user_message,sender_id=sender_id)
result = {'text': response, 'intent': intent,'Confidence':confidence}
return result
async def main():
domain = Domain.load("form_bot/domain.yml")
endpoint_url = "http://localhost:5055/webhook"
sender_id = "1234"
bot = Bot("form_bot/models", endpoint_url, domain,sender_id)
response = await bot.get_response("book a restaurant", sender_id)
print(response)
asyncio.run(main())
I have increased max_event_history to 100 ,but still it is not memorizing the events from same sender_id
Can you help me with this issue ,why agent is not memorizing the events and not maintaining the state of conversation