summaryrefslogtreecommitdiffstats
path: root/testing/test.py
blob: 727b92ac9fca3f3385a2dc8a40b5e34efde437fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)