diff --git a/g4f/Providers/helpers/you.py b/g4f/Providers/helpers/you.py index 86a6fa7..f9511b5 100644 --- a/g4f/Providers/helpers/you.py +++ b/g4f/Providers/helpers/you.py @@ -61,11 +61,13 @@ params = urllib.parse.urlencode({ 'chat': transform(messages) }) + def output(chunk): if b'"youChatToken"' in chunk: chunk_json = json.loads(chunk.decode().split('data: ')[1]) print(chunk_json['youChatToken'], flush=True) + response = requests.get(f'https://you.com/api/streamingSearch?{params}', - headers=headers, content_callback=output, impersonate='safari15_5') + headers=headers, content_callback=output, impersonate='safari15_5') \ No newline at end of file