-
Notifications
You must be signed in to change notification settings - Fork 325
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
Conversation
src/pipecat/services/together.py
Outdated
if frame.top_p is not None: | ||
await self.set_top_p(frame.top_p) | ||
if frame.extra: | ||
await self.set_extra(frame.extra) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
src/pipecat/services/openai.py
Outdated
if frame.top_p is not None: | ||
await self.set_top_p(frame.top_p) | ||
if frame.extra: | ||
await self.set_extra(frame.extra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
src/pipecat/services/ai_services.py
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
src/pipecat/services/ai_services.py
Outdated
if frame.model is not None: | ||
await self.set_model(frame.model) | ||
if frame.language is not None: | ||
await self.set_language(frame.language) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
LGTM! Thank you for doing this! Just minor comment |
b7c9bb5
to
1f77863
Compare
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
andlanguage
for TTS services, so I'm aligning tolanguage
for all services.