Ah, okay, I think I have grokked your problem. Finally. Apologies … and correct me if I’m wrong.
What I think is happening is that your main script with the OpenAI client is in Python and you’re trying to call a PHP script. You’ll want the function code in with the rest of main.py… I don’t think you can call external PHP scripts, but you could create the OpenAI client in your PHP script and have the function there…
So, you can rewrite it so that the function code is in Python or make it all PHP. Does that make sense?
Note, I could be wrong as I don’t use Assistants API frequently!