Code Monkey home page Code Monkey logo

autogpt-bingai's Introduction

Bing AI Plugin

The Bing AI Plugin enables Auto-GPT to use Bing AI to research information, ask questions, get advice, and more.

Screenshot 2023-05-01 at 7 49 55 AM

Key Features:

  • Bing AI already implemented researching information, so implementing this plugin will almost entirely negate the need to browse websites and the current implementation of researching information.
  • Allows Auto-GPT to consult Bing AI.
  • Allows Auto-GPT to be able to use GPT-4 as Bing AI is based on GPT-4.
  • Brings GPT-4 functionality to those without GPT-4 API access.

Getting Authentication (Required):

  • Install the cookie editor extension for Chrome or Firefox
  • Go to bing.com
  • Open the extension
  • You must be logged in to an account with Bing AI access.
  • Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)
  • Paste your cookies into a file cookies.json
  • IMPORTANT: Move the cookies.json file into the Auto-GPT folder.

Installation

Follow these steps to configure the AutoGPT Bing AI Plugin:

1. Clone this Repository

cd into a folder that you can find easily. For example: cd desktop. Then, paste this command: git clone https://github.com/gravelBridge/AutoGPTBingAI.git

2. Navigate to the folder

Navigate to the folder where you ran the cd command

3. Zip the BingAI folder

On MacOS, right click the BingAI folder and press Compress. On windows, right click the folder, and press Send to > Compressed (zipped).

4. Move the zip file

Move the new BingAI.zip file to the AutoGPT plugins directory, there should already be a file there titled __PUT_PLUGIN_ZIPS_HERE__.

6. Add BingAI configuration settings

Append the following configuration settings to the end of the .env file:

################################################################################
### BINGAI
################################################################################

BINGAI_COOKIES_PATH=./cookies.json
BINGAI_MODE=<your chosen mode>

For the BINGAI_MODE, use either precise, balanced, or creative.

AutoGPT Configuration

Set ALLOWLISTED_PLUGINS=BingAI,example-plugin1,example-plugin2,etc in your AutoGPT .env file.

7. Edit goals

When using Auto-GPT please set one of the goals to "Use ask_bing_genius whenever possible".

autogpt-bingai's People

Contributors

gravelbridge avatar h4ck3rk3y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autogpt-bingai's Issues

Error using plugin - Captcha

Hi,

When I try to use plugin command 'ask_bing_genius' the following error occurs:

Error while getting response: CaptchaChallenge: User needs to solve CAPTCHA to continue.. If the error is in regards to invalid authorization, inform the user, and prompt them to check their BingAI cookies.json file.
SYSTEM:  Command ask_genius_bing returned: CaptchaChallenge: User needs to solve CAPTCHA to continue.

Unexpected Keyword Argument Error

Problem:

The problem stemmed from a mismatch between the argument expected by the Chatbot class constructor in the BingAI Python module and the argument that was being passed to it. The error message pointed to this:

TypeError: Chatbot.__init__() got an unexpected keyword argument 'cookie_path'

This error indicates that the Chatbot class's __init__ method was being called with an argument (cookie_path) that it doesn't support.

Solution:

The solution was to change the Chatbot class's constructor to accept the cookie_path argument. Specifically, we added the following to the Chatbot class's __init__ method:

def __init__(
    self,
    proxy: str | None = None,
    cookies: list[dict] | None = None,
    cookie_path: str | None = None
) -> None:

This allows the Chatbot class to accept a cookie_path argument when it's instantiated.

Also, we adjusted the rest of the class to handle the new cookie_path argument appropriately. In this case, we didn't actually use cookie_path within the class, but in a real-world application, you would want to ensure that any new arguments are used as intended within the class.

So, in summary, the error was caused by trying to pass an argument that wasn't accepted by the class constructor, and the solution was to modify the class constructor to accept and handle this argument.

Missing Requirements EdgeGPT

Hi,

It seems that the point of installing all requirements for the plugin is missing. I had to install EdgeGPT by adding it to the requirements.txt and build the docker again. I added the line for requirements.

Bing AI Plugin

The Bing AI Plugin enables Auto-GPT to use Bing AI to research information, ask questions, get advice, and more.

Screenshot 2023-05-01 at 7 49 55 AM

Key Features:

  • Bing AI already implemented researching information, so implementing this plugin will almost entirely negate the need to browse websites and the current implementation of researching information.
  • Allows Auto-GPT to consult Bing AI.
  • Allows Auto-GPT to be able to use GPT-4 as Bing AI is based on GPT-4.
  • Brings GPT-4 functionality to those without GPT-4 API access.

