Ai knowledge and logicHelpers

delete_conversation_metadata

Delete a metadata key from the current conversation.

delete_conversation_metadata(context: dict, key: str) -> dict

Removes a metadata key-value pair from the conversation.


Parameters

NameTypeDescription
contextdictThe context object passed to your action
keystrThe metadata key to delete

Returns

dict{"success": bool, "message": str}

Returns {"success": False, "message": "Key not found"} if the key doesn't exist.

Behavior

  • In test/mock environments, returns a mock success response without persisting.

Examples

Clean up temporary metadata

def execute_action(context):
    # Remove a temporary flag after processing
    delete_conversation_metadata(context, "pending_verification")
    return {"success": True}

On this page