Assistants API won't allow external web request

I created an Assistant that has a tool which will run a python script I uploaded that does a simple web request to get a stock price. The Assistant finds the file and everything works, but fails because the Assistant refuses to make external web requests due to the environment? Is there any way around this? Not sure if it’s some permission thing with my account or just a limitation of the Assistants API today?

You have to upload the API schema under functions when creating the Assistant. If you aren’t sure how to create this it will be in JSON format, I would ask chatgpt to help you. You’ll want to have the specific functions you want to call from the external api laid out in your schema. If you try to make direct calls to an api in your code being uploaded I am pretty sure OpenAI has closed that environement. The GPT/Assistant cannot make the call unless its from within the functions area.

1 Like

Gotcha. So I did ask chatgpt to help great idea. So basically:

  • you have the Assistant figure out what needs to be done (it calls a function you have given it)
  • that Assistant Function would specify the function with the external API call in your application code you need to call and return it’s name and params
  • your application code runs that function and passes it back in to the assistant and the assistant can then use it for whatever.