g4f / test.py
g4f's picture
Synced repo using 'sync_with_huggingface' Github Action
c57ef37
raw
history blame contribute delete
313 Bytes
import g4f
stream = True
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.EasyChat, messages=[
{"role": "user", "content": "Hi"}], stream=stream)
if stream:
for message in response:
print(message,end="")
else:
print(response)