NVIDIA / NeMo-Guardrails

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.
Other
4.09k stars 380 forks source link

Problem with ActionDispatcher Not Recognizing Custom Action in UI #265

Open cyun9601 opened 9 months ago

cyun9601 commented 9 months ago

I defined a Data Class outside the config folder and imported it into action.py in the actions folder to use it.

When running the Chatbot via python API, the ActionDispatcher correctly recognizes this Action, but when running through the UI, it fails to recognize it. If I include the defined Data Class within action.py, it is recognized properly.

However, I need to use this code in several Action files, so I have to import it.

Can someone help identify the issue?

drazvan commented 9 months ago

@cyun9601 : it's most likely related to the PYTHONPATH. When starting the server, make sure that the root folder from where you're importing is in the PYTHONPATH.