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

Consolidate update frames classes into a single UpdateSettingsFrame class #517

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

markbackman
Copy link
Contributor

@markbackman markbackman commented Sep 27, 2024

TTSUpdateSettingsFrame, STTUpdateSettingsFrame, and LLMUpdateSettingsFrame replace the corresponding settings frames for TTS, STT, and LLM.

@aconchillo this is to simplify the updates into a single frame, as you requested. This feels much cleaner!

Also, related to updates, I noticed that there was mixed use of language_code and language for TTS services, so I'm aligning to language for all services.

if frame.top_p is not None:
await self.set_top_p(frame.top_p)
if frame.extra:
await self.set_extra(frame.extra)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind create a function for this so we only have:

        elif isinstance(frame, LLMUpdateSettingsFrame):
            await self._update_setting(frame)

Just trying to keep process_frame() as short as possible, because sometimes it can get too long.

Copy link
Contributor

Choose a reason for hiding this comment

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

await self._update_settings(frame) (plural)

if frame.top_p is not None:
await self.set_top_p(frame.top_p)
if frame.extra:
await self.set_extra(frame.extra)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

if frame.style_degree is not None:
await self.set_style_degree(frame.style_degree)
if frame.role is not None:
await self.set_role(frame.role)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

if frame.model is not None:
await self.set_model(frame.model)
if frame.language is not None:
await self.set_language(frame.language)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@aconchillo
Copy link
Contributor

LGTM! Thank you for doing this! Just minor comment

@markbackman markbackman merged commit 46ac767 into main Sep 30, 2024
3 checks passed
@aconchillo aconchillo deleted the mb/update-settings-frame branch October 23, 2024 20:55
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.

2 participants