Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Error after installing via Composer #5

Open
kjekol opened this issue Aug 14, 2023 · 2 comments
Open

Error after installing via Composer #5

kjekol opened this issue Aug 14, 2023 · 2 comments

Comments

@kjekol
Copy link

kjekol commented Aug 14, 2023

Hi Ishan,

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

  • Installed the EdgeGPT: When composer show, I'll get: ihsandevs/php-edge-gpt 1.0.0 Bing AI Chatbot WebSocket API Wrapper for PHP. Its seems correct.

  • Then I created a test script:

_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();_

  • I created json for the _U Cookie at DIR. '/cookies.json':
    {"_U":"1CS-85M-FdJqj4Jnq6TC6cyj_KfdFnkT10IUbTTmy2NHvcdyhFKgvLh0yUEL85tPPLpeTwyz2Aerdhg58PGR1XpUDlop-yqQR1fZ7Ql4-b9oppGvSXxMFxTnt20haDRHKHh2WplIPCuPE1g21mUOk5J61_QHfaVVU0uF0XMNtIYUsQ_rR8lXxigmKhxwYjO8Zc9AQ1_os7HAZDzItp8oGLwz.............."}

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
Copy link

  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
Copy link

aM0N12 commented Dec 5, 2023

  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 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants