gpt4free
gpt4free copied to clipboard
Unexpected TypeError with forefront.StreamingCompletion.create
Bug description I am currently attempting to use the gpt4free library for a Discord bot. Specifically, I am trying to use the forefront.StreamingCompletion.create method to generate responses. However, when passing an account_data argument to the method, I'm encountering an error that says this is an unexpected keyword argument.
Here's the relevant portion of my code:
account_data = forefront.Account.create(logging=False)
async def generate_response(prompt):
response_text = ''
for response in forefront.StreamingCompletion.create(
account_data=account_data,
prompt=prompt,
model='gpt-4'
):
response_text += response.choices[0].text
return response_text
The error message I receive is as follows:
TypeError: create() got an unexpected keyword argument 'account_data'
Environement
- Python version: Python 3.9.13
- Location: Indonesia
Additional context I've checked my code thoroughly and I can't find any issues with it. Based on the error message, it seems the StreamingCompletion.create method does not accept account_data as an argument, but I'm unable to find documentation or guidance that indicates what the correct arguments should be.
Replace
for response in forefront.StreamingCompletion.create(
account_data=account_data,
prompt=prompt,
model='gpt-4'
)
with
for response in forefront.StreamingCompletion.create(
token=account_data,
prompt=prompt,
model='gpt-4'
)
have diff?