AI is not creatable, there's only one instance of it. It can only be accessed through its globally exposed variable.

AI is a shortcut to require("ai"). See ai module.

-- example, using AI:CreateChat instead of require("ai"):CreateChat
local chat = AI:CreateChat("You are a geography expert that answers with answers of 20 words maximum.")
chat:Say("Give me 5 random european countries.", function(err, message)
  if err then print(err) return end
  print("AI says: " .. message)