GithubHelp home page GithubHelp 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

(Alternatively, run this in shell)

poetry install
  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

cometbus avatar doriandarko avatar fxchen 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

babyagichatgpt's Issues

update localhost

salve, ma local host replit da inserire sarebbe il link della barra di ricerca ? o lo trovo nelle impostazioni? per quanto riguarda l'ultima parte della spiegazione riguardante il codice, dove devo usarlo questo file sul mio pc in locale ?

Why text-davinci-003?

Hi,

first, thx for sharing this neat plugin.

I noticed that the text-davinci-003 model is currently being used for the agents in this project. However, I am curious about the decision behind this choice, especially since the gpt-3.5-turbo model is more cost-effective and allows for defining the AI's role separately.

Based on your experience, is the davinci model more effective in completing tasks? I would be interested in hearing your thoughts on this topic.

Thank you,
Sebastian

Trying to run on local machine I think I have it running, but localhost:5001 not working

Hi everyone also @Doriandarko
I'm Trying to run on local machine, I think I have it running but localhost:5001 not working.
Am I missing something?
I believe this code below is meant to be in python, or do I have to save it as a python .py file... If so what do I name it?
I have tried this with python 3.10 Microsoft version and 3.11 global both within VS code

I would be grateful for any help, thanks

PS D:\BabyAGI\BabyAGIChatGPT-main plugin with search\BabyAGIChatGPT-main> h search\BabyAGIChatGPT-main'; & 'C:\Users\Darryl\AppData\Local\Microsoft\WindowsApps\python3.10.exe' 'c:\Users\Darryl.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '61609' '--' '-m' 'uvicorn' 'main:app' '--reload'

help
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())

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.