Zai-Kun / reverse-engineered-chatgpt

Unofficial reverse-engineered ChatGPT API in Python
Apache License 2.0
240 stars 31 forks source link

Need help assigning chatgpt response to a variable #38

Closed GowthamPrakaash closed 4 months ago

GowthamPrakaash commented 4 months ago

Hi guys, This might not be the right place to ask this question as this is not an issue, but I need some help.

I am trying to assign the chatgpt response from SyncChatGPT into a variable but its just giving me empty string(or None). Using the print and flush method works. But I need to assign the text to a variable for my use case.

I am new to async and buffered I\Os. Not sure if that is the reason for this. Can someone help me? @Zai-Kun / @Barrierml

Thanks.

GowthamPrakaash commented 4 months ago

I got it resolved. Finally found a stupid mistake that I made that did not return the value. I was distracted because of flush and generators, thinking something related to that was causing this issue. This is not even because of them.

Sorry for creating this issue in the first place. Thanks for sharing this amazing repo.