Hope all of you are good. Currently i am stucked at a points where i am able to extract number from text i want to save this value in Transaction_ID . Could you please help how to set this value. I am using FreeTextFormField () to get this value.
Yaa I used and while interacting, training it is asking for Transaction_ID and when i am giving as a number it is taking as a new entity it is not taking that number as Transaction_ID slot.
both are getting extracted as numbers because I assume you’re using duckling, and then by default only the last number gets stored. If you want to store one of them in the TransactionID slot, then you need to do this in a custom action with a SlotSet() event
Hi @akelad thanks for suggestion i created custom action but getting below error. Please let me know any changes required
action.py :
class GetTransactionID(Action):
def name(self):
return “action_transaction_id”
def run(self, dispatcher, tracker, domain):
Transaction_ID = tracker.get_slot(“number”)
if Transaction_ID:
return [SlotSet(“Transaction_ID” , Transaction_ID)]
Interactive learning:
Chat History
Bot You
1 action_listen
2 Please check the transaction ID 71168 . Still points not received
intent: Add_Transaction 0.97
─
3 slot{“number”:
71168.0}
Current slots:
# Bot You
1 action_listen
2 Please check the transaction ID 71168 . Still points not received
intent: Add_Transaction 0.97
3 slot{“number”:
71168.0}
Current slots:
Customer_ID: None, Date: None, Transaction_ID: None, number: 71168.0
Error:
ERROR:rasa_core.actions.action:Failed to run custom action ‘action_transaction_id’. Action server responded with a non 200 status code of 500. Make sure your action server properly runs actions and returns a 200 once the action is executed. Error: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:5055/webhook
ERROR:rasa_core.processor:Encountered an exception while running action ‘action_transaction_id’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
ERROR:rasa_core.processor:Failed to execute custom action.