Open Muthusi opened 1 year ago
Did you modify the original code? That error means the $open_ai_api
property is not set when calling the ask()
method, but it's set in the constructor so that error should never happen. What PHP version are you using?
I did try modifying the code as the initial error was "[30-Jun-2023 08:30:41 UTC] PHP Fatal error: Uncaught Error: Typed property ChatWTF\ChatWTF::$open_ai_api must not be accessed before initialization in /home2/mamamalo/test/src/ChatWTF.php:44 Stack trace:
thrown in /home2/mamamalo/test/src/ChatWTF.php on line 44) "
I am the thussprime on your youtube video. I had this error initially then tried moving the declaration of the API around to try to resolve it.
Make sure on line 30 in message.php you are passing $openai to GoogleSearchChatWTF. Also check that the constructor of GoogleSearchChatWTF has $open_ai_api as a parameter. The orhanerday/open-ai package should also be installed.
Hi first, I like your code very creative and interesting, I am trying to run the code but I have an error I have tried resolving no no avail.
PHP Fatal error: Uncaught Error: Typed property ChatWTF\ChatWTF::$open_ai_api must not be accessed before initialization in /home2/mamamalo/aibuddy.com/test/src/ChatWTF.php:44
Kindly help me sort it out.