Just adding too the conversation. You can also add Google Bard and Common Crawl bots as well:
# Block OpenAI
User-agent: GPTBot
Disallow: /
User-agent: ChatGPT-User
Disallow: /
# Block Google Bard AI
User-agent: Google-Extended
Disallow: /
# Block Common Crawl
User-agent: CCBot
Disallow: /
Edit: Worth noting that Common Crawl is used by OpenAI, Bard, etc. when training their LLMs.