flask / app.py
Dooratre's picture
Update app.py
fa21e2d verified
raw
history blame
227 Bytes
import g4f
prompt = 'hello sir'
response = g4f.ChatCompletion.create(
model="gpt-4",
messages=[{"role": "user", "content": prompt}],
stream=True,
)
for message in response:
print(message, flush=True, end='')