gpt4free-original/gpt4free/theb
Rory Durrant 82a3a03929
🔨 update(theb/__init__.py): add get_response method to Completion class
The get_response method was added to the Completion class to allow for easier retrieval of the response from the GPT-3 API. This method takes in a prompt and an optional proxy and returns the response as a string. The method uses the create method to generate a generator object and then iterates over it to append each message to a list. Finally, the list is joined into a single string and returned. This allows for non stream usage of theb.
2023-05-04 17:14:18 +01:00
..
README.md theb: multiple messages 2023-05-01 17:53:32 +05:00
__init__.py 🔨 update(theb/__init__.py): add get_response method to Completion class 2023-05-04 17:14:18 +01:00
theb_test.py refactored code 2023-04-29 15:50:18 +05:30

README.md

Example: theb (use like openai pypi package)

# import library
from gpt4free import theb

# simple streaming completion

while True:
	x = input()
	for token in theb.Completion.create(x):
		print(token, end='', flush=True)
	print("")