A browser AI agent, using GPT-4

Overview

A browser AI agent, using GPT-4

This project provides a bridge between GPT-4 and a headless Chromium browser, allowing you to automate actions simply by describing them to the program. It takes the form of a Rust CLI, but also exports most of the internals as a library for others to use.

Installation

browser-agent is built using Rust, so you'll need to install the Rust toolchain. You can do this by following the instructions at rustup.rs.

Once you have Rust installed, you can install browser-agent by running:

cargo install browser-agent

You should also place your OpenAI API key in the OPENAI_API_KEY environment variable. This key should have access to the gpt-4 model.

You can copy the contents of the example.env file to a .env file in the root of the project, and fill in the OPENAI_API_KEY variable. The .env file is ignored by git, so you don't have to worry about accidentally committing your API key. Note though, .env.example is not ignored, so you should not change that file.

Usage

Usage: browser-agent [OPTIONS] <GOAL>

Arguments:
  <GOAL>  The goal for the agent to achieve

Options:
      --visual                Whether to show the browser window. Warning: this makes the agent more unreliable
  -v...                       Set the verbosity level, can be used multiple times
      --include-page-content  Whether to include text from the page in the prompt
  -h, --help                  Print help
  -V, --version               Print version

Aknowledgements

This project was inspired and builds on top of Nat Friedman's natbot experiment.

License

This project is licensed under the MIT license. See LICENSE for more details.

Comments
  • "Download of browser failed"

    % browser-agent "what day is it" Error: Download of browser failed

    Caused by: 0: Failed to create archive file 1: No such file or directory (os error 2) %

    opened by Marviel 8
  • fixed folder issue and added gitignore

    fixed folder issue and added gitignore

    1. changed the gitignore to allow browser and user_data to be added, and to not include the contents of the folder
    2. added the browser and user_data folders

    this fixes the "Error: Download of browser failed"

    opened by zouvier 1
  • Ignore links that containing headings

    Ignore links that containing headings

    Ignore links containing headings, otherwise the agent tries to click on it and you get an error. Even if it didn't error out it would rarely accomplish anything, usually those links are just section anchors so people can link directly to a section on a page. For example https://platform.openai.com/docs/guides/speech-to-text/quickstart.

    Tested on prompt how to transcribe audio using OPENAI whisper API in linux with a temperature of 0.2.

    opened by zacharyfmarion 0
  • Add prompt to make sure the agent continues to communicate in the cor…

    Add prompt to make sure the agent continues to communicate in the cor…

    Once the user prompt gets long enough GPT-4 starts to put less importance on the system message which makes it forget to use the correct format when displaying the result for longer searches. I have found that re-iterating the format in the user message helps with this significantly.

    opened by zacharyfmarion 0
  • Browser failed to install

    Browser failed to install

    I get the following error after installing using cargo (latest rust + cargo installed):

    $ browser-agent "what is the capital of hawaii" --include-page-content
    Error: Download of browser failed
    
    Caused by:
        0: Failed to create archive file
        1: No such file or directory (os error 2)
    

    This is on cargo 1.68.2 (6feb7c9cf 2023-03-26)

    opened by zacharyfmarion 1
  • API Key Error.

    API Key Error.

    I provided the api key in the .env file but the following error is thrown.

    Error: invalid_request_error: You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.

    opened by george4n 4
  • Respect `robots.txt`

    Respect `robots.txt`

    ML-based bots need to respect the norms as all the other bots on the web. That means providing an identifiable user agent, loading robots.txt, and avoiding requests to places that robots.txt bans it from.

    enhancement help wanted good first issue 
    opened by jimrandomh 1
Owner
Miguel Piedrafita
21-year-old maker
Miguel Piedrafita
OpenAI GPT-3 API Client in Rust

fieri Note: fieri's master branch might contain breaking changes. For the most recently released code, look to the latest tag. Overview Unofficial Rus

lachezar kolev 23 Dec 30, 2022
Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
A real-time implementation of "Ray Tracing in One Weekend" using nannou and rust-gpu.

Real-time Ray Tracing with nannou & rust-gpu An attempt at a real-time implementation of "Ray Tracing in One Weekend" by Peter Shirley. This was a per

null 89 Dec 23, 2022
HNSW ANN from the paper "Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs"

