If you do not have a target selected, this console command enables and disables (toggles) all non-combat AI. When non-combat AI is disabled, NPCs (characters, monsters, etc) have all non-combat functions (like dialogue) disabled. If you have selected a target, this command will toggle non-combat AI for the selected NPC only.
tai Target Command
This is the only way the toggle artificial intelligence command can be executed. If you have an NPC selected when you execute this command, AI will be toggled for that NPC - otherwise, this will toggle AI for all NPCs in the game.
ToggleAI is simply a longer version (alias) of the TAI command - it has the exact same function.