Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async and streaming #8

Merged
merged 3 commits into from
Feb 10, 2025
Merged

Async and streaming #8

merged 3 commits into from
Feb 10, 2025

Conversation

deep-diver
Copy link
Owner

Closes #4

@deep-diver deep-diver requested a review from sayakpaul February 10, 2025 02:16
Copy link
Collaborator

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Just two minor comments.


response_chunks = ""
async for chunk in await client.aio.models.generate_content_stream(
model="gemini-2.0-flash", contents=state['messages'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this configurable.

main.py Outdated
model_response = response.text

response_chunks = ""
async for chunk in await client.aio.models.generate_content_stream(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer using a variable for await client.aio.models.generate_content_stream().

@deep-diver deep-diver merged commit d46802d into main Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streaming support for chatbot
2 participants