gpt4free
gpt4free copied to clipboard
I get to step 6 then I am lost...
I import g4f, but after that I do not understand how to continue and complete setting up gpt4free. Is there anyone out there who can enlighten me on how to complete and use gpt4free? -Thanks
There's an example in the readme file:
import g4f
print(g4f.Provider.Ails.params) # supported args
# Automatic selection of provider
# streamed completion
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', messages=[
{"role": "user", "content": "Hello world"}], stream=True)
for message in response:
print(message)
# normal response
response = g4f.ChatCompletion.create(model=g4f.Model.gpt_4, messages=[
{"role": "user", "content": "hi"}]) # alterative model setting
print(response)
# Set with provider
response = g4f.ChatCompletion.create(model='gpt-3.5-turbo', provider=g4f.Provider.Forefront, messages=[
{"role": "user", "content": "Hello world"}], stream=True)
for message in response:
print(message)
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.