mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-28 21:53:11 +03:00
12 lines
329 B
Python
12 lines
329 B
Python
import g4f
|
|
|
|
# Set with provider
|
|
stream = False
|
|
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.Yqcloud, messages=[
|
|
{"role": "user", "content": "hello"}], stream=stream)
|
|
|
|
if stream:
|
|
for message in response:
|
|
print(message)
|
|
else:
|
|
print(response) |