You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose an implementation for the gpt4free API in the Agent-Zero framework. This integration would allow users to access free GPT-like functionality.
'''
import os
import g4f
import asyncio
from g4f.client import Client
from python.helpers.dotenv import load_dotenv
from langchain_core.runnables import Runnable
from g4f.Provider import RetryProvider, Phind, FreeChatgpt, Liaobots
load_dotenv()
DEFAULT_TEMPERATURE = 0.0
class ChatG4F(Runnable):
def init(self, model="", temperature=0.0, base_url="http://localhost:1337/v1"):
self.model = model
self.temperature = temperature
self.base_url = base_url
self.client = Client(provider=RetryProvider([Phind, FreeChatgpt, Liaobots], shuffle=False))
I would like to propose an implementation for the gpt4free API in the Agent-Zero framework. This integration would allow users to access free GPT-like functionality.
'''
import os
import g4f
import asyncio
from g4f.client import Client
from python.helpers.dotenv import load_dotenv
from langchain_core.runnables import Runnable
from g4f.Provider import RetryProvider, Phind, FreeChatgpt, Liaobots
load_dotenv()
DEFAULT_TEMPERATURE = 0.0
class ChatG4F(Runnable):
def init(self, model="", temperature=0.0, base_url="http://localhost:1337/v1"):
self.model = model
self.temperature = temperature
self.base_url = base_url
self.client = Client(provider=RetryProvider([Phind, FreeChatgpt, Liaobots], shuffle=False))
def get_G4F_chat(model_name: str, temperature=DEFAULT_TEMPERATURE, base_url=os.getenv("G4F_BASE_URL") or "http://localhost:1337/v1"):
return ChatG4F(model=model_name, temperature=temperature, base_url=base_url)
'''
The text was updated successfully, but these errors were encountered: