Download the PHP package maximerenou/bing-ai without Composer

On this page you can find all versions of the php package maximerenou/bing-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bing-ai

New feature: send images in chat 🔥

Bing AI client

License Latest Stable Version PHP version cURL extension required

This is an unofficial PHP client for Bing AI, including Chat (GPT-4) and Image Creator (DALL-E).

Installation

composer require maximerenou/bing-ai

Demo

This demo program uses both Chat and Image Creator:

Source: examples/multi.php.

Usage

First, you need to sign in on bing.com and get your _U cookie.

❗ Make sure you send a first message to Bing Chat before using your cookie (CAPTCHA bypass)

How to get this cookie? 1. Navigate to bing.com 2. Sign in using your Microsoft account 3. Back on bing.com, go to Bing Chat page and send a message (CAPTCHA verification occurs sometimes) 4. Then, right-click and select "Inspect" - the browser console appears 4. Go to "Application" tab 5. Select "Cookies" > "https://www.bing.com" in the sidebar 6. Search for "_U" cookie 7. Copy its content
How to check if my cookie is working properly?

Chat AI

Demo: clone this repo, edit and run examples/chat.php.

$cards contains all "messages" exchanged with Bing AI. It can be text (prompt or answer), signals, suggestions, image generation requests, etc. Check Message.php to learn more about its format.

🔥 Image analysis You may attach an image to your message: > **Try it!** Type _`$image`_ at the end of your message with `examples/chat.php`.
Real-time / progressive answer You may pass a function as second argument to get real-time progression:
Locale and location preferences
Tone choice
Resume a conversation If you want to resume a previous conversation, you can retrieve its identifiers:
Text generation > To prevent answers like "I have already written \[...]", you can disable cache for your prompt with `withoutCache()`.
Handle throttling and kicks Bing is limiting messages count per conversations. You can monitor it by calling `getRemainingMessages()` after every interaction. After every interaction, you should also check if you have been kicked from the conversation: You may combine both checks with:

Image Creator

Demo: clone this repo, edit and run examples/images.php.

Image generation can become slower after consuming all of your "boosts". Check the section below to stay aware of your remaining boosts.

Check remaining boosts
Asynchronous generation You may quit after calling `createImages()` and check generation later using its ID:
Manually wait Instead of calling `$creator->wait();` you can loop by yourself:

Disclaimer

Using Bing AI outside bing.com may violate Bing terms. Use it at your own risk. Bing is a trademark of Microsoft.


All versions of bing-ai with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ratchet/pawl Version ^0.4.1
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maximerenou/bing-ai contains the following files

Loading the files please wait ....