UserUttered event giving error for arguments

Hello, I m using a UserUttered event at the end of a function:

class ActionSaveServiceSection(Action):

def name(self) -> Text:
    return "action_save_service_section"
def run(self, dispatcher, tracker, domain):
    global user_proposal_option
    user_proposal_option = tracker.get_slot("services")
    global lead_object_id
        {"_id": lead_object_id},
            "$set": {
                "Department": user_proposal_option
    return [UserUttered("/write_query", {'name': 'write_query', 'confidence': 1.0}, []),
            SlotSet("services", None)]

If i write event in the following way:

return [UserUttered(text="/write_query", intent={‘name’: ‘write_query’, ‘confidence’: 1.0}, entities=[]), then it gives error “Unexpected keyword argument: intent” so I removed the keywords.

Without keywords, as mentioned in the code, I am getting following error: Traceback (most recent call last): . . . . . . . line 427, in update for e in domain.slots_for_entities(event.parse_data[“entities”]): KeyError: ‘entities’

Also I got this in logs:

Action ‘action_save_service_section’ ended with events ‘[‘UserUttered(text: /write_query, intent: {}, entities: [])’, ‘SlotSet(key: services, value: None)’]’

Please help.