Getting Authentication (Required):

  • Install the cookie editor extension for Chrome or Firefox
  • Go to bing.com
  • Open the extension
  • You must be logged in to an account with Bing AI access.
  • Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)
  • Paste your cookies into a file cookies.json
  • IMPORTANT: Move the cookies.json file into the Auto-GPT folder.

Installation

Follow these steps to configure the AutoGPT Bing AI Plugin:

1. Install requirements

Add EdgeGPT to the requirements.txt file inside the AutoGPT folder. If you use docker you have to build it again.

2. Clone this Repository

cd into a folder that you can find easily. For example: cd desktop.
Then, paste this command: git clone https://github.com/gravelBridge/AutoGPTBingAI.git

3. Navigate to the folder

Navigate to the folder where you ran the cd command

4. Zip the BingAI folder

On MacOS, right click the BingAI folder and press Compress. On windows, right click the folder, and press Send to > Compressed (zipped).

5. Move the zip file

Move the new BingAI.zip file to the AutoGPT plugins directory, there should already be a file there titled __PUT_PLUGIN_ZIPS_HERE__.

6. Add BingAI configuration settings

Append the following configuration settings to the end of the .env file:

################################################################################
### BINGAI
################################################################################

BINGAI_COOKIES_PATH=./cookies.json
BINGAI_MODE=<your chosen mode>

For the BINGAI_MODE, use either precise, balanced, or creative.

AutoGPT Configuration

Set ALLOWLISTED_PLUGINS=BingAI,example-plugin1,example-plugin2,etc in your AutoGPT .env file.

7. Edit goals

When using Auto-GPT please set one of the goals to "Use ask_bing_genius whenever possible".

KeyError: 'conversationSignature'

Hi

Im using Autogpt .4.7, I had uissues but got it working using:

"python -m pip install EdgeGPT==0.4.1".

Now im receiving the next error:

