gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

No output when using forefront.

Open MandarinAxle opened this issue 1 year ago • 6 comments

I used this code from the example:

from gpt4free import forefront

# create an account
account_data = forefront.Account.create(logging=False)

# get a response
for response in forefront.StreamingCompletion.create(
    account_data=account_data,
    prompt='hello world',
    model='gpt-4'
):
    print(response.choices[0].text, end='')
print("")

After its execution, there is no output in the console.

Screenshots изображение

Environement

  • python version - 3.10.6

MandarinAxle avatar May 15 '23 19:05 MandarinAxle

I have the same problem:

xxx=forefront.StreamingCompletion.create(account_data=account_data,prompt='who are you',model='gpt-3.5') yyy=list(xxx) yyy []

here is the "warm" but unhelpful answer by GPT-4 :

I apologize for the confusion earlier. If you're getting an empty list after converting the generator to a list, it's possible that the generator is not producing any output. This could be due to an issue with the library itself or the way it's being used.
To further investigate the issue, I recommend the following steps:
**Check the library's documentation**: Ensure that you're using the gpt4free library and its methods correctly. The documentation should provide examples and explanations on how to use the library effectively.
**Examine the library's source code**: If the documentation doesn't provide enough information, you can try looking at the library's source code to understand how the forefront.StreamingCompletion.create() method works and what might be causing the empty output.
**Debug your code:** Add print statements or use a debugger to step through your code and see where the issue might be occurring. This can help you identify any problems with the input parameters or the way you're using the library.
**Reach out to the library's maintainers or community**: If you're still unable to resolve the issue, consider reaching out to the library's maintainers or community for support. They might have more insights into the specific issue you're facing and can provide guidance on how to resolve it.
Remember that as a software engineer, it's essential to have a problem-solving mindset and be persistent in finding solutions to issues. Debugging and troubleshooting are crucial skills in software development, and working through challenges like this can help you improve your skills and become a better engineer.

lynhsiong avatar May 16 '23 00:05 lynhsiong

Same as you, when I tried the sample code in gpt4free/gpt4free/forefront/README.md, I encountered the same issue.

And when I tried running this code, I got an error: ` import forefront

account_data = forefront.Account.create(logging=False) response = forefront.Completion.create(account_data=account_data, prompt='Hello!', model='gpt-4') print(response) `

Traceback (most recent call last): File "/home/ubuntu/2-code/gpt4free/gpt4free/test.py", line 5, in response = forefront.Completion.create(account_data=account_data, prompt='Hello!', model='gpt-4') File "/home/ubuntu/2-code/gpt4free/gpt4free/forefront/init.py", line 212, in create raise RuntimeError('Unable to get the response, Please try again') RuntimeError: Unable to get the response, Please try again

python --version Python 3.10.6

ipdor avatar May 16 '23 02:05 ipdor

same problem

uxhao-o avatar May 16 '23 02:05 uxhao-o

20230516114118

kevinDaGeGe avatar May 16 '23 03:05 kevinDaGeGe

same problem +1

skywalk163 avatar May 16 '23 04:05 skywalk163

forefront change the signature code https://github.com/xiangsx/gpt4free-ts/issues/22

xchwarze avatar May 16 '23 16:05 xchwarze