GithubHelp home page GithubHelp logo

aledipa / free-gpt4-web-api Goto Github PK

View Code? Open in Web Editor NEW
372.0 5.0 78.0 1.84 MB

FreeGPT4-WEB-API is a python server that allows you to have a self-hosted GPT-4 Unlimited and Free WEB API, via the latest Bing's AI (and much more).

Home Page: https://api.freegpt4.ddns.net/?text=Your Request Here

License: GNU General Public License v3.0

Python 46.63% Dockerfile 1.20% CSS 2.93% JavaScript 3.87% HTML 45.37%
artificial-intelligence bing-api chatgpt gpt-4 gpt-alternative sirigpt free-gpt gpt-4-api api api-server

free-gpt4-web-api's Introduction

Formation, Transformation, Eternal minds in eternal recreation. - J. W. Goethe

About me

I'm always trying to learn and create something new, check where I have got to so far in my

Static Badge

Get in touch

   

Some numbers

Alessandro Di Pasquale's github stats

free-gpt4-web-api's People

Contributors

aledipa avatar dependabot[bot] avatar git-malik 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

free-gpt4-web-api's Issues

Demo API is not working.

Always respond

Internal Server Error
The server encountered an internal error and was unable to complete your request. 
Either the server is overloaded or there is an error in the application.

Using bing as provider not giving any output

  • Serving Flask app 'FreeGPT4_Server'
  • Debug mode: off
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:3000
  • Running on http://192.168.0.14:3000
    Press CTRL+C to quit
    Initializing...
    start
    get
    ici

Input: 你看得见我吗?
g4f.provider.Bing supports: (model: str, messages: list[dict[str, str]], stream: bool)
Result Str:

127.0.0.1 - - [06/Oct/2023 22:52:15] "GET /?text=你看得见我吗? HTTP/1.1" 200 -

There is no results from Bing gpt4.

Does this still need cookies.json ?

Hello there

Given bing is now open to public, without any login needs, can this be used without cookies.json now ?
I am using the docker compose version.

Cheers

Blank response

So, if you ask a medium-long question, it just responds blank—nothing. Is it because of the tokens or the length of the message? (I'm not using any cookies, btw) or sum else? I really need an answer, please.

get_parameters() missing 1 required positional argument: 'cls'

Getting the following error after sending request with default settings on bing:
[2024-03-24 22:16:54,169] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.10/dist-packages/asgiref/sync.py", line 254, in call
return call_result.result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/local/lib/python3.10/dist-packages/asgiref/sync.py", line 331, in main_wrap
result = await self.awaitable(*args, **kwargs)
File "/Free-GPT4-WEB-API-main/src/FreeGPT4_Server.py", line 146, in index
print(PROVIDERS[args.provider].params) # supported args
File "/usr/local/lib/python3.10/dist-packages/g4f/providers/base_provider.py", line 98, in params
for name, param in cls.get_parameters().items():
TypeError: AbstractProvider.get_parameters() missing 1 required positional argument: 'cls'

error

Hello,

I can log to the page setting but i can't actually use the chat, i have an error when putting the url http://127.0.0.1:5005/?text=your%20query
I've tried to use my own bing cookie file aswell but still have an error.

error

Free hosting

How do i host this for free? Can i host in github?

unavailable

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
image
image

Duplicate responses.

Most answers when using a language other than English, double answers appear.

>Hola.
Hola, este es Bing. ¿Qué quieres saber hoy? 😊 Hello, this is Bing. What do you want to know today? 😊
>Hola buenos días.
Hola, este es Bing. ¿En qué puedo ayudarte? 😊 Hello, this is Bing. How can I help you? 😊

[BUG discussion] escape sequence in string

# Cleans the response from the resources links
    # INFO: Unsupported escape sequence in string literal
    if (args.remove_sources):
        if re.search("\[\^[0-9]+\^\]\[[0-9]+\]", resp_str):
            resp_str = resp_str.split("\n\n")
            if len(resp_str) > 1:
                resp_str.pop(0)
            resp_str = re.sub("\[\^[0-9]+\^\]\[[0-9]+\]", "", str(resp_str[0]))

Because of that bug, on average 40% of the request response is useless, due to Bing mostly answering in this manner :

🤖 Hello, I'm Bing ! Here is your reply : 

- ....

internal error

image
getting this error.

running the server on http://localhost:8081/ and i can see the ''Please enter a question'' msg.

How do you send a request and receive responses?

TypeError when running FreeGPT4_Server.py

While attempting to use FreeGPT4_Server.py, I encountered a TypeError. The error occurs when the server attempts to process a GET request.

The error message indicates that an issue arises in the create_message function of the Bing.py file, specifically when trying to use the "|" operator with two dictionaries. Here's the traceback for the error:

Traceback (most recent call last):
  File "/home/chris/.local/lib/python3.8/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/chris/.local/lib/python3.8/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/chris/.local/lib/python3.8/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/chris/.local/lib/python3.8/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/chris/.local/lib/python3.8/site-packages/asgiref/sync.py", line 277, in __call__
    return call_result.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/chris/.local/lib/python3.8/site-packages/asgiref/sync.py", line 353, in main_wrap
    result = await self.awaitable(*args, **kwargs)
  File "FreeGPT4_Server.py", line 133, in index
    await PROVIDERS[args.provider].create_async(
  File "/home/chris/.local/lib/python3.8/site-packages/g4f/Provider/base_provider.py", line 122, in create_async
    return "".join([
  File "/home/chris/.local/lib/python3.8/site-packages/g4f/Provider/base_provider.py", line 122, in <listcomp>
    return "".join([
  File "/home/chris/.local/lib/python3.8/site-packages/g4f/Provider/Bing.py", line 447, in stream_generate
    await wss.send_str(create_message(conversation, prompt, tone, context))
  File "/home/chris/.local/lib/python3.8/site-packages/g4f/Provider/Bing.py", line 392, in create_message
    'message': Defaults.location | {
TypeError: unsupported operand type(s) for |: 'dict' and 'dict'

This error prevents the server from functioning as expected. Could you please provide guidance on how to resolve this issue?

instructions to enable webgui in docker

It seems difficult to enable webgui in docker container. please update the instructions. I tired following

  1. mapped /app/src/data to one of my host folders which has settings.json and a password set
  2. changed docker compose to have
    command: 
      - "--remove-sources"
      - "--enable-gui"

I can get the docker server started. However, when I go to host:port/settings, it shows a login page, but entering the password just refreshed the login page. it doesn't take to settings page.

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.