IhsanDevs / EdgeGPT

Bing AI Chatbot WebSocket API Wrapper for PHP
MIT License
21 stars 5 forks source link

Error after installing via Composer #5

Open kjekol opened 11 months ago

kjekol commented 11 months ago

Hi Ishan,

I was trying to install you EdgeGPT API on a new server. This is what I have tried:

_require(__DIR__ . '/vendor/autoload.php');
use Ihsandevs\EdgeGpt\Chatbot;
$bot = new Chatbot(__DIR__ . '/cookies.json');

// You can use the following conversation styles: CREATIVE, BALANCED, PRECISE. Or you can keep it empty.
$response = $bot->ask('What is a banana?', 'PRECISE');

echo $response->answer();_

When I try to run the script, I get this:

Fatal error: Uncaught Error: Class 'Ihsandevs\EdgeGpt\Chatbot' not found in //index.php:87 Stack trace: #0 {main} thrown in //index.php on line 87

Not sure why this isn't working. Any idea?

Regards, K

nguyenduc1222 commented 10 months ago
  1. Change file name EdgeGPT/src/ChatBot.php to Chatbot.php
  2. Change file name EdgeGPT/src/NotAllowedAccess.php to NotAllowedToAccess.php
  3. require(DIR . '/vendor/autoload.php'); to require DIR . '/../vendor/autoload.php';
aM0N12 commented 7 months ago
  1. Change file name EdgeGPT/src/ChatBot.php to Chatbot.php

    1. Change file name EdgeGPT/src/NotAllowedAccess.php to NotAllowedToAccess.php

    2. require(DIR . '/vendor/autoload.php'); to require DIR . '/../vendor/autoload.php';

How to achieve this please ? Rename in the FTP client ?