gpt4free/testing/test.py

12 lines
329 B
Python
Raw Normal View History

2023-07-16 14:27:01 -04:00
import g4f
# Set with provider
stream = False
2023-07-16 15:31:51 -04:00
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.Yqcloud, messages=[
2023-07-16 14:27:01 -04:00
{"role": "user", "content": "hello"}], stream=stream)
if stream:
for message in response:
print(message)
else:
2023-07-16 20:17:07 -04:00
print(response)