This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ihsan Devs
committed
Mar 24, 2023
1 parent
c5204e4
commit 3842ff3
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
![EdgeGPT](https://socialify.git.ci/IhsanDevs/EdgeGPT/image?description=1&font=Inter&forks=1&issues=1&language=1&logo=https%3A%2F%2Fimg.icons8.com%2Fnolan%2F512%2Fchatgpt.png&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light) | ||
|
||
# Edge-GPT: Bing AI Chatbot WebSocket API Wrapper for PHP | ||
|
||
The ihsandevs/edge-gpt library is a powerful and easy-to-use PHP wrapper for the Bing AI Chatbot, leveraging the WebSocket API. Seamlessly integrate the advanced conversational capabilities of Bing's AI Chatbot into your PHP projects and create engaging user experiences with ease. | ||
|
||
## Requirements | ||
|
||
- python 3.8+ | ||
- A Microsoft Account with early access to <https://bing.com/chat> (Required) | ||
|
||
## Getting authentication (Required) | ||
|
||
- Install the cookie editor extension for [Chrome](https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/cookie-editor/) | ||
- Go to `bing.com` | ||
- Open the extension | ||
- Click "Export" on the bottom right (This saves your cookies to clipboard) | ||
- Paste your cookies into a file `cookies.json` | ||
|
||
## Installation | ||
|
||
To use this library, you can use Composer to install it. Run the following command: | ||
|
||
```bash | ||
composer require ihsandevs/php-edge-gpt | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
<?php | ||
|
||
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('Buatkan kode php untuk menampilkan "Hello Ihsan Devs" pada terminal.', 'PRECISE'); | ||
|
||
echo $response->answer(); | ||
``` | ||
|
||
## License | ||
|
||
[MIT](https://choosealicense.com/licenses/mit/) |