Giter Site home page Giter Site logo

xlisp / gpt_react_repl_w_method_search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peterroelants/gpt_react_repl_w_method_search

0.0 0.0 0.0 107 KB

ReAct agent with access to Python REPL to execute simple workflows. Uses OpenAI GPT-family as language model.

License: Apache License 2.0

Shell 1.11% Python 76.02% Jupyter Notebook 18.08% Jinja 4.79%

gpt_react_repl_w_method_search's Introduction

ReAct REPL Agent

  • Xonshrc Dev
$ cd /Users/emacspy/AIMutilAgentPro/gpt_react_repl_w_method_search/src
$ source react_repl_agent/methods.py
  • can no fix erro
@ ./tools/run_all.sh
.......................................................

Run ruff code formatting
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'extend-select' -> 'lint.extend-select'
  - 'ignore' -> 'lint.ignore'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

Run Black code formatting
All done! ✨ 🍰 ✨
25 files left unchanged.

Run ruff code formatting checks
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'extend-select' -> 'lint.extend-select'
  - 'ignore' -> 'lint.ignore'
  - 'per-file-ignores' -> 'lint.per-file-ignores'
src/react_repl_agent/llm_api.py:17:1: E402 Module level import not at top of file
src/react_repl_agent/llm_api.py:18:1: E402 Module level import not at top of file
Found 2 errors.

Large-language model based "agent" that can can execute small tasks by using a Python REPL and pre-implemented methods. The "agent loop" is based on ReAct.

The agent can look up methods using a method_search() method that uses semantic search on the indexed Python methods. Methods are indexed using OpenAI embedding of their signatures and descriptions.

More details in the blogpost at https://peterroelants.github.io/posts/react-repl-agent/

Run yourself

There are 2 notebooks to run the agent:

Environment

A conda/mamba environment is provided at env/.

Certain libraries (such as the openai library) need a secret key to use them. These should be added to the secrets/ directory.

Contribute

If you want to contribute, please do so via pull requests.

Tools

To run all code formatting and linters before pushing a commit run:

./tools/run_all.sh

gpt_react_repl_w_method_search's People

Contributors

peterroelants avatar xlisp avatar

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.