gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

🔨 update(theb/__init__.py): add get_response method to Completion class

Open RoryDotGG opened this issue 2 years ago • 0 comments

The get_response method was added to the Completion class to allow for easier retrieval of the response from the API. This method takes in a prompt and an optional proxy and returns the response as a string. The method uses the create method to generate a generator object and then iterates over it to append each message to a list. Finally, the list is joined into a single string and returned. This allows for non stream usage of theb which can cause issues in async applications.

RoryDotGG avatar May 04 '23 16:05 RoryDotGG