gpt4free-original/gpt4free
xtekky 9430f20fcf
Merge pull request #638 from noes14155/patch-1
Update __init__.py
2023-06-04 00:28:50 +02:00
..
aiassist Update __init__.py 2023-06-03 04:50:35 +04:00
aicolors Update __init__.py (refactored import) 2023-05-28 14:20:29 +05:00
deepai add deepai wrapper 2023-05-18 00:07:29 -07:00
forefront fix forefront sample 2023-05-08 01:31:14 +09:00
gptworldAi Parameter addition uuid 2023-05-30 08:33:44 +08:00
hpgptai Automatically obtain restNonce 2023-05-25 10:41:45 +08:00
italygpt2 upload italtgpt2 2023-05-19 23:01:57 +08:00
quora Fix: Exception in thread & KeyError: 'displayName' 2023-06-01 16:15:32 -03:00
theb Merge branch 'main' into main 2023-05-04 19:13:58 +01:00
usesless Fixed `from utils import create_email, check_email` in `gpt4free/usesless/__init__.py` 2023-05-27 18:42:23 +05:00
you added retry for you 2023-05-06 00:02:29 +05:30
README.md remove cocalc; all non-authenticated access has been disabled 2023-05-05 05:07:28 +00:00
__init__.py Added testing file and init in gpt4free 2023-05-26 21:57:22 +03:00
test.py Fixed imports 2023-05-04 16:30:34 +01:00

README.md

gpt4free package

What is it?

gpt4free is a python package that provides some language model api's

Main Features

  • It's free to use
  • Easy access

Installation:

pip install gpt4free

Usage:

import gpt4free
from gpt4free import Provider, quora, forefront

# usage You
response = gpt4free.Completion.create(Provider.You, prompt='Write a poem on Lionel Messi')
print(response)

# usage Poe
token = quora.Account.create(logging=False)
response = gpt4free.Completion.create(Provider.Poe, prompt='Write a poem on Lionel Messi', token=token, model='ChatGPT')
print(response)

# usage forefront
token = forefront.Account.create(logging=False)
response = gpt4free.Completion.create(
    Provider.ForeFront, prompt='Write a poem on Lionel Messi', model='gpt-4', token=token
)
print(response)
print(f'END')

# usage theb
response = gpt4free.Completion.create(Provider.Theb, prompt='Write a poem on Lionel Messi')
print(response)


Invocation Arguments

gpt4free.Completion.create() method has two required arguments

  1. Provider: This is an enum representing different provider
  2. prompt: This is the user input

Keyword Arguments

Some of the keyword arguments are optional, while others are required.

  • You:

    • safe_search: boolean - default value is False
    • include_links: boolean - default value is False
    • detailed: boolean - default value is False
  • Quora:

    • token: str - this needs to be provided by the user
    • model: str - default value is gpt-4.

    (Available models: ['Sage', 'GPT-4', 'Claude+', 'Claude-instant', 'ChatGPT', 'Dragonfly', 'NeevaAI'])

  • ForeFront:

    • token: str - this need to be provided by the user
  • Theb: (no keyword arguments required)

Token generation of quora

from gpt4free import quora

token = quora.Account.create(logging=False)

Token generation of ForeFront

from gpt4free import forefront

token = forefront.Account.create(logging=False)

This program is licensed under the GNU GPL v3

xtekky/gpt4free: multiple reverse engineered language-model api's to decentralise the ai industry.  
Copyright (C) 2023 xtekky

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.