gpt4free/testing/test.py

14 lines
336 B
Python
Raw Normal View History

2023-07-16 21:27:01 +03:00
import g4f
# Set with provider
stream = False
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.ChatgptLogin, messages=[
{"role": "user", "content": "hello"}], stream=stream)
if stream:
for message in response:
print(message)
else:
print(response)