[BUG] Internal events keep on getting accumulated and reach the limit to 100 with less than 5 rails applied.
The following code throws an exception when the number of internal events cross the hardcoded limit.
nemoguardrails/colang/v1_0/runtime/runtime.py
# As a safety measure, we stop the processing if we have too many events.
if len(new_events) > 100:
raise Exception("Too many events.")
My proposal is to either increase this limit or delete the older redundant events from the event's history to keep it short. Events like ContextUpdate, StartInternalSystemAction can be deleted from the history to trim it down
Thanks for reporting this @uvnikgupta! Indeed, there are a couple of solutions here:
- Keep an explicit counter of the new events, and only increment it on certain types of events, e.g. starting a non-system action, bot saying something. (removing them would cause some other issues)
- Expose a way to control that limit as well (setting in config/environment variable).
If you want to contribute a solution, either would be fine.
Thanks!
@drazvan, as a quick fix, I would propose adding a config parameter max_history_events with the default value of 100. If you agree, I can trying making this change and submit a PR
Yes, let's call it max_new_events, as it captures better the meaning (i.e., the maximum number of new events that can be generated in a processing iteration). Thanks!