heh, sure, but which website?
Each version of Agents.jl has its own “website”. Have you checked that the version of Agents.jl you have installed matches the version in the “website” you copied the code from? That is one likely source of error.
It is best if you follow the advice here Please read: make it easier to help you which includes reporting the package versions you are using and using the latest stable versions.