Code Monkey home page Code Monkey logo

natbot's Introduction

๐Ÿ‘‹

natbot's People

Contributors

danielgross avatar jessfraz avatar nat avatar quantum9innovation 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  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

natbot's Issues

On Windows device_pixel_ration is wrong

Seems like Playwright lies about devicePixelRatio on Windows the same way it does on Darwin. It makes alll browsing incorrect.

I think the only way to solve it is to manually specify devicePixelRatio for your device.

Getting the following API issues

Welcome to natbot! What is your objective?
bloom
Parsing time: 0.10 seconds
Traceback (most recent call last):
File "/home/ubuntu/natbot/natbot.py", line 602, in
gpt_cmd = get_gpt_command(objective, _crawler.page.url, prev_cmd, browser_content)
File "/home/ubuntu/natbot/natbot.py", line 561, in get_gpt_command
response = openai.Completion.create(model="text-davinci-003", prompt=prompt, temperature=0.5, best_of=10, n=3, max_tokens=50)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 149, in create
) = cls.__prepare_create_request(
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 106, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 138, in init
self.api_key = key or util.default_api_key()
File "/usr/local/lib/python3.10/dist-packages/openai/util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.

I checked API issues using:
curl -X GET https://api.openai.com/v1/models -H "Authorization: Bearer sk-kufw3eq_MY_API_KEY_asdqe23adg"

No actions are taken in the browser

Hi Nat,

Super interesting work! I was trying it out and although GPT-3 generates a valid response, no actions are taken in the browser. I.e. it gets stuck in google.com and GPT-3 generates same response over and over again. Not sure if it's just me.

Doesn't work in the EU

Natbot opens the browser, navigates to google and then does nothing. I suspect it's tripped up by the cookie settings screen that Google has to display due to the EU legislation

Getting started + Requirements.txt

On first run:

Traceback (most recent call last):
  File "/home/sam/git/natbot/natbot.py", line 8, in <module>
    from playwright.sync_api import sync_playwright
ModuleNotFoundError: No module named 'playwright'

So, so far I know I need playwright, OpenAI

Traceback (most recent call last):
  File "/home/sam/git/natbot/natbot.py", line 11, in <module>
    import openai
ModuleNotFoundError: No module named 'openai'

Then I need to run this to prepare

playwright._impl._api_types.Error: Executable doesn't exist at /home/sam/.cache/ms-playwright/chromium-1024/chrome-linux/chrome
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ Looks like Playwright was just installed or updated.       โ•‘
โ•‘ Please run the following command to download new browsers: โ•‘
โ•‘                                                            โ•‘
โ•‘     playwright install                                     โ•‘
โ•‘                                                            โ•‘
โ•‘ <3 Playwright Team                                         โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

and I also need an API key

openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>', or you can set the environment variable OPENAI_API_KEY=<API-KEY>). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = <PATH>'. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.

Adding Entities recognition using haptik (preprocess suggestion)

Hello, Im amazed at this implementation of GPT-3.
I would love to add an extra later to theprompt by preprocessing the text and adding entities with metalabel while passing prompt to GPT-3

An example would be:
Buy [Brand] Adidas shoes from Amazon [company] India [location] under $200 [numeric]

We could achieve this using the hello haptik repository (link: https://github.com/hellohaptik/chatbot_ner)

Im not completely sure if this will help the output. What do you think?

Kudos!

Quick review on DOM parsing

Hi Nat,

While looking at the DOM parsing bit, I noticed a few potential bugs:

  • ancestor_node is not used anywhere?
  • There's a check converted_node_name != "textarea", should this be converted_node_name != "text"?
  • There's a loop over child_nodes, however this is always empty (never populated)?

Let me know what you think, thanks!

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.