GithubHelp home page GithubHelp logo

ask-03 / reversegpt Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 44 KB

A fusion of Reverse Chain layered upon RestGPT. RestGPT systematically breaks down complex user tasks into smaller, step-by-step components. Concurrently, Reverse Chain endeavors to fulfill these smaller tasks by utilizing the provided query and extracting relevant knowledge from the documentation.

License: MIT License

Python 100.00%

reversegpt's Introduction

Synergizing Language Models and APIs

This implementation represents the solution proposed. It employs a fusion of Reverse Chain layered upon RestGPT. RestGPT systematically breaks down complex user tasks into smaller, step-by-step components. Concurrently, Reverse Chain endeavors to fulfill these smaller tasks by utilizing the provided query and extracting relevant knowledge from the documentation. The detailed architecture for this solution is outlined below.

Architecture of the proposed solution

Dependencies

  • Python3: Ensure that you have Python 3 installed on your system. You can download and install Python 3 from the official Python website: https://www.python.org.
  • pip: pip is the package installer for Python. It is usually installed by default when you install Python. However, make sure you have pip installed and it is up to date. You can check the version of pip by running the following command:
    pip --version
    

Installation

To use our model, follow the steps given below:

  • Navigate to the project directory:
  • Install the necessary Python packages by running the following command:
    pip install -r requirements.txt
    

(NOTE: It is recommended to install these requirements in a new python environment)

How to use?

Follow the steps given below:

  • Add the documentation of the APIs in the data/api_documentation folder in .txt format. The format in which the documentation is required is given in the folder.
  • Make changes in the example.config.ini file
    • Add your OpenAI Secret Key in the secret_key variable in the openai section.
    • Add your query in the query variable in the query section.
    • Other parameters can also be changed in the config file like, model, temperature, huggingface embedding model that FAISS database will use
  • Initialize the FAISS database by executing the command below:
    python3 create_vector_db.py
    
    This will create the FAISS database using the documentation added in the data/api_documentation
  • Now, the setup is complete :)
  • Run the model by executing the command below:
    python3 main.py
    

Output

The output of the run is saved in output.txt file and the logs are saved in run.log file.

reversegpt's People

Contributors

ask-03 avatar

Stargazers

SIDDHI AGARWAL avatar  avatar

Watchers

 avatar

reversegpt's Issues

Fix #1: Add successful message for unknown API call in Executor

Description

Executor.py mimics the API call using functions in server.py but it returns None when the function name is not present in the executor class.

Expected Behaviour

To mimic the API call and to check the functionality of the approach add a fake message in the executor class when the function name is not known.
The fake message should have the following json format:

{
    "status": 200
    "message": "SUCCESSFUL MESSAGE",
}

Feature #1: Add module to create LLM

Description

Currently, the modules have a code snippet that creates the connection to LLM for the module.

Expection

Create a module that is called to create LLM for the modules.

Checkpoints

  • Code works properly

Good to have feature

  • Add code to use Claude, Mistral-7B and LLAMA2, other than OpenAI LLM models.

Improvement #1: Improve the prompts in the modules

Description

The prompts in the modules ArgumentExtractor, FinalAPISelector, SubAPISelector, Planner (modules are in order of priority of need of change) are ambiguous and can be made better to optimize the output from the LLM.

Expected Behaviour

Output from LLMs is non-deterministic but can be made better using prompt engineering, provide better prompts to increase the performance of the modules.

Checkpoints:

  • Define the json object that LLM should return precisely in the prompt
  • Define all the cases mentioned in the prompt and add new cases that are necessary

Checklist

  • ArgumentExtractor
  • FinalAPISelector
  • SubAPISelector
  • Planner

Improvement #2: Make different files for different modules

Description

All the modules are present in modules.py.

Expectation

Make different files for different modules and add them under a folder named modules

Checkpoints

  • The code is working properly
  • Paths are changed everywhere as needed
  • 4 modules are present in the modules folder

Refactor #1: Refactor the code in `main.py`

Description

The code in main.py is not refactored and messy.

Expected

Refactor the code in main.py and remove any unused or redundant variables in the code.

Checkpoints

  • Refactor code
  • Remove redundant variables
  • Optimize the code
  • Make utility.py (Add functions defined in main.py to utility.py)

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.