File "C:\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "X:\AutoGPT-0.4.7\autogpt_main
.py", line 5, in
autogpt.app.cli.main()
File "C:\Python\Python310\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "C:\Python\Python310\lib\site-packages\click\core.py", line 1666, in invoke
rv = super().invoke(ctx)
File "C:\Python\Python310\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Python\Python310\lib\site-packages\click\core.py", line 783, in invoke
return _callback(*args, **kwargs)
File "C:\Python\Python310\lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "X:\AutoGPT-0.4.7\autogpt\app\cli.py", line 121, in main
run_auto_gpt(
File "X:\AutoGPT-0.4.7\autogpt\app\main.py", line 166, in run_auto_gpt
agent = Agent(
File "X:\AutoGPT-0.4.7\autogpt\agents\agent.py", line 43, in init
super().init(
File "X:\AutoGPT-0.4.7\autogpt\agents\base.py", line 73, in init
self.system_prompt = ai_config.construct_full_prompt(config)
File "X:\AutoGPT-0.4.7\autogpt\config\ai_config.py", line 130, in construct_full_prompt
prompt_generator = plugin.post_prompt(prompt_generator)
File "X:\AutoGPT-0.4.7\plugins\BingAI_init
.py", line 58, in post_prompt
from .bing_ai import(
File "X:\AutoGPT-0.4.7\plugins\BingAI\bing_ai.py", line 34, in
bot = Chatbot(cookie_path=cookie_path)
File "C:\Python\Python310\lib\site-packages\EdgeGPT.py", line 608, in init
self.chat_hub: _ChatHub = _ChatHub(
File "C:\Python\Python310\lib\site-packages\EdgeGPT.py", line 416, in init
conversation_signature=conversation.struct["conversationSignature"],
KeyError: 'conversationSignature'

Possibility of using ChatGPT access token instead of OpenAI API key?

Hello, great project!

I'm sorry if this isn't considered an issue, but I don't see a Discussions section, so I thought I'd just post this here.
Unfortunately, I am not able to pay for API usage, so I was wondering if we could add this plugin to something like this project:
https://github.com/IntelligenzaArtificiale/Free-AUTO-GPT-with-NO-API ?

I wonder if it'd be possible to fully replace GPT with Bing instead of using Bing as a "helper", although I've heard Bing is much less willing to think with the user than GPT-3/4.

In Auto_gpt 0.4.0,the plugin dose not work.

In Auto_GPT 0.4.0

I have install edgegpt == 0.3.8

but SYSTEM return :
SYSTEM: Command ask_genius_bing returned: Error: 'Agent' object has no attribute 'prompt'

if I pip install EdgeGPT --upgrade. The programe will raise other error.

Exception has occurred: ImportError
cannot import name 'Chatbot' from 'EdgeGPT' (c:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\venv\lib\site-packages\EdgeGPT\__init__.py)
  File "C:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\autogpt\config\ai_config.py", line 149, in construct_full_prompt
    prompt_generator = plugin.post_prompt(prompt_generator)
  File "C:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\autogpt\main.py", line 183, in run_auto_gpt
    system_prompt = ai_config.construct_full_prompt()
  File "C:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\autogpt\cli.py", line 96, in main
    run_auto_gpt(
  File "C:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\autogpt\__main__.py", line 5, in <module>
    autogpt.cli.main()
ImportError: cannot import name 'Chatbot' from 'EdgeGPT' (c:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\venv\lib\site-packages\EdgeGPT\__init__.py)

But in AUTO_GPT 0.3.1
I use pip install EdgeGPT --upgrade. It also throw
cannot import name 'Chatbot' from 'EdgeGPT' (c:\Users\xiahan\Documents\BaiduSyncdisk\code\Auto-GPT\venv\lib\site-packages\EdgeGPT\__init__.py)

When I use edgegpt==0.3.8 ,it works

Configuring where the cookie.json file is stored

It would be helpful to leave the Auto-GPT folder clean of unversionned artifacts.

Currently, I have to use a script to move cookie.json out of my Auto-GPT folder so that I can pull and rebase.

event loop alread running error

keep getting hung up with event loop error

NEXT ACTION:  COMMAND = ask_genius_bing ARGUMENTS = {'question': 'What is the current state of the market in the USA?'}
AUTHORISED COMMANDS LEFT: 3
SYSTEM:  Command ask_genius_bing returned: Error: This event loop is already running

Can't get past the Double Check configuration for paid OpenAI API prompt.

First of all thank you, for your work.

I pulled all the files and placed them in the right paths in my environment. Even installed EdgeGPT.
But when i run AutoGPT, after setting the goal including
"Use ask_bing_genius whenever possible"
i get this error: DOUBLE CHECK CONFIGURATION Please double check that you have setup a PAID OpenAI API Account. You can read more here: https://docs.agpt.co/setup/#getting-an-api-key
Is it not possible to test auto gpt without a paid API?
Thanks and cheers!

search engine needs to be defined somewhere?

Warning: Bing-Search-Plugin is not fully functional. Please set the SEARCH_ENGINE and BING_API_KEY environment variables.

Any ideas where to look now?

I have the bing cookies json in autogpt root and plugin directory - not sure where to put it.
I have the .env edited with correct info - I thought.... I have the api key defined.

################################################################################
### BINGAI
################################################################################

BINGAI_COOKIES_PATH=./cookies.json
BINGAI_MODE=precise

Bing Search Plugin returns "adaptiveCard"

I believe the BingGPT plugin is returning adaptiveCards to some search results, which this plugin cannot read. I don't know if it's possible for it to read them, but I think this is a change in what Bing is returning to some search results.

Continuing to get TypeError: Chatbot.init() got an unexpected keyword argument 'cookie_path'

Using memory of type: LocalCache
Using Browser: chrome
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\SportsFan82\Desktop\AutoGPT Related\Auto-GPT-0.3.1\Auto-GPT-0.3.1\autogpt_main
.py", line 5, in
autogpt.cli.main()
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1635, in invoke
rv = super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760, in invoke
return _callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\Desktop\AutoGPT Related\Auto-GPT-0.3.1\Auto-GPT-0.3.1\autogpt\cli.py", line 90, in main
run_auto_gpt(
File "C:\Users\SportsFan82\Desktop\AutoGPT Related\Auto-GPT-0.3.1\Auto-GPT-0.3.1\autogpt\main.py", line 171, in run_auto_gpt
system_prompt = ai_config.construct_full_prompt()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SportsFan82\Desktop\AutoGPT Related\Auto-GPT-0.3.1\Auto-GPT-0.3.1\autogpt\config\ai_config.py", line 147, in construct_full_prompt
prompt_generator = plugin.post_prompt(prompt_generator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "plugins\AutoGPTBingAI.zip\AutoGPTBingAI\BingAI_init
.py", line 58, in post_prompt
File "plugins\AutoGPTBingAI.zip\AutoGPTBingAI\BingAI\bing_ai.py", line 34, in
TypeError: Chatbot.init() got an unexpected keyword argument 'cookie_path'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.