gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

How I can use AutoGPT/crewAI/babyagi/autogen by using gpt4free

Open opensource-elearning opened this issue 1 year ago • 7 comments
trafficstars

Is your feature request related to a problem? Please describe.

As I am a non-programmer background it is very helpful to use the AutoGPT kind of tool but it comes with openai integration and a bunch of other nonsense integration which is painful and demotivates.

if anyone has an example usage How to make use of gpt4free in AutoGPT/crewAI/babyagi or a similar tool it would be highly appreciated

also if you guys have some mechanism or a way by which I can directly get all wokring models and try and also choose another model if the 1st model is not responding?

Describe the solution you'd like

I wanted to have the AutoGPT tool installed in Windows or Linux system in which it has access to file system and it can write to files also multiple agents so that I can get most of my work done by AutoGPT

Describe alternatives you've considered As of now, I am searching for what should I use AutoGPT/babyagi/crewAI/autogen

Please provide code example or references in terms of code examples

opensource-elearning avatar Feb 07 '24 11:02 opensource-elearning

@xtekky @hlohaus @Miezhiko @nullstreak @devAdityaa

opensource-elearning avatar Feb 07 '24 11:02 opensource-elearning

AutoGPT and etc is not a good use case for gpt4free. It's comparatively slow to the openai api and doesn't support so much requests. But you can simply change the api url from openai to the from g4f. Then you can theoretical use it.

hlohaus avatar Feb 07 '24 13:02 hlohaus

Thanks @hlohaus, for your quick response.

As belong to a non-programming background can you please let me know if I need to replace

from openai import OpenAI

with

from g4f.openai import OpenAI ?

opensource-elearning avatar Feb 07 '24 13:02 opensource-elearning

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:1337/v1" # add this line
)

and start the server:

python -m g4f.api.run
``

hlohaus avatar Feb 07 '24 14:02 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Feb 15 '24 00:02 github-actions[bot]

actually just tested with crewai using 'gpt-4-turbo (OpenAI ) and worked ok just a little slow but ok use the max_iter=4, max_rpm=5 (max api calls per min)

quantumalchemy avatar Feb 19 '24 15:02 quantumalchemy

@quantumalchemy, that's great, can you please help to provide the changes you did or the repository/fork/diff though which I can access the changes?

opensource-elearning avatar Feb 19 '24 16:02 opensource-elearning

@quantumalchemy how did you test it? Doesn’t CrewAI rely on langchain - needs some OPENAI_API_KEY? Could you help?

pratham-darooka avatar Apr 25 '24 05:04 pratham-darooka

for autoGPT, you should modify the api_manager.py file to resort the Models which is defined by OpenAI package. I tried this, but it works slowly

jackiezhangcn avatar Apr 29 '24 02:04 jackiezhangcn