gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

multiple values for keyword argument 'stream'

Open tristandevs opened this issue 2 years ago • 4 comments

Code:

import g4f
import asyncio

async def main():
 response = await g4f.ChatCompletion.create_async(
    model="gpt-4",
    provider=g4f.Provider.Bing,
    messages=[{"role": "user", "content": "Hello world"}],
    stream=True,
 )

 print(response)

asyncio.run(main())

Error: TypeError: g4f.Provider.Bing.Bing.create_async_generator() got multiple values for keyword argument 'stream'

tristandevs avatar Oct 02 '23 22:10 tristandevs

create_async doesn't support stream=True,

hlohaus avatar Oct 03 '23 05:10 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Oct 11 '23 00:10 github-actions[bot]

create_async doesn't support stream=True,

@hlohaus Hi, do you have an example for a small code snippet where you can use stream=True?

I want to basically make it stream the response in the command line, is it possible?

Thank you.

plia7 avatar Apr 05 '24 06:04 plia7

I have included the AsyncClient with examples in the documentation.

hlohaus avatar Apr 23 '24 04:04 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar May 18 '24 00:05 github-actions[bot]