hnsw Hierarchical Navigable Small World Graph for fast ANN search Enable the serde feature to serialize and deserialize HNSW. Tips A good default for

Rust Computer Vision 93 Dec 30, 2022
An example of using TensorFlow rust bindings to serve trained machine learning models via Actix Web

Serving TensorFlow with Actix-Web This repository gives an example of training a machine learning model using TensorFlow2.0 Keras in python, exporting

Kyle Kosic 39 Dec 12, 2022
SelfOrgMap 5 Nov 4, 2020
This repository features a simple Kalman filter and RTS smoother (KFS) implementation in Rust by using the ndarray library.

Kalman filter and RTS smoother in Rust (ndarray) This repository features a simple Kalman filter and RTS smoother (KFS) implementation in Rust by usin

SPDEs 3 Dec 1, 2022
Toy library for neural networks in Rust using Vulkan compute shaders

descent Toy library for neural networks in Rust using Vulkan compute shaders. Features Multi-dimensional arrays backed by Vulkan device memory Use Rus

Simon Brown 71 Dec 16, 2022
A neural network model that can approximate any non-linear function by using the random search algorithm for the optimization of the loss function.

random_search A neural network model that can approximate any non-linear function by using the random search algorithm for the optimization of the los

ph04 2 Apr 1, 2022
Statically sized matrix using a definition with const generics

Statically sized matrix using a definition with const generics

DenTaku 3 Aug 2, 2022
Using OpenAI Codex's "davinci-edit" Model for Gradual Type Inference

OpenTau: Using OpenAI Codex for Gradual Type Inference Current implementation is focused on TypeScript Python implementation comes next Requirements r

Gamma Tau 11 Dec 18, 2022
Find faces in photo using Rustface.

facegrep I want to learn Rust and found about Rustface (which is a port of C++ SeetaFace Engine). It detects faces in a picture. What interesting is i

Wildan Zulfikar 17 Dec 2, 2022
Simulation of sand falling down in a cave built using nannou (Rust)

nannou-sand-simulation Learning nannou, an open-source creative-coding toolkit for Rust, by implementing a visualization for a simulation of sand fall

Luciano Mammino 3 Dec 20, 2022
A repo for learning how to parallelize computations in the GPU using Apple's Metal, in Rust.

Metal playground in rust Made for learning how to parallelize computations in the GPU using Apple's Metal, in Rust, via the metal crate. Overview The

Lambdaclass 5 Feb 20, 2023
Sample Python extension using Rust/PyO3/tch to interact with PyTorch

Python extensions using tch to interact with PyTorch This sample crate shows how to use tch to write a Python extension that manipulates PyTorch tenso

Laurent Mazare 5 Jun 10, 2023
A Voice Activity Detector rust library using the Silero VAD model.

Voice Activity Detector Provides a model and extensions for detecting speech in audio. Standalone Voice Activity Detector This crate provides a standa

Nick Keenan 3 Apr 3, 2024
Using ChatGPT/GPT-3.5/GPT-4 in the terminal.

AIChat Using ChatGPT/GPT-3.5/GPT-4 in the terminal. AIChat in chat mode: AIChat in command mode: Install With cargo cargo install --force aichat Bina

null 1.1k Apr 17, 2023
TAT agent is an agent written in Rust, which run in CVM or Lighthouse instances.

TAT agent is an agent written in Rust, which run in CVM, Lighthouse or CPM 2.0 instances. Its role is to run commands remotely without ssh login, invoked from TencentCloud Console/API. Commands include but not limited to: Shell, PowerShell, Python. TAT stands for TencentCloud Automation Tools. See more info at https://cloud.tencent.com/product/tat.

Tencent 97 Dec 21, 2022
All in One AI Chat Tool( GPT-4 / GPT-3.5 /OpenAI API/Azure OpenAI)

WeChatAI Create All in One personal AI chat assistant English | 中文介绍 This project is not for reward and profit, only used for personal Screenshot Supp

null 38 Apr 25, 2023
Meet Rustacean GPT, an experimental project transforming OpenAi's GPT into a helpful, autonomous software engineer to support senior developers and simplify coding life! 🚀🤖🧠

Rustacean GPT Welcome, fellow coding enthusiasts! ?? ?? I am excited to introduce you to Rustacean GPT, my humble yet ambitious project that aims to t

Gary McDougall 3 May 10, 2023