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

Streaming choice feature #2070

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

basicbloke
Copy link
Contributor

Description

A checkbox in the UI to switch between streaming and non-streaming response output

Type of Change

Please delete options that are not relevant.

  • [*] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [*] I stared at the code and made sure it makes sense
  • [*] Tested functionality within UI

Test Configuration:

  • Python: 3.11.9

Checklist:

  • [*] I have performed a self-review of my code
  • [*] My changes generate no new warnings

Notes:

Code under summarize is commented because I did not have success in employing that mode. While debugging I found that summarization would loop the output within the console and never result in output within the UI.

return {
True: getattr(service, f'stream_{service_type}'),
False: getattr(service, f'{service_type}')
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think reflection is necessary in this case. It complicates the understanding of the method a lot.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider use lambda function or conventional functions and a switch statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My apologies on merging main after the commit

@jaluma
Copy link
Collaborator

jaluma commented Sep 10, 2024

Can you do make check; make test; and fix any issue in the code?

jaluma
jaluma previously approved these changes Sep 11, 2024
Copy link
Collaborator

@jaluma jaluma left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you!

Comment on lines 101 to 102
self._response_style = True

Copy link
Collaborator

Choose a reason for hiding this comment

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

this variable name is very confusing, either make it explicit response_streaming = True or response_style = "streaming"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point/suggestion. Changed checkbox to dropdown menu.

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.

3 participants