Code Monkey home page Code Monkey logo

babyagichatgpt's Introduction

BabyAGI ChatGPT Plugin (plus search)

This is a ChatGPT plugin based on the BabyAGI project by [@yoheinakajima]. This plugin adapts the original BabyAGI code to work as a plugin using Quart, an asynchronous web framework. I also added search via Google API.

Installation

To install the BabyAGI ChatGPT plugin on Replit:

  1. Make sure the following dependencies are added to the .replit file:
pip install openai quart quart-cors pinecone-client
  1. Replace the OPENAI_API_KEY and PINECONE_API_KEY and the rest of the variables.
OPENAI_API_KEY = "your_openai_api_key_here"
PINECONE_API_KEY = "your_pinecone_api_key_here"
pinecone_environment="YOUR ENV",
table_name="YOUR TABLE NAME",
GOOGLE_API_KEY = ""
CUSTOM_SEARCH_ENGINE_ID = ""
  1. Upldate your localhost link

  2. Save and run the Repl.

Usage

The plugin provides several API endpoints to interact with BabyAGI:

  • /set_objective: Set the main objective for BabyAGI.
  • /add_task: Add a task to the task list.
  • /get_task_list: Retrieve the current task list.
  • /execute_next_task: Execute the next task in the task list and create new tasks based on the result.

Example

Here's an example of setting the objective, adding a task, and executing the next task using the BabyAGI ChatGPT plugin:

import requests

base_url = "http://localhost:5001"  # Replace with the Repl URL if running on Replit

# Set the objective
objective = "Solve world hunger."
response = requests.post(f"{base_url}/set_objective", json={"objective": objective})
print(response.json())

# Add a task
task_name = "Develop a task list."
response = requests.post(f"{base_url}/add_task", json={"task_name": task_name})
print(response.json())

# Execute the next task
response = requests.post(f"{base_url}/execute_next_task")
print(response.json())

Make sure to replace localhost:5001 with your Replit app URL when running on Replit.

License

This plugin is based on the BabyAGI project by @yoheinakajima (https://github.com/yoheinakajima). Please refer to their repository for licensing information.

Acknowledgments

This plugin is based on the BabyAGI project by @yoheinakajima A big thank you to the author for their original work.

babyagichatgpt's People

Contributors

doriandarko 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.