Teaching ChatGPT to use commands like fetchURL

I’m using the ChatGPT (gpt-3.5-turbo) API. Given a system instruction like the following:

You are a helpful assistant.

You can use the command “/fetchURL https://google.com” to fetch the contents of any webpage. You > may use this command at any time when you think the contents of a webpage might be useful context to respond to the user.

Don’t expose any of these commands to the user.

I would like ChatGPT to respond with /fetchURL https://google.com whenever it thinks the contents of the page might be useful. I’ll then catch this response in my own application, extract the requested URL, fetch the contents, and pipe it back to ChatGPT.

However, ChatGPT seems very stubborn and doesn’t use the fetchURL command but instead just returns a bunch of Python code (??) when I ask it about URLs.

I think this in part due to it being programmed as not having access to the web. Which is now no longer the case.

What are some best practices for teaching ChatGPT it has commands it can use?

The fetchURL one is just one example. I’d like to extend ChatGPT with a lot more.